From 824eefe427f71a8083bb7163d2033704cfe3606b Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 29 Nov 2012 14:28:39 -0500 Subject: [PATCH] Warn if try to set coding in dir-locals (bug#7169) * lisp/files.el (hack-dir-local-variables): Warn if try to set coding via dir-locals, since it doesn't work. --- lisp/ChangeLog | 3 +++ lisp/files.el | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0f2a4b0ad5f..419c95114c8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-11-29 Glenn Morris + * files.el (hack-dir-local-variables): Warn if try to set + coding via dir-locals, since it doesn't work. (Bug#7169) + Add desktop support for restoring vc-dir buffers. (Bug#10606) * vc/vc-dir.el (vc-dir-mode): Autoload it (for desktop restore). Set buffer-local value of desktop-save-buffer. diff --git a/lisp/files.el b/lisp/files.el index c22cfd69549..e03b02193a4 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3682,10 +3682,13 @@ and `file-local-variables-alist', without applying them." (dir-locals-get-class-variables class) dir-name nil))) (when variables (dolist (elt variables) - (unless (memq (car elt) '(eval mode)) - (setq dir-local-variables-alist - (assq-delete-all (car elt) dir-local-variables-alist))) - (push elt dir-local-variables-alist)) + (if (eq (car elt) 'coding) + (display-warning :warning + "Coding cannot be specified by dir-locals") + (unless (memq (car elt) '(eval mode)) + (setq dir-local-variables-alist + (assq-delete-all (car elt) dir-local-variables-alist))) + (push elt dir-local-variables-alist))) (hack-local-variables-filter variables dir-name))))))) (defun hack-dir-local-variables-non-file-buffer () -- 2.39.5