diff options
author | Leo Liu <sdl.web@gmail.com> | 2012-11-10 09:28:22 +0800 |
---|---|---|
committer | Leo Liu <sdl.web@gmail.com> | 2012-11-10 09:28:22 +0800 |
commit | 05a859c1bd9cd07b2c0fad06a0694e88ea929fcf (patch) | |
tree | 0e080a550648891305d5bd9de17e1bede287dbff /lisp/ido.el | |
parent | 32e5c58ca969ec30d31520da52c9866cafa62927 (diff) | |
download | emacs-05a859c1bd9cd07b2c0fad06a0694e88ea929fcf.tar.gz |
* lisp/ido.el (ido-set-matches-1): Improve flex matching performance by
removing backtracking in the regexp (suggested by Stefan).
Fixes: debbugs:12796
Diffstat (limited to 'lisp/ido.el')
-rw-r--r-- | lisp/ido.el | 6 |
1 files changed, 5 insertions, 1 deletions
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\"." ido-enable-flex-matching (> (length ido-text) 1) (not ido-enable-regexp)) - (setq re (mapconcat #'regexp-quote (split-string ido-text "") ".*")) + (setq re (concat (regexp-quote (string (aref ido-text 0))) + (mapconcat (lambda (c) + (concat "[^" (string c) "]*" + (regexp-quote (string c)))) + (substring ido-text 1) ""))) (if ido-enable-prefix (setq re (concat "\\`" re))) (mapc |