unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#38294: [PATCH] Handle killing of virtual buffers in Ido
@ 2019-11-20  8:56 Dario Gjorgjevski
  2020-01-20 18:40 ` Stefan Kangas
  0 siblings, 1 reply; 19+ messages in thread
From: Dario Gjorgjevski @ 2019-11-20  8:56 UTC (permalink / raw)
  To: 38294

[-- Attachment #1: Type: text/plain, Size: 263 bytes --]

Currently, ‘ido-kill-buffer’ does essentially nothing to virtual
buffers.  (They are visited and then immediately killed.)  The attached
patch changes that so that they are instead removed from ‘recentf-list’,
akin to ‘ido-kill-buffer-at-head’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Handle killing of virtual buffers in Ido --]
[-- Type: text/x-diff, Size: 1374 bytes --]

From 4295cac14ea280d43c0aa493520543aa403a4c2e Mon Sep 17 00:00:00 2001
From: Dario Gjorgjevski <dario.gjorgjevski+git@gmail.com>
Date: Wed, 20 Nov 2019 09:34:58 +0100
Subject: [PATCH] Handle killing of virtual buffers in Ido
To: bug-gnu-emacs@gnu.org

* lisp/ido.el (ido-buffer-internal): Handle killing of virtual buffers
as a special case.
(ido-visit-buffer): Document the special case.
---
 lisp/ido.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/ido.el b/lisp/ido.el
index 79f259b819..bf3f57883d 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -2286,7 +2286,10 @@ ido-buffer-internal
        ((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)
@@ -4128,6 +4131,8 @@ ido-visit-buffer
       (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))
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2020-08-15 14:03 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-20  8:56 bug#38294: [PATCH] Handle killing of virtual buffers in Ido Dario Gjorgjevski
2020-01-20 18:40 ` Stefan Kangas
2020-01-22  8:21   ` Dario Gjorgjevski
2020-01-22  9:00     ` Stefan Kangas
2020-08-09 13:20       ` Lars Ingebrigtsen
2020-08-12 22:01         ` Stefan Kangas
2020-08-13  8:16           ` Lars Ingebrigtsen
2020-08-13  8:37             ` Stefan Kangas
2020-08-13  8:39               ` Lars Ingebrigtsen
2020-08-13  9:50           ` Dario Gjorgjevski
2020-08-13 11:04             ` Stefan Kangas
2020-08-14  9:23               ` Dario Gjorgjevski
2020-08-14 11:00                 ` Lars Ingebrigtsen
2020-08-14 16:14                   ` Stefan Kangas
2020-08-14 21:58                     ` Dario Gjorgjevski
2020-08-14 22:56                       ` Stefan Kangas
2020-08-15  8:03                         ` Dario Gjorgjevski
2020-08-15 10:29                           ` Lars Ingebrigtsen
2020-08-15 14:03                             ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).