diff options
Diffstat (limited to 'lisp/files.el')
-rw-r--r-- | lisp/files.el | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el index 460b005b9ef..e89c3075397 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2337,6 +2337,7 @@ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'" . archive-mode) ("\\.oak\\'" . scheme-mode) ("\\.sgml?\\'" . sgml-mode) ("\\.x[ms]l\\'" . xml-mode) + ("\\.dbk\\'" . xml-mode) ("\\.dtd\\'" . sgml-mode) ("\\.ds\\(ss\\)?l\\'" . dsssl-mode) ("\\.js\\'" . js-mode) ; javascript-mode would be better @@ -4167,11 +4168,29 @@ on a DOS/Windows machine, it returns FILENAME in expanded form." (dremote (file-remote-p directory))) (if ;; Conditions for separate trees (or - ;; Test for different drives on DOS/Windows + ;; Test for different filesystems on DOS/Windows (and ;; Should `cygwin' really be included here? --stef (memq system-type '(ms-dos cygwin windows-nt)) - (not (eq t (compare-strings filename 0 2 directory 0 2)))) + (or + ;; Test for different drive letters + (not (eq t (compare-strings filename 0 2 directory 0 2))) + ;; Test for UNCs on different servers + (not (eq t (compare-strings + (progn + (if (string-match "\\`//\\([^:/]+\\)/" filename) + (match-string 1 filename) + ;; Windows file names cannot have ? in + ;; them, so use that to detect when + ;; neither FILENAME nor DIRECTORY is a + ;; UNC. + "?")) + 0 nil + (progn + (if (string-match "\\`//\\([^:/]+\\)/" directory) + (match-string 1 directory) + "?")) + 0 nil t))))) ;; Test for different remote file system identification (not (equal fremote dremote))) filename |