[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#2042: Ido-mode : filtering does not keep ordering
From: |
Leo |
Subject: |
bug#2042: Ido-mode : filtering does not keep ordering |
Date: |
Sun, 16 Sep 2012 22:55:30 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2 (OS X 10.8.1) |
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)))