diff options
| author | Leo Liu | 2012-09-17 06:23:49 +0800 |
|---|---|---|
| committer | Leo Liu | 2012-09-17 06:23:49 +0800 |
| commit | a8c14da8498eb09c3dc26d1b4edeaa00df9135d5 (patch) | |
| tree | fdd2e97e274cb60861a1bd6e8b706b5388fe098d | |
| parent | c6ba413818be855fcc103fc74c40225db4fdab46 (diff) | |
| download | emacs-a8c14da8498eb09c3dc26d1b4edeaa00df9135d5.tar.gz emacs-a8c14da8498eb09c3dc26d1b4edeaa00df9135d5.zip | |
IDO: Disable match re-ordering for buffer switching
Fixes: debbugs:2042
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/ido.el | 22 |
2 files changed, 26 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e8a05696437..8134363f184 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-09-16 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | IDO: Disable match re-ordering for buffer switching. | ||
| 4 | * ido.el (ido-confirm-unique-completion): New variable. | ||
| 5 | (ido-set-matches-1): Use it. (Bug#2042) | ||
| 6 | |||
| 1 | 2012-09-12 Jose Marino <marinoj@nso.edu> (tiny change) | 7 | 2012-09-12 Jose Marino <marinoj@nso.edu> (tiny change) |
| 2 | 8 | ||
| 3 | * progmodes/idlw-shell.el (idlwave-shell-complete-filename): | 9 | * progmodes/idlw-shell.el (idlwave-shell-complete-filename): |
diff --git a/lisp/ido.el b/lisp/ido.el index fe94c7f225e..512ac9d4a18 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -493,6 +493,17 @@ as first char even if `ido-enable-prefix' is nil." | |||
| 493 | :type 'boolean | 493 | :type 'boolean |
| 494 | :group 'ido) | 494 | :group 'ido) |
| 495 | 495 | ||
| 496 | ;; See http://debbugs.gnu.org/2042 for more info. | ||
| 497 | (defcustom ido-buffer-disable-smart-matches t | ||
| 498 | "Non-nil means not to re-order matches for buffer switching. | ||
| 499 | By default, ido aranges matches in the following order: | ||
| 500 | |||
| 501 | full-matches > suffix matches > prefix matches > remaining matches | ||
| 502 | |||
| 503 | which can get in the way for buffer switching." | ||
| 504 | :type 'boolean | ||
| 505 | :group 'ido) | ||
| 506 | |||
| 496 | (defcustom ido-confirm-unique-completion nil | 507 | (defcustom ido-confirm-unique-completion nil |
| 497 | "Non-nil means that even a unique completion must be confirmed. | 508 | "Non-nil means that even a unique completion must be confirmed. |
| 498 | This means that \\[ido-complete] must always be followed by \\[ido-exit-minibuffer] | 509 | This means that \\[ido-complete] must always be followed by \\[ido-exit-minibuffer] |
| @@ -3688,10 +3699,17 @@ This is to make them appear as if they were \"virtual buffers\"." | |||
| 3688 | (rex0 (if ido-enable-regexp text (regexp-quote text))) | 3699 | (rex0 (if ido-enable-regexp text (regexp-quote text))) |
| 3689 | (rexq (concat rex0 (if slash ".*/" ""))) | 3700 | (rexq (concat rex0 (if slash ".*/" ""))) |
| 3690 | (re (if ido-enable-prefix (concat "\\`" rexq) rexq)) | 3701 | (re (if ido-enable-prefix (concat "\\`" rexq) rexq)) |
| 3691 | (full-re (and do-full (not ido-enable-regexp) (not (string-match "\$\\'" rex0)) | 3702 | (full-re (and do-full |
| 3703 | (and (eq ido-cur-item 'buffer) | ||
| 3704 | (not ido-buffer-disable-smart-matches)) | ||
| 3705 | (not ido-enable-regexp) | ||
| 3706 | (not (string-match "\$\\'" rex0)) | ||
| 3692 | (concat "\\`" rex0 (if slash "/" "") "\\'"))) | 3707 | (concat "\\`" rex0 (if slash "/" "") "\\'"))) |
| 3693 | (suffix-re (and do-full slash | 3708 | (suffix-re (and do-full slash |
| 3694 | (not ido-enable-regexp) (not (string-match "\$\\'" rex0)) | 3709 | (and (eq ido-cur-item 'buffer) |
| 3710 | (not ido-buffer-disable-smart-matches)) | ||
| 3711 | (not ido-enable-regexp) | ||
| 3712 | (not (string-match "\$\\'" rex0)) | ||
| 3695 | (concat rex0 "/\\'"))) | 3713 | (concat rex0 "/\\'"))) |
| 3696 | (prefix-re (and full-re (not ido-enable-prefix) | 3714 | (prefix-re (and full-re (not ido-enable-prefix) |
| 3697 | (concat "\\`" rexq))) | 3715 | (concat "\\`" rexq))) |