GNU bug report logs - #38294
[PATCH] Handle killing of virtual buffers in Ido

Previous Next

Package: emacs;

Reported by: Dario Gjorgjevski <dario.gjorgjevski <at> gmail.com>

Date: Wed, 20 Nov 2019 08:58:02 UTC

Severity: wishlist

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dario Gjorgjevski <dario.gjorgjevski <at> gmail.com>
To: 38294 <at> debbugs.gnu.org
Subject: bug#38294: [PATCH] Handle killing of virtual buffers in Ido
Date: Wed, 20 Nov 2019 09:56:43 +0100
[Message part 1 (text/plain, inline)]
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’.

[0001-Handle-killing-of-virtual-buffers-in-Ido.patch (text/x-diff, inline)]
From 4295cac14ea280d43c0aa493520543aa403a4c2e Mon Sep 17 00:00:00 2001
From: Dario Gjorgjevski <dario.gjorgjevski+git <at> gmail.com>
Date: Wed, 20 Nov 2019 09:34:58 +0100
Subject: [PATCH] Handle killing of virtual buffers in Ido
To: bug-gnu-emacs <at> 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


This bug report was last modified 4 years and 331 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.