From: Dario Gjorgjevski Date: Sat, 15 Aug 2020 10:33:37 +0000 (+0200) Subject: Tweak how ido handles killing virtual buffers X-Git-Tag: emacs-28.0.90~6584^2~17 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5b463af8dda4d66bb63a7ce58177e83a42541bac;p=emacs.git 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). --- diff --git a/etc/NEWS b/etc/NEWS index 9fcc89c8669..66f4f71c55d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -792,6 +792,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 diff --git a/lisp/ido.el b/lisp/ido.el index e834916a6da..ad7500c0a1e 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))