changeset 82275:b7b1c3d757cf

* files.el (set-auto-mode): Handle also remote files wrt `auto-mode-alist'.
author Michael Albinus <michael.albinus@gmx.de>
date Sun, 05 Aug 2007 08:50:52 +0000
parents f68e9e7acaf6
children d5f5a6607c96
files lisp/ChangeLog lisp/files.el
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun Aug 05 02:09:12 2007 +0000
+++ b/lisp/ChangeLog	Sun Aug 05 08:50:52 2007 +0000
@@ -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
--- a/lisp/files.el	Sun Aug 05 02:09:12 2007 +0000
+++ b/lisp/files.el	Sun Aug 05 08:50:52 2007 +0000
@@ -2310,7 +2310,12 @@
     ;; 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