unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Concerning the new `ido-use-virtual-buffers' feature
@ 2010-05-26 10:14 Tassilo Horn
  2010-05-26 20:59 ` John Wiegley
  0 siblings, 1 reply; 29+ messages in thread
From: Tassilo Horn @ 2010-05-26 10:14 UTC (permalink / raw)
  To: emacs-devel; +Cc: John Wiegley

Hi John,

first thanks a lot for the ido virtual buffers feature.  For years I've
regularly switched between iswitchb and ido, because the former had this
virtual buffers feature while the latter had more pleasing key bindings,
also works for file completion, and some other modes use it.

So now, I do have everything I want, except that there is one little
inconvenience when comparing iswitchb and ido virtual buffers: The
former adds virtual buffers to the possible completions only if no
currently open buffer matches the input, whereas ido adds virtual
buffers to the completions directly.

IMHO, here the iswitchb behavior is a bit more convenient.  Currently, I
frequently find a virtual buffer file instead of switching to some
already open buffer.  For example, I want to switch to the buffer
"foo.tex", type `C-x b foo RET' and instead find myself in a doc-view
buffer opening "foo.pdf"...

So is the current behavior intended?  Should I write a bug report
(feature request)?

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 29+ messages in thread
* Re: Concerning the new `ido-use-virtual-buffers' feature
@ 2010-05-27  9:56 Leo
  2010-05-27 10:57 ` Tassilo Horn
       [not found] ` <201006020842.48913.tassilo@member.fsf.org>
  0 siblings, 2 replies; 29+ messages in thread
From: Leo @ 2010-05-27  9:56 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: emacs-devel

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



^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2013-07-06 12:57 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-26 10:14 Concerning the new `ido-use-virtual-buffers' feature Tassilo Horn
2010-05-26 20:59 ` John Wiegley
2010-05-27  6:54   ` Tassilo Horn
2010-05-27  6:57     ` John Wiegley
2010-05-27  8:10       ` Tassilo Horn
2010-05-27  8:26         ` John Wiegley
  -- strict thread matches above, loose matches on Subject: below --
2010-05-27  9:56 Leo
2010-05-27 10:57 ` Tassilo Horn
2010-05-27 18:01   ` Leo
2010-05-27 19:05     ` Tassilo Horn
2010-05-28  1:21       ` Leo
2010-05-28  1:45         ` Leo
2010-05-28  6:21           ` Tassilo Horn
2010-05-28  9:07             ` Leo
2010-05-28  9:26               ` Leo
2010-05-28 10:35               ` Juanma Barranquero
2010-05-28 12:15                 ` Leo
2010-05-28 12:29                   ` Tassilo Horn
2010-05-29 14:15                     ` Leo
2010-06-01 23:54                       ` Juanma Barranquero
2010-06-02  3:28                         ` Leo
2010-06-02  5:57                           ` Juanma Barranquero
2010-06-02  9:43                             ` Leo
     [not found]                         ` <AANLkTilMurdEZBA-kiWHlS9-r0VK6W5v@mail.gmail.com>
2011-10-16 10:06                           ` Antoine Levitt
2013-07-06 12:57                             ` Leo Liu
     [not found] ` <201006020842.48913.tassilo@member.fsf.org>
     [not found]   ` <AANLkTikTDRtnbzNHTzVlMvHyl0pDHuhpQLu5k8Il4vP0@mail.gmail.com>
2010-06-02  8:29     ` Tassilo Horn
2010-06-02  9:28       ` Juanma Barranquero
2010-06-02  9:55         ` Tassilo Horn
2010-06-02 10:27           ` Juanma Barranquero

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).