]> code.delx.au - gnu-emacs/commitdiff
* files.el (set-auto-mode): Handle also remote files wrt
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 5 Aug 2007 08:50:52 +0000 (08:50 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 5 Aug 2007 08:50:52 +0000 (08:50 +0000)
`auto-mode-alist'.

lisp/ChangeLog
lisp/files.el

index e110e75e90adca0c3dd609d9564513cd2dc897fe..ba333b7982bc275b9320ad4e7ea489d969848b35 100644 (file)
@@ -1,3 +1,8 @@
+2007-08-05  Michael Albinus  <michael.albinus@gmx.de>
+
+       * files.el (set-auto-mode): Handle also remote files wrt
+       `auto-mode-alist'.
+
 2007-08-04  Jay Belanger  <belanger@localhost.localdomain>
 
        * calc/calcalg3.el (calc-curve-fit): Add support for nonlinear
index 9cc64284d15d35ad1df69dec6bf79d9b408060b2..e2cde74d6a14ea8aaddab1e83b8544200e6e1149 100644 (file)
@@ -2310,7 +2310,12 @@ we don't actually set it to the same mode the buffer already has."
     ;; Next compare the filename against the entries in auto-mode-alist.
     (unless done
       (if buffer-file-name
-         (let ((name buffer-file-name))
+         (let ((name buffer-file-name)
+               (remote-id (file-remote-p buffer-file-name)))
+           ;; Remove remote file name identification.
+           (when (and (stringp remote-id)
+                      (string-match remote-id name))
+             (setq name (substring name (match-end 0))))
            ;; Remove backup-suffixes from file name.
            (setq name (file-name-sans-versions name))
            (while name