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).
This commit is contained in:
Dario Gjorgjevski 2020-08-15 12:33:37 +02:00 committed by Lars Ingebrigtsen
parent 83000ae6d7
commit 5b463af8dd
2 changed files with 11 additions and 1 deletions

View file

@ -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

View file

@ -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))