diff options
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.)" | |||
| 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)) |