mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-25 07:28:20 +00:00
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.
This commit is contained in:
parent
b6c73ee227
commit
c5cbeb128e
@ -1,3 +1,11 @@
|
||||
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.
|
||||
|
12
lisp/ido.el
12
lisp/ido.el
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user