emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/files.el,v


From: Jason Rumney
Subject: [Emacs-diffs] Changes to emacs/lisp/files.el,v
Date: Fri, 11 Jul 2008 23:08:08 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Jason Rumney <jasonr>   08/07/11 23:08:07

Index: files.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/files.el,v
retrieving revision 1.986
retrieving revision 1.987
diff -u -b -r1.986 -r1.987
--- files.el    2 Jul 2008 13:19:04 -0000       1.986
+++ files.el    11 Jul 2008 23:08:07 -0000      1.987
@@ -859,8 +859,19 @@
            (setq filename (funcall handler 'file-truename filename))
          ;; If filename contains a wildcard, newname will be the old name.
          (unless (string-match "[[*?]" filename)
-           ;; If filename exists, use the long name
-           (setq filename (or (w32-long-file-name filename) filename))))
+           ;; If filename exists, use the long name.  If it doesn't exist,
+            ;; drill down until we find a directory that exists, and use
+            ;; the long name of that, with the extra non-existent path
+            ;; components concatenated.
+            (let ((longname (w32-long-file-name filename))
+                  missing rest)
+              (if longname
+                  (setq filename longname)
+                ;; include the preceding directory separator in the missing
+                ;; part so subsequent recursion on the rest works.
+                (setq missing (concat "/" (file-name-nondirectory filename)))
+                (setq rest (substring filename 0 (* -1 (length missing))))
+                (setq filename (concat (file-truename rest) missing))))))
        (setq done t)))
 
     ;; If this file directly leads to a link, process that iteratively




reply via email to

[Prev in Thread] Current Thread [Next in Thread]