GNU bug report logs - #6943
23.2; [PATCH] * lisp/ido.el (ido-kill-buffer-at-head): support killing virtual buffers.

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Mon, 30 Aug 2010 03:22:02 UTC

Severity: wishlist

Tags: patch

Found in version 23.2

Fixed in version 24.1

Done: Leo <sdl.web <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 6943 <at> debbugs.gnu.org (full text, mbox):

From: Leo <sdl.web <at> gmail.com>
To: 6943 <at> debbugs.gnu.org
Cc: Juanma Barranquero <lekktu <at> gmail.com>
Subject: Re: bug#6943: 23.2;
	[PATCH] * lisp/ido.el (ido-kill-buffer-at-head): support killing
	virtual buffers.
Date: Mon, 30 Aug 2010 11:48:17 +0100
[Message part 1 (text/plain, inline)]
Please use this patch instead.

[Message part 2 (text/x-diff, inline)]
From b7c131717aa761de1ad91eedf03b4d53d2e4bb27 Mon Sep 17 00:00:00 2001
Date: Mon, 30 Aug 2010 11:43:27 +0100
Subject: [PATCH] Support killing virtual buffers in ido

* lisp/ido.el (ido-kill-buffer-at-head): support killing virtual buffers.
  (ido-buffer-internal): allow method 'kill for virtual buffers.
---
 lisp/ido.el |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/lisp/ido.el b/lisp/ido.el
index 858ee3e..f1bd7e6 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -2181,9 +2181,7 @@ If cursor is not at the end of the user input, move to end of input."
 	   (ido-current-directory nil)
 	   (ido-directory-nonreadable nil)
 	   (ido-directory-too-big nil)
-	   (ido-use-virtual-buffers (if (eq method 'kill)
-					nil    ;; Don't consider virtual buffers for killing
-				      ido-use-virtual-buffers))
+	   (ido-use-virtual-buffers ido-use-virtual-buffers)
 	   (require-match (confirm-nonexistent-file-or-buffer))
 	   (buf (ido-read-internal 'buffer (or prompt "Buffer: ") 'ido-buffer-history default
 				   require-match initial))
@@ -3920,10 +3918,10 @@ If cursor is not at the end of the user input, delete to end of input."
     (let ((enable-recursive-minibuffers t)
 	  (buf (ido-name (car ido-matches)))
 	  (nextbuf (cadr ido-matches)))
-      (when (get-buffer buf)
+      (cond
+       ((get-buffer buf)
 	;; If next match names a buffer use the buffer object; buffer
-	;; name may be changed by packages such as uniquify; mindful
-	;; of virtual buffers.
+	;; name may be changed by packages such as uniquify.
 	(when (and nextbuf (get-buffer nextbuf))
 	  (setq nextbuf (get-buffer nextbuf)))
 	(if (null (kill-buffer buf))
@@ -3937,7 +3935,13 @@ If cursor is not at the end of the user input, delete to end of input."
 	  (setq ido-default-item nextbuf
 		ido-text-init ido-text
 		ido-exit 'refresh)
-	  (exit-minibuffer))))))
+	  (exit-minibuffer)))
+       ;; Handle virtual buffers
+       ((assoc buf ido-virtual-buffers)
+	(setq recentf-list
+	      (delete (cdr (assoc buf ido-virtual-buffers)) recentf-list))
+	(setq ido-cur-list (delete buf ido-cur-list))
+	(setq ido-rescan t))))))
 
 ;;; DELETE CURRENT FILE
 (defun ido-delete-file-at-head ()
-- 
1.7.1


This bug report was last modified 14 years and 123 days ago.

Previous Next


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