Subject: 23.0.60; [PATCH] dir-local variables don't work on remote files

From: Ian Eure <[email-masked]>
Date: Fri, 16 Jan 2009 10:08:27 -0800

I guess for speed reasons, dir-local-variables don’t work when opening  
remote fiales. Which is unfortunate for me, since I need them. Here’s  
a patch against HEA which implements a simple switch for it, defaulted  
to the current behavior.

--- files.el.~1.1032.~	2009-01-16 09:54:05.000000000 -0800
+++ files.el	2009-01-16 10:03:58.000000000 -0800
@@ -170,6 +170,11 @@
    :type '(repeat regexp)
    :group 'find-file)

+(defcustom dir-locals-apply-to-remote nil
+  "Non-nil means dir-local variables will be applied to remote files."
+  :type 'boolean
+  :group 'find-file)
+
  (defvar buffer-file-number nil
    "The device number and file number of the file visited in the  
current buffer.
  The value is a list of the form (FILENUM DEVNUM).
@@ -3323,7 +3328,8 @@
  without applying them."
    (when (and enable-local-variables
  	     (buffer-file-name)
-	     (not (file-remote-p (buffer-file-name))))
+             (and (file-remote-p (buffer-file-name))
+                  dir-locals-apply-to-remote))
      ;; Find the variables file.
      (let ((variables-file (dir-locals-find-file (buffer-file-name)))
  	  (class nil)

In GNU Emacs 23.0.60.1 (i386-apple-darwin9.6.0, NS apple-appkit-949.43)
  of 2009-01-16 on neutron.local
Windowing system distributor `Apple', version 10.3.949
configured using `configure  '--with-ns''

Important settings:
   value of $LC_ALL: nil
   value of $LC_COLLATE: nil
   value of $LC_CTYPE: nil
   value of $LC_MESSAGES: nil
   value of $LC_MONETARY: nil
   value of $LC_NUMERIC: nil
   value of $LC_TIME: nil
   value of $LANG: nil
   value of $XMODIFIERS: nil
   locale-coding-system: nil
   default-enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
   diff-auto-refine-mode: t
   erc-track-mode: t
   erc-track-minor-mode: t
   erc-spelling-mode: t
   erc-ring-mode: t
   erc-pcomplete-mode: t
   erc-netsplit-mode: t
   erc-match-mode: t
   erc-button-mode: t
   erc-fill-mode: t
   erc-autojoin-mode: t
   erc-irccontrols-mode: t
   erc-noncommands-mode: t
   erc-readonly-mode: t
   erc-scrolltobottom-mode: t
   light-symbol-mode: t
   hl-line-mode: t
   eldoc-mode: t
   which-function-mode: t
   twit-mode: t
   yas/minor-mode: t
   shell-dirtrack-mode: t
   ime-bindings: t
   show-paren-mode: t
   recentf-mode: t
   iswitchb-mode: t
   auto-insert-mode: t
   tooltip-mode: t
   mouse-wheel-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   global-auto-composition-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   size-indication-mode: t
   column-number-mode: t
   line-number-mode: t
   transient-mark-mode: t
   abbrev-mode: t

Recent input:
<return> C-h v p h p u <tab> p <tab> <return> C-x o
C-x k RET C-x o C-h v u s e r - m <tab> <return> C-x
o C-x k RET C-x o C-x b <return> M-v M-v C-p C-p C-p
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p
C-p C-p M-f C-f C-M-@ M-w C-n C-n C-n C-e <return>
<return> M-( s e t q SPC C-y SPC t C-e C-x C-e C-x
o C-x b C a c <return> C-x k RET <return> y C-x k RET
C-x b <return> C-x v = C-v M-> M-< C-x o C-x C-v u
C-g C-x o M-n M-> M-v M-v C-x C-g C-v C-x 4 0 C-x v
u y C-h v b e f o r e - s a <tab> <return> M-: M-(
s e t q SPC b e f M-/ - M-/ SPC n i l <return> C-x
1 C-x b s c r <return> M-< C-x k RET C-x b l i <return>
M-< C-SPC C-n C-n C-n C-e M-w C-x b <return> M-< C-s
: f i n d - f i l e C-n C-p C-s C-s M-< C-s d e f c
u s t o n C-v C-v C-v C-v C-n C-n C-n C-e <return>
<return> C-y C-x b <return> C-n C-p C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-p M-m C-M-k C-_ C-x b
<return> C-s h a s <backspace> c k - d i r - l o C-s
C-n C-n C-n C-n C-n C-e <return> C-y C-M-k C-p C-e
<backspace> M-` M-` C-x = C-x o C-x 4 0 C-x C-s C-x
v = C-v M-v C-x C-w ~ / C-g C-g C-x o <menu-bar> <help-menu>
<send-emacs-bug-report>

Recent messages:
Mark set
Mark saved where search started
Mark set
Undo!
Mark saved where search started
Mark set
Saving file /Users/ieure/Projects/emacs/lisp/files.el...
Wrote /Users/ieure/Projects/emacs/lisp/files.el
Finding changes in /Users/ieure/Projects/emacs/lisp/files.el...done
Quit
Quit