changeset 78410:7ed1b196b926

* 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:57:24 +0000
parents a353ba061f01
children 58cb4546b377
files lisp/ChangeLog lisp/files.el
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Aug 04 02:35:10 2007 +0000
+++ b/lisp/ChangeLog	Sun Aug 05 08:57:24 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  Glenn Morris  <rgm@gnu.org>
 
 	* autorevert.el (auto-revert-tail-mode): auto-revert-tail-pos is
--- a/lisp/files.el	Sat Aug 04 02:35:10 2007 +0000
+++ b/lisp/files.el	Sun Aug 05 08:57:24 2007 +0000
@@ -2259,7 +2259,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