]> git.eshelyaron.com Git - emacs.git/commitdiff
Make ffap-file-finder work again
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 6 Sep 2022 10:24:32 +0000 (12:24 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 6 Sep 2022 10:24:32 +0000 (12:24 +0200)
* lisp/ffap.el (find-file-at-point): Allow people to set
ffap-file-finder again (bug#50279).

* lisp/ido.el (ido-everywhere): Add an interstitial to fulfil
ffap-file-handler semantics.

lisp/ffap.el
lisp/ido.el

index 88b4bce9fd18d1d1c8f32cf9b77048d4813551f9..7ea05dccbdda0f45ca58c3a33c150ca8d3a133ff 100644 (file)
@@ -1623,9 +1623,9 @@ and `ffap-url-at-point'."
        ((or (not ffap-newfile-prompt)
            (file-exists-p filename)
            (y-or-n-p "File does not exist, create buffer? "))
-       (find-file
-         ;; expand-file-name fixes "~/~/.emacs" bug
-        (expand-file-name filename)))
+       (funcall ffap-file-finder
+                 ;; expand-file-name fixes "~/~/.emacs" bug
+                (expand-file-name filename)))
        ;; User does not want to find a non-existent file:
        ((signal 'file-missing (list "Opening file buffer"
                                    "No such file or directory"
index 520513b1d29ae8b5699c6dd1cae591a8cdb14689..1d0082da97c3a0d95069529628abf17b6ae55d8e 100644 (file)
@@ -1507,15 +1507,18 @@ Removes badly formatted data and ignored directories."
   (add-hook 'minibuffer-setup-hook #'ido-minibuffer-setup)
   (add-hook 'choose-completion-string-functions #'ido-choose-completion-string))
 
+(defun ido--ffap-find-file (file)
+  (find-file file))
+
 (define-minor-mode ido-everywhere
   "Toggle use of Ido for all buffer/file reading."
   :global t
   (remove-function read-file-name-function #'ido-read-file-name)
   (remove-function read-buffer-function #'ido-read-buffer)
   (when (boundp 'ffap-file-finder)
-    (remove-function ffap-file-finder #'ido-find-file)
+    (remove-function ffap-file-finder #'ido--ffap-find-file)
     (when ido-mode
-      (add-function :override ffap-file-finder #'ido-find-file)))
+      (add-function :override ffap-file-finder #'ido--ffap-find-file)))
   (when ido-everywhere
     (if (not ido-mode)
         (ido-mode 'both)