diff options
| author | Dario Gjorgjevski | 2020-08-15 12:33:37 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2020-08-15 12:33:43 +0200 |
| commit | 5b463af8dda4d66bb63a7ce58177e83a42541bac (patch) | |
| tree | 10af0c83a912a99ee69dc45e069c89ebeef9ecc3 | |
| parent | 83000ae6d7c6e3c615b16d2ea9274e1088d24178 (diff) | |
| download | emacs-5b463af8dda4d66bb63a7ce58177e83a42541bac.tar.gz emacs-5b463af8dda4d66bb63a7ce58177e83a42541bac.zip | |
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).
| -rw-r--r-- | etc/NEWS | 6 | ||||
| -rw-r--r-- | lisp/ido.el | 6 |
2 files changed, 11 insertions, 1 deletions
| @@ -793,6 +793,12 @@ digits. | |||
| 793 | ** Miscellaneous | 793 | ** Miscellaneous |
| 794 | 794 | ||
| 795 | --- | 795 | --- |
| 796 | *** Killing virtual ido buffers interactively will make them go away. | ||
| 797 | Previously, killing a virtual ido buffer with 'ido-kill-buffer' didn't | ||
| 798 | do anything. This has now been changed, and killing virtual buffers | ||
| 799 | with that command will remove the buffer from recentf. | ||
| 800 | |||
| 801 | --- | ||
| 796 | *** New variable 'ffap-file-name-with-spaces'. | 802 | *** New variable 'ffap-file-name-with-spaces'. |
| 797 | If non-nil, 'find-file-at-point' and friends will try to guess more | 803 | If non-nil, 'find-file-at-point' and friends will try to guess more |
| 798 | expansively to identify a file name with spaces. | 804 | expansively to identify a file name with spaces. |
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." | |||
| 2216 | ((and ido-enable-virtual-buffers | 2216 | ((and ido-enable-virtual-buffers |
| 2217 | ido-virtual-buffers | 2217 | ido-virtual-buffers |
| 2218 | (setq filename (assoc buf ido-virtual-buffers))) | 2218 | (setq filename (assoc buf ido-virtual-buffers))) |
| 2219 | (ido-visit-buffer (find-file-noselect (cdr filename)) method t)) | 2219 | (if (eq method 'kill) |
| 2220 | (setq recentf-list | ||
| 2221 | (delete (cdr filename) recentf-list)) | ||
| 2222 | (ido-visit-buffer (find-file-noselect (cdr filename)) method t))) | ||
| 2220 | 2223 | ||
| 2221 | ((and (eq ido-create-new-buffer 'prompt) | 2224 | ((and (eq ido-create-new-buffer 'prompt) |
| 2222 | (null require-match) | 2225 | (null require-match) |
| @@ -4073,6 +4076,7 @@ Record command in `command-history' if optional RECORD is non-nil." | |||
| 4073 | (setq buffer (buffer-name buffer))) | 4076 | (setq buffer (buffer-name buffer))) |
| 4074 | (let (win newframe) | 4077 | (let (win newframe) |
| 4075 | (cond | 4078 | (cond |
| 4079 | ;; "Killing" of virtual buffers is handled in `ido-buffer-internal'. | ||
| 4076 | ((eq method 'kill) | 4080 | ((eq method 'kill) |
| 4077 | (if record | 4081 | (if record |
| 4078 | (ido-record-command 'kill-buffer buffer)) | 4082 | (ido-record-command 'kill-buffer buffer)) |