all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#6943: 23.2; [PATCH] * lisp/ido.el (ido-kill-buffer-at-head): support killing virtual buffers.
@ 2010-08-30  3:22 Leo
  2010-08-30 10:48 ` Leo
  0 siblings, 1 reply; 4+ messages in thread
From: Leo @ 2010-08-30  3:22 UTC (permalink / raw
  To: 6943; +Cc: Juanma Barranquero

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

The attached patch makes C-k in ido kills virtual buffers too.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: ido C-k patch --]
[-- Type: text/x-diff, Size: 2369 bytes --]

From fb3cb0a3c3c6ab82a3ec7c8061478b59366ae77a Mon Sep 17 00:00:00 2001
From: Leo sdl.web@gmail.com
Date: Mon, 30 Aug 2010 04:17:03 +0100
Subject: [PATCH] * lisp/ido.el (ido-kill-buffer-at-head): support killing virtual buffers.

---
 lisp/ido.el |   43 +++++++++++++++++++++++++------------------
 1 files changed, 25 insertions(+), 18 deletions(-)

diff --git a/lisp/ido.el b/lisp/ido.el
index 858ee3e..944499e 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -3920,24 +3920,31 @@ 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)
-	;; If next match names a buffer use the buffer object; buffer
-	;; name may be changed by packages such as uniquify; mindful
-	;; of virtual buffers.
-	(when (and nextbuf (get-buffer nextbuf))
-	  (setq nextbuf (get-buffer nextbuf)))
-	(if (null (kill-buffer buf))
-	    ;; Buffer couldn't be killed.
-	    (setq ido-rescan t)
-	  ;; Else `kill-buffer' succeeds so re-make the buffer list
-	  ;; taking into account packages like uniquify may rename
-	  ;; buffers.
-	  (if (bufferp nextbuf)
-	      (setq nextbuf (buffer-name nextbuf)))
-	  (setq ido-default-item nextbuf
-		ido-text-init ido-text
-		ido-exit 'refresh)
-	  (exit-minibuffer))))))
+      (if (get-buffer buf)
+	  (progn
+	    ;; If next match names a buffer use the buffer object; buffer
+	    ;; name may be changed by packages such as uniquify; mindful
+	    ;; of virtual buffers.
+	    (when (and nextbuf (get-buffer nextbuf))
+	      (setq nextbuf (get-buffer nextbuf)))
+	    (if (null (kill-buffer buf))
+		;; Buffer couldn't be killed.
+		(setq ido-rescan t)
+	      ;; Else `kill-buffer' succeeds so re-make the buffer list
+	      ;; taking into account packages like uniquify may rename
+	      ;; buffers.
+	      (if (bufferp nextbuf)
+		  (setq nextbuf (buffer-name nextbuf)))
+	      (setq ido-default-item nextbuf
+		    ido-text-init ido-text
+		    ido-exit 'refresh)
+	      (exit-minibuffer)))
+	;; Handle virtual buffers
+	(when recentf-list
+	  (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


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

* bug#6943: 23.2; [PATCH] * lisp/ido.el (ido-kill-buffer-at-head): support killing virtual buffers.
  2010-08-30  3:22 bug#6943: 23.2; [PATCH] * lisp/ido.el (ido-kill-buffer-at-head): support killing virtual buffers Leo
@ 2010-08-30 10:48 ` Leo
  2011-04-10 20:46   ` Chong Yidong
  0 siblings, 1 reply; 4+ messages in thread
From: Leo @ 2010-08-30 10:48 UTC (permalink / raw
  To: 6943; +Cc: Juanma Barranquero

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


Please use this patch instead.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: ido C-k virtual buffers --]
[-- Type: text/x-diff, Size: 2227 bytes --]

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


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

* bug#6943: 23.2; [PATCH] * lisp/ido.el (ido-kill-buffer-at-head): support killing virtual buffers.
  2010-08-30 10:48 ` Leo
@ 2011-04-10 20:46   ` Chong Yidong
  2011-04-11  3:54     ` Leo
  0 siblings, 1 reply; 4+ messages in thread
From: Chong Yidong @ 2011-04-10 20:46 UTC (permalink / raw
  To: Leo; +Cc: 6943

Leo <sdl.web@gmail.com> writes:

> Please use this patch instead.

Looks OK to me.  I don't use ido, so I can't do much useful testing, but
since no one else has commented on this, please go ahead and install.

> * lisp/ido.el (ido-kill-buffer-at-head): support killing virtual buffers.
>   (ido-buffer-internal): allow method 'kill for virtual buffers.

Please capitalize ChangeLog entries.  Thanks.





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

* bug#6943: 23.2; [PATCH] * lisp/ido.el (ido-kill-buffer-at-head): support killing virtual buffers.
  2011-04-10 20:46   ` Chong Yidong
@ 2011-04-11  3:54     ` Leo
  0 siblings, 0 replies; 4+ messages in thread
From: Leo @ 2011-04-11  3:54 UTC (permalink / raw
  To: 6943-done

Version: 24.1





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

end of thread, other threads:[~2011-04-11  3:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-30  3:22 bug#6943: 23.2; [PATCH] * lisp/ido.el (ido-kill-buffer-at-head): support killing virtual buffers Leo
2010-08-30 10:48 ` Leo
2011-04-10 20:46   ` Chong Yidong
2011-04-11  3:54     ` Leo

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.