emacs-diffs
[Top][All Lists]
Advanced

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

master 5b463af: Tweak how ido handles killing virtual buffers


From: Lars Ingebrigtsen
Subject: master 5b463af: Tweak how ido handles killing virtual buffers
Date: Sat, 15 Aug 2020 06:33:49 -0400 (EDT)

branch: master
commit 5b463af8dda4d66bb63a7ce58177e83a42541bac
Author: Dario Gjorgjevski <dario.gjorgjevski+git@gmail.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Tweak how ido handles killing virtual buffers
    
    * lisp/ido.el (ido-buffer-internal): Handle killing of virtual buffers
    as a special case.
    (ido-visit-buffer): Document the special case (bug#38294).
---
 etc/NEWS    | 6 ++++++
 lisp/ido.el | 6 +++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index 9fcc89c..66f4f71 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -793,6 +793,12 @@ digits.
 ** Miscellaneous
 
 ---
+*** 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.
diff --git a/lisp/ido.el b/lisp/ido.el
index e834916..ad7500c 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -2216,7 +2216,10 @@ If cursor is not at the end of the user input, move to 
end of input."
        ((and ido-enable-virtual-buffers
             ido-virtual-buffers
             (setq filename (assoc buf ido-virtual-buffers)))
-       (ido-visit-buffer (find-file-noselect (cdr filename)) method t))
+        (if (eq method 'kill)
+            (setq recentf-list
+                 (delete (cdr filename) recentf-list))
+         (ido-visit-buffer (find-file-noselect (cdr filename)) method t)))
 
        ((and (eq ido-create-new-buffer 'prompt)
             (null require-match)
@@ -4073,6 +4076,7 @@ Record command in `command-history' if optional RECORD is 
non-nil."
       (setq buffer (buffer-name buffer)))
   (let (win newframe)
     (cond
+     ;; "Killing" of virtual buffers is handled in `ido-buffer-internal'.
      ((eq method 'kill)
       (if record
          (ido-record-command 'kill-buffer buffer))



reply via email to

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