diff options
| author | Leo Liu | 2012-11-10 09:28:22 +0800 |
|---|---|---|
| committer | Leo Liu | 2012-11-10 09:28:22 +0800 |
| commit | 05a859c1bd9cd07b2c0fad06a0694e88ea929fcf (patch) | |
| tree | 0e080a550648891305d5bd9de17e1bede287dbff | |
| parent | 32e5c58ca969ec30d31520da52c9866cafa62927 (diff) | |
| download | emacs-05a859c1bd9cd07b2c0fad06a0694e88ea929fcf.tar.gz emacs-05a859c1bd9cd07b2c0fad06a0694e88ea929fcf.zip | |
* lisp/ido.el (ido-set-matches-1): Improve flex matching performance by
removing backtracking in the regexp (suggested by Stefan).
Fixes: debbugs:12796
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/ido.el | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a07749e4f18..fb436fa0038 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-11-10 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * ido.el (ido-set-matches-1): Improve flex matching performance by | ||
| 4 | removing backtracking in the regexp (suggested by Stefan). (Bug#12796) | ||
| 5 | |||
| 1 | 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * emacs-lisp/advice.el (ad-set-advice-info): Set defalias-fset-function. | 8 | * emacs-lisp/advice.el (ad-set-advice-info): Set defalias-fset-function. |
diff --git a/lisp/ido.el b/lisp/ido.el index 4ab183b3207..f4f9c27c847 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -3764,7 +3764,11 @@ This is to make them appear as if they were \"virtual buffers\"." | |||
| 3764 | ido-enable-flex-matching | 3764 | ido-enable-flex-matching |
| 3765 | (> (length ido-text) 1) | 3765 | (> (length ido-text) 1) |
| 3766 | (not ido-enable-regexp)) | 3766 | (not ido-enable-regexp)) |
| 3767 | (setq re (mapconcat #'regexp-quote (split-string ido-text "") ".*")) | 3767 | (setq re (concat (regexp-quote (string (aref ido-text 0))) |
| 3768 | (mapconcat (lambda (c) | ||
| 3769 | (concat "[^" (string c) "]*" | ||
| 3770 | (regexp-quote (string c)))) | ||
| 3771 | (substring ido-text 1) ""))) | ||
| 3768 | (if ido-enable-prefix | 3772 | (if ido-enable-prefix |
| 3769 | (setq re (concat "\\`" re))) | 3773 | (setq re (concat "\\`" re))) |
| 3770 | (mapc | 3774 | (mapc |