# HG changeset patch # User Alan Mackenzie # Date 1247949692 0 # Node ID 73a2130eb104a2d0260b2bb5c12556858d1105d9 # Parent 484bf5aa1964791d6bbbdcb3263c1059a95fe21f (hack-local-variables-filter): Remove entries with duplicate keys from `file-local-variables-alist'. diff -r 484bf5aa1964 -r 73a2130eb104 lisp/files.el --- a/lisp/files.el Sat Jul 18 20:40:39 2009 +0000 +++ b/lisp/files.el Sat Jul 18 20:41:32 2009 +0000 @@ -2960,7 +2960,11 @@ (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 @@ (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 @@ (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)