emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/ffap.el,v
Date: Wed, 09 Jan 2008 02:16:50 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        08/01/09 02:16:49

Index: ffap.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/ffap.el,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -b -r1.68 -r1.69
--- ffap.el     8 Jan 2008 20:44:45 -0000       1.68
+++ ffap.el     9 Jan 2008 02:16:47 -0000       1.69
@@ -1263,10 +1263,10 @@
          (setq dir (file-name-directory guess))))
     (let ((minibuffer-completing-file-name t)
          (completion-ignore-case read-file-name-completion-ignore-case)
-         ;; because of `rfn-eshadow-update-overlay'.
-         (file-name-handler-alist
-          (cons (cons ffap-url-regexp 'url-file-handler)
-                file-name-handler-alist)))
+          (fnh-elem (cons ffap-url-regexp 'url-file-handler)))
+      ;; Explain to `rfn-eshadow' that we can use URLs here.
+      (push fnh-elem file-name-handler-alist)
+      (unwind-protect
       (setq guess
            (completing-read
             prompt
@@ -1276,7 +1276,12 @@
             (if dir (cons guess (length dir)) guess)
             (list 'file-name-history)
             (and buffer-file-name
-                 (abbreviate-file-name buffer-file-name)))))
+                      (abbreviate-file-name buffer-file-name))))
+        ;; Remove the special handler manually.  We used to just let-bind
+        ;; file-name-handler-alist to preserve its value, but that caused
+        ;; other modifications to be lost (e.g. when Tramp gets loaded
+        ;; during the completing-read call).
+        (setq file-name-handler-alist (delq fnh-elem 
file-name-handler-alist))))
     ;; Do file substitution like (interactive "F"), suggested by MCOOK.
     (or (ffap-url-p guess) (setq guess (substitute-in-file-name guess)))
     ;; Should not do it on url's, where $ is a common (VMS?) character.




reply via email to

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