From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.bugs Subject: bug#2042: Ido-mode : filtering does not keep ordering Date: Sun, 16 Sep 2012 23:03:15 +0800 Message-ID: References: <6fa54e4e0901250554q1519cba5t83df1577e2cbc132@mail.gmail.com> <8739fch6in.fsf@stupidchicken.com> <87obx0ti9i.fsf@gnu.org> <87392ixqn1.fsf@golux.woodcraft.me.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1347807847 17637 80.91.229.3 (16 Sep 2012 15:04:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 16 Sep 2012 15:04:07 +0000 (UTC) To: 2042@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 16 17:04:09 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TDGO8-0007Bl-QV for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Sep 2012 17:04:01 +0200 Original-Received: from localhost ([::1]:45820 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDGO4-0006rn-SI for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Sep 2012 11:03:56 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDGO2-0006rg-FK for bug-gnu-emacs@gnu.org; Sun, 16 Sep 2012 11:03:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TDGO1-0003SC-Bk for bug-gnu-emacs@gnu.org; Sun, 16 Sep 2012 11:03:54 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56001) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDGO1-0003S8-7y for bug-gnu-emacs@gnu.org; Sun, 16 Sep 2012 11:03:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TDGP8-0007OY-2y for bug-gnu-emacs@gnu.org; Sun, 16 Sep 2012 11:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Leo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Sep 2012 15:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 2042 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 2042-submit@debbugs.gnu.org id=B2042.134780787828395 (code B ref 2042); Sun, 16 Sep 2012 15:05:02 +0000 Original-Received: (at 2042) by debbugs.gnu.org; 16 Sep 2012 15:04:38 +0000 Original-Received: from localhost ([127.0.0.1]:37314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDGOk-0007Nw-FX for submit@debbugs.gnu.org; Sun, 16 Sep 2012 11:04:38 -0400 Original-Received: from mail-pb0-f44.google.com ([209.85.160.44]:34215) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TDGOh-0007No-PG for 2042@debbugs.gnu.org; Sun, 16 Sep 2012 11:04:37 -0400 Original-Received: by pbbrr4 with SMTP id rr4so8094505pbb.3 for <2042@debbugs.gnu.org>; Sun, 16 Sep 2012 08:03:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:references:face:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=oQnEIT4nVsW5U2KgyoI9eVwXLyEwsN6/PO7J8f/mquE=; b=Y1ZiE/Hw05Yse7pYxufEtYnxdcWf6bzqEAJakZ9HWpCYQMzYXCXxXpa4jL/W/1GEhD db+dIysVf/5JSZO2vYHSKlWp/BtFQWzU7XXjAtufkInUnDZf+PuZ1/Ce8px085bJBLgI jeVyZb+ULR9ci2K/OZE41rTF1keuqVkFmOKvqj793vqgaTPdiSSgL6iHXFhTEWVUOIV1 VfMt9NRINPrbepuD+WTLqc9HPPN6u0i5jMfgyIVVF2CpyuIRndESbb2abmLoaG50GepN /zV9tYmVuC1QJrcnC1Se43gF/aepcRVVJmnWre6sqbqm7gtTTiNUUlCut8wEsJRslrfK cvzA== Original-Received: by 10.68.218.101 with SMTP id pf5mr16575154pbc.60.1347807805951; Sun, 16 Sep 2012 08:03:25 -0700 (PDT) Original-Received: from localhost ([182.48.111.218]) by mx.google.com with ESMTPS id ou6sm5178049pbc.9.2012.09.16.08.03.22 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 16 Sep 2012 08:03:25 -0700 (PDT) Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAMFBMVEUaFRZLMy1dTENxVzKQ WiCrXQ97cmO/dSqSh3akjGTApXy5sJ7Sxo/Sz8Xo6eP9//xJbkruAAAAAWJLR0QAiAUdSAAAAAlw SFlzAAACxQAAAsUBidZ/7wAAAAd0SU1FB9cBBwMJOwHXewoAAAIBSURBVCjPVdNBiNNAFADQ6J4F x3hThHZBBC+WCFI8SS0iezRDcMHLHkLAg6gJH/fgYQ9xYlj2sLK4KHgqCgXFhda2Idmr4kkQPZQ0 nkQMbTypbMmMM2m7ZgYSmMef/5OZPwo7HFnx3uKPcmj0Dht1LWZJ+Hvr7dIFZXRUwl9VRTuuKDJ+ U44gjscknK4hhJaCkYRsWjmBtLqXlJAG2wipNe18OZJu1BBq1E8xafl4s6Jq2mUZGftU1y7CCxnp FVUDWJXx4C66BKBnErbuoaYNtoRTu6EZBsCbMn7W+5qOAR6WvxNOby9jHWC9hAf3n304CdiAByXs 3Nh9roLDkyb/sWV712vYwaLSAn8CPMHIAAzOPDKP2COAFm4Y4ODVWc6xG7KXsN7UeUJjjimx2uwd gCgNhr0i8C/xyCD5CiCKAMY3Bf5oDzx//w/fimscdcAZU2jv9sedx6+nYPPFIoWI/GK6QZ+EFGOR ErAjCnV3vPZ7XqlTIMbOLY7fLcvvmT7rXNWaGDexIY44N12TG2PDp7vqyl57dnCeuWwyNpnEURxk fTbDYeBnKRn4oejPYI4sH6WviBumEZ/GxX4X/x6EcURFZ7E071bjQGAxpcOAEOJuTiroDEea5Szv rVWLYfl7ZiQwSUToxrkux7OLixAWGz22+HIyWTRYcVfomOwvzusfjtVIGgLHf3MAAAAASUVORK5C YII= In-Reply-To: (Leo's message of "Sun, 16 Sep 2012 22:55:30 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (OS X 10.8.1) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:64426 Archived-At: Use this patch instead: diff --git a/lisp/ido.el b/lisp/ido.el index fe94c7f2..512ac9d4 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -493,6 +493,17 @@ (defcustom ido-enable-dot-prefix nil :type 'boolean :group 'ido) +;; See http://debbugs.gnu.org/2042 for more info. +(defcustom ido-buffer-disable-smart-matches t + "Non-nil means not to re-order matches for buffer switching. +By default, ido aranges matches in the following order: + + full-matches > suffix matches > prefix matches > remaining matches + +which can get in the way for buffer switching." + :type 'boolean + :group 'ido) + (defcustom ido-confirm-unique-completion nil "Non-nil means that even a unique completion must be confirmed. This means that \\[ido-complete] must always be followed by \\[ido-exit-minibuffer] @@ -3688,10 +3699,17 @@ (defun ido-set-matches-1 (items &optional do-full) (rex0 (if ido-enable-regexp text (regexp-quote text))) (rexq (concat rex0 (if slash ".*/" ""))) (re (if ido-enable-prefix (concat "\\`" rexq) rexq)) - (full-re (and do-full (not ido-enable-regexp) (not (string-match "\$\\'" rex0)) + (full-re (and do-full + (and (eq ido-cur-item 'buffer) + (not ido-buffer-disable-smart-matches)) + (not ido-enable-regexp) + (not (string-match "\$\\'" rex0)) (concat "\\`" rex0 (if slash "/" "") "\\'"))) (suffix-re (and do-full slash - (not ido-enable-regexp) (not (string-match "\$\\'" rex0)) + (and (eq ido-cur-item 'buffer) + (not ido-buffer-disable-smart-matches)) + (not ido-enable-regexp) + (not (string-match "\$\\'" rex0)) (concat rex0 "/\\'"))) (prefix-re (and full-re (not ido-enable-prefix) (concat "\\`" rexq)))