]> git.eshelyaron.com Git - emacs.git/commitdiff
(ffap-read-file-or-url): Don't use let-binding to temporarily
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 9 Jan 2008 02:16:47 +0000 (02:16 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 9 Jan 2008 02:16:47 +0000 (02:16 +0000)
add a file-name handler.

lisp/ChangeLog
lisp/ffap.el

index cc79ba3b15637e4bf87864094ea11f19a37e26ed..029a81975fa330b8ddb379a3e9a98325cdd4a169 100644 (file)
@@ -1,20 +1,22 @@
+2008-01-09  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * ffap.el (ffap-read-file-or-url): Don't use let-binding to temporarily
+       add a file-name handler.
+
 2008-01-08  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
 
-       * textmodes/bibtex.el (bibtex-initialize): New autoloaded
-       command. Rename from function bibtex-files-expand. New optional
-       arg select.
+       * textmodes/bibtex.el (bibtex-initialize): New autoloaded command.
+       Rename from function bibtex-files-expand.  New optional arg select.
        (bibtex-flash-head): Allow blink-matching-delay being zero.
        (bibtex-clean-entry): Use atomic-change-group.
        (bibtex-format-entry): Check presence of required fields only
        after formatting of fields.  Use member-ignore-case.  Do not use
-       bibtex-parse-entry.  Do not use booktitle field to set a missing
-       title.
+       bibtex-parse-entry.  Do not use booktitle field to set a missing title.
        (bibtex-autofill-entry): Do not call undo-boundary.
-       (bibtex-lessp): Handle crossref keys that point to another bibtex
-       file.
+       (bibtex-lessp): Handle crossref keys that point to another bibtex file.
        (bibtex-sort-buffer, bibtex-prepare-new-entry, bibtex-validate):
        Parse keys if necessary.
-       
+
 2008-01-08  Nick Roberts  <nickrob@snap.net.nz>
 
        * progmodes/gdb-ui.el (gdb-var-list-children-1): Put varnum in
@@ -22,8 +24,8 @@
 
 2008-01-08  Nick Roberts  <nickrob@snap.net.nz>
 
-       * progmodes/gdb-ui.el (gud-gdb-command-name): Explain
-       "--annotate=3" option is necessary for the Graphical Interface.
+       * progmodes/gdb-ui.el (gud-gdb-command-name):
+       Explain "--annotate=3" option is necessary for the Graphical Interface.
 
 2008-01-08  Nick Roberts  <nickrob@snap.net.nz>
 
 
        * time-stamp.el (time-stamp-time-zone):
        * whitespace.el (whitespace-check-buffer-leading)
-       (whitespace-check-buffer-trailing)
-       (whitespace-check-buffer-indent)
-       (whitespace-check-buffer-spacetab)
-       (whitespace-check-buffer-ateol):
+       (whitespace-check-buffer-trailing, whitespace-check-buffer-indent)
+       (whitespace-check-buffer-spacetab, whitespace-check-buffer-ateol):
        * progmodes/sh-script.el (sh-indentation):
        * textmodes/ispell.el (ispell-local-pdict):
        Add safe-local-variable properties.
index 52fb372b8cd1ee956c9b6f5f06dfcf990815c444..fa5e70e860bbf2fbb9677f5c4d7b23630be4424f 100644 (file)
@@ -1263,20 +1263,25 @@ which may actually result in an url rather than a filename."
          (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)))
-      (setq guess
-           (completing-read
-            prompt
-            'ffap-read-file-or-url-internal
-            dir
-            nil
-            (if dir (cons guess (length dir)) guess)
-            (list 'file-name-history)
-            (and buffer-file-name
-                 (abbreviate-file-name buffer-file-name)))))
+          (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
+                 'ffap-read-file-or-url-internal
+                 dir
+                 nil
+                 (if dir (cons guess (length dir)) guess)
+                 (list 'file-name-history)
+                 (and 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.