diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index d2c3f9045e..e1f1ffed1c 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -3251,6 +3251,9 @@ one-letter-long matches).") (update-score (lambda (a b) "Update score variables given match range (A B)." + (add-face-text-property a b + 'completions-common-part + nil str) (setq score-numerator (+ score-numerator (- b a))) (unless (or (= a last-b) @@ -3264,19 +3267,10 @@ one-letter-long matches).") flex-score-match-tightness))))) (setq last-b b)))) - (funcall update-score start start) (while md - (funcall update-score start (car md)) - (add-face-text-property - start (pop md) - 'completions-common-part - nil str) + (funcall update-score start (pop md)) (setq start (pop md))) - (funcall update-score len len) - (add-face-text-property - start end - 'completions-common-part - nil str) + (funcall update-score start end) (if (> (length str) pos) (add-face-text-property pos (1+ pos)