summaryrefslogtreecommitdiff
path: root/lisp/icomplete.el
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2021-07-04 04:38:35 +0300
committerDmitry Gutov <dgutov@yandex.ru>2021-07-04 04:38:54 +0300
commit9b318d5c58fef6faf344f0377cbf169b5e1f0e09 (patch)
tree19549413a5ba4a5b2e40d1aa697b133ce2557a0c /lisp/icomplete.el
parent0aee54a54beebedee20466b23ab99ae48f61259c (diff)
downloademacs-9b318d5c58fef6faf344f0377cbf169b5e1f0e09.tar.gz
Speed up fido-mode
* lisp/icomplete.el (icomplete-completions): Speed up fido-mode (bug#48841).
Diffstat (limited to 'lisp/icomplete.el')
-rw-r--r--lisp/icomplete.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 26698c43cfd..576fced015a 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -859,13 +859,16 @@ matches exist."
(base-size (prog1 (cdr last)
(if last (setcdr last nil))))
(most-try
- (if (and base-size (> base-size 0))
+ ;; icomplete-hide-common-prefix logic is used
+ ;; unconditionally when there is single match.
+ (when (or icomplete-hide-common-prefix (not (cdr comps)))
+ (if (and base-size (> base-size 0))
+ (completion-try-completion
+ name candidates predicate (length name) md)
+ ;; If the `comps' are 0-based, the result should be
+ ;; the same with `comps'.
(completion-try-completion
- name candidates predicate (length name) md)
- ;; If the `comps' are 0-based, the result should be
- ;; the same with `comps'.
- (completion-try-completion
- name comps nil (length name) md)))
+ name comps nil (length name) md))))
(most (if (consp most-try) (car most-try)
(if most-try (car comps) "")))
;; Compare name and most, so we can determine if name is