aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2012-02-23 10:36:07 -0500
committerStefan Monnier2012-02-23 10:36:07 -0500
commit8f0fde218ff8fe91cedd9b9dce66b1535e6df56e (patch)
treece0db4adea3221d5c51ba37080d4fad24043e10e
parent49fe4321fbdf9bcb57b0b228c7d90e550128824c (diff)
downloademacs-8f0fde218ff8fe91cedd9b9dce66b1535e6df56e.tar.gz
emacs-8f0fde218ff8fe91cedd9b9dce66b1535e6df56e.zip
* lisp/icomplete.el (icomplete-completions): Replace last fix.
Fixes: debbugs:10850
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/icomplete.el22
2 files changed, 16 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7e7588d69e8..e4fc0ea90d3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-02-23 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * icomplete.el (icomplete-completions): Replace last fix with a better
4 one (bug#10850).
5
12012-02-23 Dmitry Gutov <dgutov@yandex.ru> 62012-02-23 Dmitry Gutov <dgutov@yandex.ru>
2 7
3 * emacs-lisp/lisp.el (beginning-of-defun-raw): Don't call end-of-defun 8 * emacs-lisp/lisp.el (beginning-of-defun-raw): Don't call end-of-defun
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.)"
333 (window-width))) 333 (window-width)))
334 (prefix-len 334 (prefix-len
335 ;; Find the common prefix among `comps'. 335 ;; Find the common prefix among `comps'.
336 (if (eq t (compare-strings (car comps) nil (length most) 336 ;; We can't use the optimization below because its assumptions
337 most nil nil completion-ignore-case)) 337 ;; aren't always true, e.g. when completion-cycling (bug#10850):
338 ;; Common case. 338 ;; (if (eq t (compare-strings (car comps) nil (length most)
339 (length most) 339 ;; most nil nil completion-ignore-case))
340 ;; Else, use try-completion. 340 ;; ;; Common case.
341 (let ((comps-prefix (try-completion "" comps))) 341 ;; (length most)
342 (and (stringp comps-prefix) 342 ;; Else, use try-completion.
343 (length comps-prefix))))) 343 (let ((comps-prefix (try-completion "" comps)))
344 (and (stringp comps-prefix)
345 (length comps-prefix)))) ;;)
344 346
345 prospects most-is-exact comp limit) 347 prospects most-is-exact comp limit)
346 (if (eq most-try t) ;; (or (null (cdr comps)) 348 (if (eq most-try t) ;; (or (null (cdr comps))
347 (setq prospects nil) 349 (setq prospects nil)
348 (while (and comps (not limit)) 350 (while (and comps (not limit))
349 (setq comp 351 (setq comp
350 (if (and prefix-len (<= prefix-len (length (car comps)))) 352 (if prefix-len (substring (car comps) prefix-len) (car comps))
351 (substring (car comps) prefix-len)
352 (car comps))
353 comps (cdr comps)) 353 comps (cdr comps))
354 (cond ((string-equal comp "") (setq most-is-exact t)) 354 (cond ((string-equal comp "") (setq most-is-exact t))
355 ((member comp prospects)) 355 ((member comp prospects))