unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dario Gjorgjevski <dario.gjorgjevski@gmail.com>
To: 38294@debbugs.gnu.org
Subject: bug#38294: [PATCH] Handle killing of virtual buffers in Ido
Date: Wed, 20 Nov 2019 09:56:43 +0100	[thread overview]
Message-ID: <fv2zoj36ejncxg.fsf@gmail.com> (raw)

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


             reply	other threads:[~2019-11-20  8:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-20  8:56 Dario Gjorgjevski [this message]
2020-01-20 18:40 ` bug#38294: [PATCH] Handle killing of virtual buffers in Ido 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fv2zoj36ejncxg.fsf@gmail.com \
    --to=dario.gjorgjevski@gmail.com \
    --cc=38294@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).