diff options
author | Alan Mackenzie <[email protected]> | 2009-07-18 20:41:32 +0000 |
---|---|---|
committer | Alan Mackenzie <[email protected]> | 2009-07-18 20:41:32 +0000 |
commit | 982cbcabc07cd26ef17894547a40745c9231479c (patch) | |
tree | 40949b5bf310e94b07eb9614c88f22e87adced54 | |
parent | 10d37df7e232024b86622b57018ea1b5e14e3785 (diff) |
(hack-local-variables-filter): Remove entries with duplicate keys from
`file-local-variables-alist'.
-rw-r--r-- | lisp/files.el | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el index 0c4edf6336..7568bd0492 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2960,7 +2960,11 @@ DIR-NAME is a directory name if these settings come from (dolist (elt variables) (unless (or (member elt unsafe-vars) (member elt risky-vars)) - (push elt file-local-variables-alist))) + (let ((var (car elt))) + (unless (eq var 'eval) + (setq file-local-variables-alist + (assq-delete-all var file-local-variables-alist))) + (push elt file-local-variables-alist)))) ;; Query, unless all are known safe or the user wants no ;; querying. (if (or (and (eq enable-local-variables t) @@ -2970,7 +2974,12 @@ DIR-NAME is a directory name if these settings come from (hack-local-variables-confirm variables unsafe-vars risky-vars dir-name)) (dolist (elt variables) - (push elt file-local-variables-alist))))))) + (let ((var (car elt))) + (unless (eq var 'eval) + (setq file-local-variables-alist + (assq-delete-all var file-local-variables-alist))) + (push elt file-local-variables-alist)))))))) + (defun hack-local-variables (&optional mode-only) "Parse and put into effect this buffer's local variables spec. @@ -3073,6 +3082,7 @@ is specified, returning t if it is specified." (enable-local-variables (hack-local-variables-filter result nil) (when file-local-variables-alist + ;; Any 'evals must run in the Right sequence. (setq file-local-variables-alist (nreverse file-local-variables-alist)) (run-hooks 'before-hack-local-variables-hook) |