aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu2011-04-11 11:44:54 +0800
committerLeo Liu2011-04-11 11:44:54 +0800
commit5c90fde028ff2b8338237b6c102deb346f168984 (patch)
tree3ba092e43bee355bee96cd087ec1ce9a7ec3eea8
parentf8fc0578a8b2b4a1afb3b56f9f1451bdfa855fe0 (diff)
downloademacs-5c90fde028ff2b8338237b6c102deb346f168984.tar.gz
emacs-5c90fde028ff2b8338237b6c102deb346f168984.zip
Enable ido to kill virtual buffers
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/ido.el18
2 files changed, 17 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8de276b8480..5bad8814141 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12011-04-11 Leo Liu <sdl.web@gmail.com>
2
3 * ido.el (ido-buffer-internal): Allow method 'kill for virtual
4 buffers.
5 (ido-kill-buffer-at-head): Support killing virtual buffers.
6
12011-04-10 Chong Yidong <cyd@stupidchicken.com> 72011-04-10 Chong Yidong <cyd@stupidchicken.com>
2 8
3 * minibuffer.el (completion-show-inline-help): New var. 9 * minibuffer.el (completion-show-inline-help): New var.
diff --git a/lisp/ido.el b/lisp/ido.el
index 0ce83d9b88c..9606879ce70 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -2176,9 +2176,7 @@ If cursor is not at the end of the user input, move to end of input."
2176 (ido-current-directory nil) 2176 (ido-current-directory nil)
2177 (ido-directory-nonreadable nil) 2177 (ido-directory-nonreadable nil)
2178 (ido-directory-too-big nil) 2178 (ido-directory-too-big nil)
2179 (ido-use-virtual-buffers (if (eq method 'kill) 2179 (ido-use-virtual-buffers ido-use-virtual-buffers)
2180 nil ;; Don't consider virtual buffers for killing
2181 ido-use-virtual-buffers))
2182 (require-match (confirm-nonexistent-file-or-buffer)) 2180 (require-match (confirm-nonexistent-file-or-buffer))
2183 (buf (ido-read-internal 'buffer (or prompt "Buffer: ") 'ido-buffer-history default 2181 (buf (ido-read-internal 'buffer (or prompt "Buffer: ") 'ido-buffer-history default
2184 require-match initial)) 2182 require-match initial))
@@ -3917,10 +3915,10 @@ If cursor is not at the end of the user input, delete to end of input."
3917 (let ((enable-recursive-minibuffers t) 3915 (let ((enable-recursive-minibuffers t)
3918 (buf (ido-name (car ido-matches))) 3916 (buf (ido-name (car ido-matches)))
3919 (nextbuf (cadr ido-matches))) 3917 (nextbuf (cadr ido-matches)))
3920 (when (get-buffer buf) 3918 (cond
3919 ((get-buffer buf)
3921 ;; If next match names a buffer use the buffer object; buffer 3920 ;; If next match names a buffer use the buffer object; buffer
3922 ;; name may be changed by packages such as uniquify; mindful 3921 ;; name may be changed by packages such as uniquify.
3923 ;; of virtual buffers.
3924 (when (and nextbuf (get-buffer nextbuf)) 3922 (when (and nextbuf (get-buffer nextbuf))
3925 (setq nextbuf (get-buffer nextbuf))) 3923 (setq nextbuf (get-buffer nextbuf)))
3926 (if (null (kill-buffer buf)) 3924 (if (null (kill-buffer buf))
@@ -3934,7 +3932,13 @@ If cursor is not at the end of the user input, delete to end of input."
3934 (setq ido-default-item nextbuf 3932 (setq ido-default-item nextbuf
3935 ido-text-init ido-text 3933 ido-text-init ido-text
3936 ido-exit 'refresh) 3934 ido-exit 'refresh)
3937 (exit-minibuffer)))))) 3935 (exit-minibuffer)))
3936 ;; Handle virtual buffers
3937 ((assoc buf ido-virtual-buffers)
3938 (setq recentf-list
3939 (delete (cdr (assoc buf ido-virtual-buffers)) recentf-list))
3940 (setq ido-cur-list (delete buf ido-cur-list))
3941 (setq ido-rescan t))))))
3938 3942
3939;;; DELETE CURRENT FILE 3943;;; DELETE CURRENT FILE
3940(defun ido-delete-file-at-head () 3944(defun ido-delete-file-at-head ()