emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r108092: hack-local-variables-filt


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r108092: hack-local-variables-filter fix for bug#12155
Date: Tue, 07 Aug 2012 14:41:39 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108092
committer: Glenn Morris <address@hidden>
branch nick: emacs-24
timestamp: Tue 2012-08-07 14:41:39 -0400
message:
  hack-local-variables-filter fix for bug#12155
  
  * lisp/files.el (hack-local-variables-filter): If an eval: form is not
  known to be safe, and enable-local-variables is :safe, then ignore
  the form totally, as is done for non-eval forms.
modified:
  lisp/ChangeLog
  lisp/files.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-08-07 03:24:35 +0000
+++ b/lisp/ChangeLog    2012-08-07 18:41:39 +0000
@@ -1,3 +1,9 @@
+2012-08-07  Glenn Morris  <address@hidden>
+
+       * files.el (hack-local-variables-filter): If an eval: form is not
+       known to be safe, and enable-local-variables is :safe, then ignore
+       the form totally, as is done for non-eval forms.  (Bug#12155)
+
 2012-08-07  Chong Yidong  <address@hidden>
 
        * mouse.el (mouse-drag-track): Deactivate the mark before popping.

=== modified file 'lisp/files.el'
--- a/lisp/files.el     2012-07-01 16:38:53 +0000
+++ b/lisp/files.el     2012-08-07 18:41:39 +0000
@@ -3107,11 +3107,16 @@
              ;; 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]