From dfb308badd63c6046545293306117c1ff117b8f0 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Wed, 6 Jun 2012 14:34:09 +0200 Subject: [PATCH] * files.el (enable-remote-dir-locals): New option. (hack-dir-local-variables): Use it. (Bug#1933, Bug#6731) --- lisp/ChangeLog | 5 +++++ lisp/files.el | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 211ea180ec4..6ba7a327ad3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-06-06 Michael Albinus + + * files.el (enable-remote-dir-locals): New option. + (hack-dir-local-variables): Use it. (Bug#1933, Bug#6731) + 2012-06-06 Glenn Morris * vc/vc-rcs.el (vc-rcs-rcs2log-program): New. diff --git a/lisp/files.el b/lisp/files.el index dad04236ca3..7f92ba7b206 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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))) -- 2.39.2