emacs-diffs
[Top][All Lists]
Advanced

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

master de5ae0c: Make ido-mode override ffap-file-finder


From: Lars Ingebrigtsen
Subject: master de5ae0c: Make ido-mode override ffap-file-finder
Date: Thu, 8 Jul 2021 09:25:42 -0400 (EDT)

branch: master
commit de5ae0c964135dd3b1247b91b76a6581b5d8a47c
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make ido-mode override ffap-file-finder
    
    * lisp/ffap.el: Autoload so that we can override in ido (bug#21980).
    
    * lisp/ido.el (ido-everywhere): Override ffap-file-finder.
---
 etc/NEWS     | 17 +++++++++++------
 lisp/ffap.el |  1 +
 lisp/ido.el  |  4 ++++
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index b9522c0..da5524a 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2411,12 +2411,6 @@ leak information from the reporting user.
 The semantics are as with 'walk-windows'.
 
 ---
-*** Killing virtual ido buffers interactively will make them go away.
-Previously, killing a virtual ido buffer with 'ido-kill-buffer' didn't
-do anything.  This has now been changed, and killing virtual buffers
-with that command will remove the buffer from recentf.
-
----
 *** New variable 'ffap-file-name-with-spaces'.
 If non-nil, 'find-file-at-point' and friends will try to guess more
 expansively to identify a file name with spaces.
@@ -2490,6 +2484,17 @@ height of lines or width of chars.
 When non-nil, use a new xwidget webkit session after bookmark jump.
 Otherwise, it will use 'xwidget-webkit-last-session'.
 
+** ido
+
+---
+*** Switching on 'ido-mode' now also overrides 'ffap-file-finder'.
+
+---
+*** Killing virtual ido buffers interactively will make them go away.
+Previously, killing a virtual ido buffer with 'ido-kill-buffer' didn't
+do anything.  This has now been changed, and killing virtual buffers
+with that command will remove the buffer from recentf.
+
 ** Flymake mode
 
 +++
diff --git a/lisp/ffap.el b/lisp/ffap.el
index 6faf8d5..c31926e 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -260,6 +260,7 @@ ffap most of the time."
   :type 'boolean
   :group 'ffap)
 
+;;;###autoload
 (defcustom ffap-file-finder 'find-file
   "The command called by `find-file-at-point' to find a file."
   :type 'function
diff --git a/lisp/ido.el b/lisp/ido.el
index 9362904..ea5ff32 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1521,6 +1521,10 @@ Removes badly formatted data and ignored directories."
   :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)
+    (when ido-mode
+      (add-function :override ffap-file-finder #'ido-find-file)))
   (when ido-everywhere
     (if (not ido-mode)
         (ido-mode 'both)



reply via email to

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