[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Concerning the new `ido-use-virtual-buffers' feature
From: |
Leo |
Subject: |
Re: Concerning the new `ido-use-virtual-buffers' feature |
Date: |
Thu, 27 May 2010 10:56:53 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (Mac OS X 10.6.3) |
Hello Tassilo,
> Ok, I see. By the way, why is there another variable for that instead
> of different values to `ido-use-virtual-buffers' (nil, any non-nil and
> 'automatically)? At least from a user perspective, I'd find that more
> logical, especially when using `customize'.
My fault.
I think I did consider this but I don't remember why I didn't go down
that route. It could be I didn't like the slightly more complex way of
toggling virtual buffers. I am a bit short of time at the moment but I
have put this in my TODO and will look at it again.
Meanwhile feel free to change the patch.
Turn on virtual buffers automatically when no matches
Modified lisp/ido.el
diff --git a/lisp/ido.el b/lisp/ido.el
index b200397..880592d 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -799,6 +799,14 @@ enabled if this variable is configured to a non-nil value."
:type 'integer
:group 'ido)
+(defcustom ido-use-virtual-buffers-automatically nil
+ "Use virtual buffers automatically.
+If non-nil, virtual buffers are automatically enabled when user
+input does not match any existing buffers."
+ :version "24.1"
+ :type 'boolean
+ :group 'ido)
+
(defcustom ido-use-faces t
"Non-nil means use ido faces to highlighting first match, only match and
subdirs in the alternatives."
@@ -4491,6 +4499,15 @@ For details of keybindings, see `ido-find-file'."
(setq ido-exit 'refresh)
(exit-minibuffer)))
+ (when (and ido-use-virtual-buffers-automatically
+ (eq ido-cur-item 'buffer)
+ (not ido-matches)
+ (not ido-use-virtual-buffers))
+ (setq ido-text-init ido-text)
+ (setq ido-use-virtual-buffers t)
+ (setq ido-exit 'refresh)
+ (exit-minibuffer))
+
(when (and
ido-rescan
(not ido-matches)
Cheers.
Leo
- Re: Concerning the new `ido-use-virtual-buffers' feature,
Leo <=
- Re: Concerning the new `ido-use-virtual-buffers' feature, Tassilo Horn, 2010/05/27
- Re: Concerning the new `ido-use-virtual-buffers' feature, Leo, 2010/05/27
- Re: Concerning the new `ido-use-virtual-buffers' feature, Tassilo Horn, 2010/05/27
- Re: Concerning the new `ido-use-virtual-buffers' feature, Leo, 2010/05/27
- Re: Concerning the new `ido-use-virtual-buffers' feature, Leo, 2010/05/27
- Re: Concerning the new `ido-use-virtual-buffers' feature, Tassilo Horn, 2010/05/28
- Re: Concerning the new `ido-use-virtual-buffers' feature, Leo, 2010/05/28
- Re: Concerning the new `ido-use-virtual-buffers' feature, Leo, 2010/05/28
- Re: Concerning the new `ido-use-virtual-buffers' feature, Juanma Barranquero, 2010/05/28
- Re: Concerning the new `ido-use-virtual-buffers' feature, Leo, 2010/05/28