]> git.eshelyaron.com Git - emacs.git/commitdiff
Speed up fido-mode
authorDmitry Gutov <dgutov@yandex.ru>
Sun, 4 Jul 2021 01:38:35 +0000 (04:38 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Sun, 4 Jul 2021 01:38:54 +0000 (04:38 +0300)
* lisp/icomplete.el (icomplete-completions): Speed up fido-mode (bug#48841).

lisp/icomplete.el

index 26698c43cfd183dc07cf8854c37bd409ed036f50..576fced015a7f9d4c41efbf7f60d8576260137f2 100644 (file)
@@ -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