* files.el (enable-remote-dir-locals): New option.
authorMichael Albinus <michael.albinus@gmx.de>
Wed, 6 Jun 2012 12:34:09 +0000 (14:34 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Wed, 6 Jun 2012 12:34:09 +0000 (14:34 +0200)
(hack-dir-local-variables): Use it.  (Bug#1933, Bug#6731)

lisp/ChangeLog
lisp/files.el

index 211ea18..6ba7a32 100644 (file)
@@ -1,3 +1,8 @@
+2012-06-06  Michael Albinus  <michael.albinus@gmx.de>
+
+       * files.el (enable-remote-dir-locals): New option.
+       (hack-dir-local-variables): Use it.  (Bug#1933, Bug#6731)
+
 2012-06-06  Glenn Morris  <rgm@gnu.org>
 
        * vc/vc-rcs.el (vc-rcs-rcs2log-program): New.
index dad0423..7f92ba7 100644 (file)
@@ -3668,12 +3668,20 @@ is found.  Returns the new class name."
              class-name))
        (error (message "Error reading dir-locals: %S" err) nil)))))
 
+(defcustom enable-remote-dir-locals nil
+  "Non-nil means dir-local variables will be applied to remote files."
+  :version "24.2"
+  :type 'boolean
+  :group 'find-file)
+
 (defun hack-dir-local-variables ()
   "Read per-directory local variables for the current buffer.
 Store the directory-local variables in `dir-local-variables-alist'
 and `file-local-variables-alist', without applying them."
   (when (and enable-local-variables
-            (not (file-remote-p (or (buffer-file-name) default-directory))))
+            (or enable-remote-dir-locals
+                (not (file-remote-p (or (buffer-file-name)
+                                        default-directory)))))
     ;; Find the variables file.
     (let ((variables-file (dir-locals-find-file
                            (or (buffer-file-name) default-directory)))