From: Juanma Barranquero Date: Thu, 20 Mar 2008 10:28:55 +0000 (+0000) Subject: (icomplete-completions): While collecting the list of prospective candidates, X-Git-Tag: emacs-pretest-23.0.90~7027 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7d94fb17ea95a5d62135d0be38ec70d5a922f586;p=emacs.git (icomplete-completions): While collecting the list of prospective candidates, don't overshoot `icomplete-prospects-length'. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a812405fd1a..75dbbd5a068 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -6,6 +6,8 @@ (icomplete-compute-delay): Fix docstring and remove spurious *. (icomplete-delay-completions-threshold): Fix typo in docstring and remove spurious *. + (icomplete-completions): While collecting the list of prospective + candidates, don't overshoot `icomplete-prospects-length'. 2008-03-20 Dan Nicolaescu diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 780fca20709..ce35a6c960d 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -299,17 +299,19 @@ are exhibited within the square braces.)" (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 "{"