# HG changeset patch # User Juanma Barranquero # Date 1206008891 0 # Node ID 98814f79eb9461f64b7efcf8687e5a27c59c189b # Parent 4e7095d02b7a7b64b107a63319e0d0ce90672291 (icomplete-completions): While collecting the list of prospective candidates, don't overshoot `icomplete-prospects-length'. diff -r 4e7095d02b7a -r 98814f79eb94 lisp/icomplete.el --- a/lisp/icomplete.el Thu Mar 20 09:17:22 2008 +0000 +++ b/lisp/icomplete.el Thu Mar 20 10:28:11 2008 +0000 @@ -299,17 +299,19 @@ (substring most (length name)) close-bracket-determined))) ;;"-prospects" - more than one candidate - (prospects-len 0) - prospects most-is-exact comp) + (prospects-len (+ (length determ) 6)) ;; take {,...} into account + prospects most-is-exact comp limit) (if (eq most-try t) (setq prospects nil) - (while (and comps (< prospects-len icomplete-prospects-length)) + (while (and comps (not limit)) (setq comp (substring (car comps) most-len) comps (cdr comps)) (cond ((string-equal comp "") (setq most-is-exact t)) ((member comp prospects)) - (t (setq prospects (cons comp prospects) - prospects-len (+ (length comp) 1 prospects-len)))))) + (t (setq prospects-len (+ (length comp) 1 prospects-len)) + (if (< prospects-len icomplete-prospects-length) + (setq prospects (cons comp prospects)) + (setq limit t)))))) (if prospects (concat determ "{"