]> git.eshelyaron.com Git - emacs.git/commitdiff
Warn if try to set coding in dir-locals (bug#7169)
authorGlenn Morris <rgm@gnu.org>
Thu, 29 Nov 2012 19:28:39 +0000 (14:28 -0500)
committerGlenn Morris <rgm@gnu.org>
Thu, 29 Nov 2012 19:28:39 +0000 (14:28 -0500)
* lisp/files.el (hack-dir-local-variables):
Warn if try to set coding via dir-locals, since it doesn't work.

lisp/ChangeLog
lisp/files.el

index 0f2a4b0ad5f2b57b2e81289e6b24d675907b823d..419c95114c83fb5cc2300616b230895ddd01cac9 100644 (file)
@@ -1,5 +1,8 @@
 2012-11-29  Glenn Morris  <rgm@gnu.org>
 
+       * 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.
index c22cfd6954905dd863deec627b556fe7f3b32184..e03b02193a4928529951a4ad9e022c8cadea1d26 100644 (file)
@@ -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 ()