From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.devel Subject: Re: Concerning the new `ido-use-virtual-buffers' feature Date: Thu, 27 May 2010 10:56:53 +0100 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1274954240 10896 80.91.229.12 (27 May 2010 09:57:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 27 May 2010 09:57:20 +0000 (UTC) Cc: emacs-devel@gnu.org To: Tassilo Horn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 27 11:57:13 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OHZpv-0003Ly-D8 for ged-emacs-devel@m.gmane.org; Thu, 27 May 2010 11:57:11 +0200 Original-Received: from localhost ([127.0.0.1]:58410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHZps-0001W8-OH for ged-emacs-devel@m.gmane.org; Thu, 27 May 2010 05:57:08 -0400 Original-Received: from [140.186.70.92] (port=51300 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHZpi-0001TW-VB for emacs-devel@gnu.org; Thu, 27 May 2010 05:57:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OHZph-0006UV-A2 for emacs-devel@gnu.org; Thu, 27 May 2010 05:56:58 -0400 Original-Received: from ppsw-32.csi.cam.ac.uk ([131.111.8.132]:57629) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OHZph-0006UA-5n for emacs-devel@gnu.org; Thu, 27 May 2010 05:56:57 -0400 X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Original-Received: from cpc1-cmbg13-0-0-cust596.cmbg.cable.ntl.com ([86.9.122.85]:52391 helo=Victoria.local) by ppsw-32.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.158]:587) with esmtpsa (PLAIN:sl392) (TLSv1:DHE-RSA-AES128-SHA:128) id 1OHZpe-0007FI-Bb (Exim 4.70) (return-path ); Thu, 27 May 2010 10:56:54 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (Mac OS X 10.6.3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:125300 Archived-At: 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