summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2007-08-05 08:57:24 +0000
committerMichael Albinus <michael.albinus@gmx.de>2007-08-05 08:57:24 +0000
commit212b7268410aaf5bf4820a6c5e20eccedb7a4f32 (patch)
treecc435235a3f3fe40b0b040c464cb6b8f2b68d965 /lisp/files.el
parentb1ab8c381057452c4ad8010c4da8be2ddfeed1cf (diff)
downloademacs-212b7268410aaf5bf4820a6c5e20eccedb7a4f32.tar.gz
* files.el (set-auto-mode): Handle also remote files wrt
`auto-mode-alist'.
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 444e402f438..135ccfafb92 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2259,7 +2259,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