all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo <sdl.web@gmail.com>
To: Matthew Woodcraft <matthew@woodcraft.me.uk>
Cc: Chong Yidong <cyd@gnu.org>,
	2042@debbugs.gnu.org, Antoine Levitt <smeuuh@gmail.com>
Subject: bug#2042: Ido-mode : filtering does not keep ordering
Date: Sun, 16 Sep 2012 22:55:30 +0800	[thread overview]
Message-ID: <m17grurp99.fsf@gmail.com> (raw)
In-Reply-To: <87392ixqn1.fsf@golux.woodcraft.me.uk> (Matthew Woodcraft's message of "Sun, 16 Sep 2012 10:29:06 +0100")

On 2012-09-16 17:29 +0800, Matthew Woodcraft wrote:
> I've been running with Leo's patch from this bug report for a couple of
> months.
>
> I also think that the changed behaviour is an improvement, and I've seen
> no problems.
>
> So could this be considered before the 24.3 freeze?

If Yidong doesn't object, I plan to commit something along these lines:

diff --git a/lisp/ido.el b/lisp/ido.el
index fe94c7f2..bb019574 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,15 @@ (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
+		       (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))
+			 (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 14:55 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 [this message]
2012-09-16 15:03             ` Leo
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=m17grurp99.fsf@gmail.com \
    --to=sdl.web@gmail.com \
    --cc=2042@debbugs.gnu.org \
    --cc=cyd@gnu.org \
    --cc=matthew@woodcraft.me.uk \
    --cc=smeuuh@gmail.com \
    /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.