diff options
| author | Glenn Morris | 2012-08-07 14:41:39 -0400 |
|---|---|---|
| committer | Glenn Morris | 2012-08-07 14:41:39 -0400 |
| commit | f40b9f106b43a3602ae10db0261de924dc5c5b59 (patch) | |
| tree | 3384b3c4281312da656634cb46cccc937c68819e | |
| parent | db74a5fcb7ebed92c0a944c38b61de1c7ebb87d0 (diff) | |
| download | emacs-f40b9f106b43a3602ae10db0261de924dc5c5b59.tar.gz emacs-f40b9f106b43a3602ae10db0261de924dc5c5b59.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/files.el | 15 |
2 files changed, 16 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d8bf55e0066..7d61d9d69b8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-08-07 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * files.el (hack-local-variables-filter): If an eval: form is not | ||
| 4 | known to be safe, and enable-local-variables is :safe, then ignore | ||
| 5 | the form totally, as is done for non-eval forms. (Bug#12155) | ||
| 6 | |||
| 1 | 2012-08-07 Chong Yidong <cyd@gnu.org> | 7 | 2012-08-07 Chong Yidong <cyd@gnu.org> |
| 2 | 8 | ||
| 3 | * mouse.el (mouse-drag-track): Deactivate the mark before popping. | 9 | * mouse.el (mouse-drag-track): Deactivate the mark before popping. |
diff --git a/lisp/files.el b/lisp/files.el index cf9521731e2..02c9e04311e 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -3107,11 +3107,16 @@ DIR-NAME is the name of the associated directory. Otherwise it is nil." | |||
| 3107 | ;; Obey `enable-local-eval'. | 3107 | ;; Obey `enable-local-eval'. |
| 3108 | ((eq var 'eval) | 3108 | ((eq var 'eval) |
| 3109 | (when enable-local-eval | 3109 | (when enable-local-eval |
| 3110 | (push elt all-vars) | 3110 | (let ((safe (or (hack-one-local-variable-eval-safep |
| 3111 | (or (eq enable-local-eval t) | 3111 | (eval (quote val))) |
| 3112 | (hack-one-local-variable-eval-safep (eval (quote val))) | 3112 | ;; In case previously marked safe (bug#5636). |
| 3113 | (safe-local-variable-p var val) | 3113 | (safe-local-variable-p var val)))) |
| 3114 | (push elt unsafe-vars)))) | 3114 | ;; If not safe and e-l-v = :safe, ignore totally. |
| 3115 | (when (or safe (not (eq enable-local-variables :safe))) | ||
| 3116 | (push elt all-vars) | ||
| 3117 | (or (eq enable-local-eval t) | ||
| 3118 | safe | ||
| 3119 | (push elt unsafe-vars)))))) | ||
| 3115 | ;; Ignore duplicates (except `mode') in the present list. | 3120 | ;; Ignore duplicates (except `mode') in the present list. |
| 3116 | ((and (assq var all-vars) (not (eq var 'mode))) nil) | 3121 | ((and (assq var all-vars) (not (eq var 'mode))) nil) |
| 3117 | ;; Accept known-safe variables. | 3122 | ;; Accept known-safe variables. |