]> code.delx.au - gnu-emacs/blobdiff - lisp/files.el
Merge from emacs-24; up to 2012-05-02T11:38:01Z!lekktu@gmail.com
[gnu-emacs] / lisp / files.el
index c5651135dc1fd22c6bc9d053374ade7f32be871b..a7c9a7f7db4f02ad31d7869e1c38c34018346b4b 100644 (file)
@@ -3102,11 +3102,16 @@ DIR-NAME is the name of the associated directory.  Otherwise it is nil."
              ;; Obey `enable-local-eval'.
              ((eq var 'eval)
               (when enable-local-eval
-                (push elt all-vars)
-                (or (eq enable-local-eval t)
-                    (hack-one-local-variable-eval-safep (eval (quote val)))
-                    (safe-local-variable-p var val)
-                    (push elt unsafe-vars))))
+                (let ((safe (or (hack-one-local-variable-eval-safep
+                                 (eval (quote val)))
+                                ;; In case previously marked safe (bug#5636).
+                                (safe-local-variable-p var val))))
+                  ;; If not safe and e-l-v = :safe, ignore totally.
+                  (when (or safe (not (eq enable-local-variables :safe)))
+                    (push elt all-vars)
+                    (or (eq enable-local-eval t)
+                        safe
+                        (push elt unsafe-vars))))))
              ;; Ignore duplicates (except `mode') in the present list.
              ((and (assq var all-vars) (not (eq var 'mode))) nil)
              ;; Accept known-safe variables.