Commit c5cbeb12 authored by Leo Liu's avatar Leo Liu Committed by John Wiegley
Browse files

Added C-o keybinding to toggle use of virtual buffers

* ido.el (ido-init-completion-maps): For ido-switch-buffer, C-o
toggles the use of virtual buffers.
(ido-buffer-internal): Guard `ido-use-virtual-buffers' global
value.  
(ido-toggle-virtual-buffers): New function.
parent b6c73ee2
2010-04-21 John Wiegley <jwiegley@gmail.com>
* ido.el (ido-init-completion-maps): For ido-switch-buffer, C-o
toggles the use of virtual buffers.
(ido-buffer-internal): Guard `ido-use-virtual-buffers' global
value.
(ido-toggle-virtual-buffers): New function.
2010-04-21 Juanma Barranquero <lekktu@gmail.com>
Use `define-derived-mode'; fix window selection; doc fixes.
......
......@@ -1633,6 +1633,7 @@ This function also adds a hook to the minibuffer."
(define-key map "\C-x\C-f" 'ido-enter-find-file)
(define-key map "\C-x\C-b" 'ido-fallback-command)
(define-key map "\C-k" 'ido-kill-buffer-at-head)
(define-key map "\C-o" 'ido-toggle-virtual-buffers)
(set-keymap-parent map ido-common-completion-map)
(setq ido-buffer-completion-map map)))
......@@ -2182,6 +2183,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 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))
......@@ -2705,6 +2707,16 @@ C-x C-f ... C-d enter `dired' on current directory."
(setq ido-exit 'keep)
(exit-minibuffer))))
(defun ido-toggle-virtual-buffers ()
"Toggle the use of virtual buffers.
See `ido-use-virtual-buffers' for explanation of virtual buffer."
(interactive)
(when (and ido-mode (eq ido-cur-item 'buffer))
(setq ido-use-virtual-buffers (not ido-use-virtual-buffers))
(setq ido-text-init ido-text)
(setq ido-exit 'refresh)
(exit-minibuffer)))
(defun ido-reread-directory ()
"Read current directory again.
May be useful if cached version is no longer valid, but directory
......
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