]> git.eshelyaron.com Git - emacs.git/commitdiff
Speed up pcm completion styles for patternless special case
authorJoão Távora <joaotavora@gmail.com>
Wed, 25 Aug 2021 15:25:20 +0000 (16:25 +0100)
committerJoão Távora <joaotavora@gmail.com>
Wed, 25 Aug 2021 15:27:35 +0000 (16:27 +0100)
Fixes: bug#48841
* lisp/minibuffer.el (completion-flex-all-completions): Skip
completion-pcm--hilit-commonality if there's no pattern yet.

lisp/minibuffer.el

index 89d3a2a09d45586e34c7a6a942f83570ded0ba48..68e4fa17fce23b7aa477e1c29fa2ed71a723a3ad 100644 (file)
@@ -3529,7 +3529,8 @@ string in COMPLETIONS.  Return a deep copy of COMPLETIONS where
 each string is propertized with `completion-score', a number
 between 0 and 1, and with faces `completions-common-part',
 `completions-first-difference' in the relevant segments."
-  (when completions
+  (cond
+   ((and completions (cl-loop for e in pattern thereis (stringp e)))
     (let* ((re (completion-pcm--pattern->regex pattern 'group))
            (point-idx (completion-pcm--pattern-point-idx pattern))
            (case-fold-search completion-ignore-case)
@@ -3620,7 +3621,8 @@ between 0 and 1, and with faces `completions-common-part',
               0 1 'completion-score
               (/ score-numerator (* end (1+ score-denominator)) 1.0) str)))
          str)
-       completions))))
+       completions)))
+   (t completions)))
 
 (defun completion-pcm--find-all-completions (string table pred point
                                                     &optional filter)