diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-02-23 10:36:07 -0500 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-02-23 10:36:07 -0500 |
commit | 8f0fde218ff8fe91cedd9b9dce66b1535e6df56e (patch) | |
tree | ce0db4adea3221d5c51ba37080d4fad24043e10e /lisp/icomplete.el | |
parent | 49fe4321fbdf9bcb57b0b228c7d90e550128824c (diff) | |
download | emacs-8f0fde218ff8fe91cedd9b9dce66b1535e6df56e.tar.gz |
* lisp/icomplete.el (icomplete-completions): Replace last fix.
Fixes: debbugs:10850
Diffstat (limited to 'lisp/icomplete.el')
-rw-r--r-- | lisp/icomplete.el | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lisp/icomplete.el b/lisp/icomplete.el index a9719651957..97a14b12891 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -333,23 +333,23 @@ are exhibited within the square braces.)" (window-width))) (prefix-len ;; Find the common prefix among `comps'. - (if (eq t (compare-strings (car comps) nil (length most) - most nil nil completion-ignore-case)) - ;; Common case. - (length most) - ;; Else, use try-completion. - (let ((comps-prefix (try-completion "" comps))) - (and (stringp comps-prefix) - (length comps-prefix))))) + ;; We can't use the optimization below because its assumptions + ;; aren't always true, e.g. when completion-cycling (bug#10850): + ;; (if (eq t (compare-strings (car comps) nil (length most) + ;; most nil nil completion-ignore-case)) + ;; ;; Common case. + ;; (length most) + ;; Else, use try-completion. + (let ((comps-prefix (try-completion "" comps))) + (and (stringp comps-prefix) + (length comps-prefix)))) ;;) prospects most-is-exact comp limit) (if (eq most-try t) ;; (or (null (cdr comps)) (setq prospects nil) (while (and comps (not limit)) (setq comp - (if (and prefix-len (<= prefix-len (length (car comps)))) - (substring (car comps) prefix-len) - (car comps)) + (if prefix-len (substring (car comps) prefix-len) (car comps)) comps (cdr comps)) (cond ((string-equal comp "") (setq most-is-exact t)) ((member comp prospects)) |