all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo <sdl.web@gmail.com>
To: 2042@debbugs.gnu.org
Subject: bug#2042: Ido-mode : filtering does not keep ordering
Date: Sun, 16 Sep 2012 23:03:15 +0800	[thread overview]
Message-ID: <m1zk4qqabw.fsf@gmail.com> (raw)
In-Reply-To: <m17grurp99.fsf@gmail.com> (Leo's message of "Sun, 16 Sep 2012 22:55:30 +0800")

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)))





  reply	other threads:[~2012-09-16 15:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-25 13:54 bug#2042: Ido-mode : filtering does not keep ordering Antoine Levitt
2011-09-24 16:20 ` Leo
2011-09-25  8:54   ` Antoine Levitt
2011-10-01 19:10   ` Chong Yidong
2011-10-02  0:04     ` Leo
2011-10-29  6:38       ` Chong Yidong
2011-10-29  7:06         ` Leo
2012-09-16  9:29         ` Matthew Woodcraft
2012-09-16 14:55           ` Leo
2012-09-16 15:03             ` Leo [this message]
2012-09-16 16:33               ` Chong Yidong
2012-09-16 22:28 ` Leo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1zk4qqabw.fsf@gmail.com \
    --to=sdl.web@gmail.com \
    --cc=2042@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.