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: Fri, 28 May 2010 02:45:52 +0100 Message-ID: References: <201005271257.02056.tassilo@member.fsf.org> <201005272105.45102.tassilo@member.fsf.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1275011164 31912 80.91.229.12 (28 May 2010 01:46:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 28 May 2010 01:46:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: Tassilo Horn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 28 03:46:03 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 1OHoeA-0006GN-VO for ged-emacs-devel@m.gmane.org; Fri, 28 May 2010 03:46:03 +0200 Original-Received: from localhost ([127.0.0.1]:52378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHoeA-0002jW-Bm for ged-emacs-devel@m.gmane.org; Thu, 27 May 2010 21:46:02 -0400 Original-Received: from [140.186.70.92] (port=35653 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHoe2-0002i5-JG for emacs-devel@gnu.org; Thu, 27 May 2010 21:45:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OHoe1-000052-Fc for emacs-devel@gnu.org; Thu, 27 May 2010 21:45:54 -0400 Original-Received: from mail-ww0-f41.google.com ([74.125.82.41]:34452) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OHoe1-00004w-8N for emacs-devel@gnu.org; Thu, 27 May 2010 21:45:53 -0400 Original-Received: by wwi17 with SMTP id 17so271828wwi.0 for ; Thu, 27 May 2010 18:45:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=sJup4dxgy85dOERYRwkp1ff2FyfTi+5Q03Y35nNT67o=; b=jBHSz3W6x5X10uGXhGjj3PD2zUyzdylHsKQN0uUHWtkDgIwfkXGa2K97nloA2LVlPV e27cW64inxwrp852yX8zjUWlYwkMq0leK/s56kFpE8X/il/yUXNJofgcIiTu5XtZF2Lw zUajpTZRmHSqW5MFDy2jedLHpc9tSVC3E+l+o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=KMBOo5O7OssH38hqpQSOl7S/Ot8/aQc4idS6SUjhu7xhijzN7H/+qzT5S2akFSv9yH cKxOfys4aX4BvW+2ZFYYFc02ECPGo3E4FSEvm0mbntyIj2lTHyICy1kVIhF48HbrlmOG tF89HkNM2Ze7OwfoJCkwMSGW0aEPoRby5pUPk= Original-Received: by 10.216.154.74 with SMTP id g52mr1153719wek.106.1275011152159; Thu, 27 May 2010 18:45:52 -0700 (PDT) Original-Received: by 10.216.188.139 with HTTP; Thu, 27 May 2010 18:45:52 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:125319 Archived-At: On 28 May 2010 02:21, Leo wrote: >>> I think it is in the added code in ido-exhibit which is run in >>> post-command-hook if I remember correctly. >>> >>> When your input doesn't match any (including virtual ones), the code >>> in ido-exhibit tells ido (the big LOOP in ido-read-internal) to >>> rebuild the buffer list and there isn't any match so it rebuild again >>> and again. Go into a infinite loop. >>> >>> You could try creating a new let-bound variable to detect such a >>> situation and avoid the infinite loop. >> >> Thanks for that. =A0Here's a new patch which uses a new dynamic variable= . >> It seems to work as far as I can tell, but it would be great if you >> could give it a test drive. >> >> One other wishlist item would be to remove virtual buffers from the >> completion list as soon as the input string matches a normal buffer >> again, because the user deleted some chars from the input... >> >> Bye, >> Tassilo > > I slightly modified the patch and implemented the wishlist item. > > For buffers, if a let-bound variable can be added in > ido-buffers-internal I usually avoid adding it in ido-read-internal. > > To remove virtual buffers as soon as input matches existing ones, the > idea is to build a list of existing buffers (ignored buffers are not > included) and then match the input against it in ido-exhibit. My > testing is very brief though it seems working fine. Could you test it > more thoroughly? Also remember to try the toggle virtual buffers key > C-o too. Thanks. > > Leo > The can be changed @@ -3427,7 +3431,9 @@ for first matching file." (if default (setq ido-temp-list (cons default (delete default ido-temp-list)))) - (if ido-use-virtual-buffers + (if (or (eq ido-use-virtual-buffers 'always) + (and (boundp ido-virtual-buffers-enabled) + ido-virtual-buffers-enabled)) (ido-add-virtual-buffers-to-list)) (run-hooks 'ido-make-buffer-list-hook) ido-temp-list)) to: @@ -2736,7 +2739,8 @@ C-x C-f ... C-d enter `dired' on current directory." 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-virtual-buffers-enabled + (not ido-virtual-buffers-enabled)) (setq ido-text-init ido-text) (setq ido-exit 'refresh) (exit-minibuffer))) Leo