Commit 5c90fde0 authored by Leo Liu's avatar Leo Liu
Browse files

Enable ido to kill virtual buffers

parent f8fc0578
2011-04-11 Leo Liu <sdl.web@gmail.com>
* ido.el (ido-buffer-internal): Allow method 'kill for virtual
buffers.
(ido-kill-buffer-at-head): Support killing virtual buffers.
2011-04-10 Chong Yidong <cyd@stupidchicken.com> 2011-04-10 Chong Yidong <cyd@stupidchicken.com>
* minibuffer.el (completion-show-inline-help): New var. * minibuffer.el (completion-show-inline-help): New var.
......
...@@ -2176,9 +2176,7 @@ If cursor is not at the end of the user input, move to end of input." ...@@ -2176,9 +2176,7 @@ If cursor is not at the end of the user input, move to end of input."
(ido-current-directory nil) (ido-current-directory nil)
(ido-directory-nonreadable nil) (ido-directory-nonreadable nil)
(ido-directory-too-big nil) (ido-directory-too-big nil)
(ido-use-virtual-buffers (if (eq method 'kill) (ido-use-virtual-buffers ido-use-virtual-buffers)
nil ;; Don't consider virtual buffers for killing
ido-use-virtual-buffers))
(require-match (confirm-nonexistent-file-or-buffer)) (require-match (confirm-nonexistent-file-or-buffer))
(buf (ido-read-internal 'buffer (or prompt "Buffer: ") 'ido-buffer-history default (buf (ido-read-internal 'buffer (or prompt "Buffer: ") 'ido-buffer-history default
require-match initial)) require-match initial))
...@@ -3917,10 +3915,10 @@ If cursor is not at the end of the user input, delete to end of input." ...@@ -3917,10 +3915,10 @@ If cursor is not at the end of the user input, delete to end of input."
(let ((enable-recursive-minibuffers t) (let ((enable-recursive-minibuffers t)
(buf (ido-name (car ido-matches))) (buf (ido-name (car ido-matches)))
(nextbuf (cadr 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 ;; If next match names a buffer use the buffer object; buffer
;; name may be changed by packages such as uniquify; mindful ;; name may be changed by packages such as uniquify.
;; of virtual buffers.
(when (and nextbuf (get-buffer nextbuf)) (when (and nextbuf (get-buffer nextbuf))
(setq nextbuf (get-buffer nextbuf))) (setq nextbuf (get-buffer nextbuf)))
(if (null (kill-buffer buf)) (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,7 +3932,13 @@ If cursor is not at the end of the user input, delete to end of input."
(setq ido-default-item nextbuf (setq ido-default-item nextbuf
ido-text-init ido-text ido-text-init ido-text
ido-exit 'refresh) 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 ;;; DELETE CURRENT FILE
(defun ido-delete-file-at-head () (defun ido-delete-file-at-head ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment