diff options
| -rw-r--r-- | lisp/minibuffer.el | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index b61b366a576..e7d081eaeb2 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el | |||
| @@ -1684,15 +1684,14 @@ See also `display-completion-list'.") | |||
| 1684 | 1684 | ||
| 1685 | (defface completions-first-difference | 1685 | (defface completions-first-difference |
| 1686 | '((t (:inherit bold))) | 1686 | '((t (:inherit bold))) |
| 1687 | "Face for the first uncommon character in completions. | 1687 | "Face for the first uncommon character in prefix completions. |
| 1688 | See also the face `completions-common-part'.") | 1688 | See also the face `completions-common-part'.") |
| 1689 | 1689 | ||
| 1690 | (defface completions-common-part '((t nil)) | 1690 | (defface completions-common-part '((t (:inherit underline))) |
| 1691 | "Face for the common prefix substring in completions. | 1691 | "Face for parts of completions matching a pattern. |
| 1692 | The idea of this face is that you can use it to make the common parts | 1692 | You can use it to make the common parts less visible than normal, |
| 1693 | less visible than normal, so that the differing parts are emphasized | 1693 | so that the differing parts are emphasized by contrast. See also |
| 1694 | by contrast. | 1694 | the face `completions-first-difference'.") |
| 1695 | See also the face `completions-first-difference'.") | ||
| 1696 | 1695 | ||
| 1697 | (defun completion-hilit-commonality (completions prefix-len &optional base-size) | 1696 | (defun completion-hilit-commonality (completions prefix-len &optional base-size) |
| 1698 | "Apply font-lock highlighting to a list of completions, COMPLETIONS. | 1697 | "Apply font-lock highlighting to a list of completions, COMPLETIONS. |
| @@ -3082,8 +3081,7 @@ latter (which has two).") | |||
| 3082 | (setq str (copy-sequence str)) | 3081 | (setq str (copy-sequence str)) |
| 3083 | (unless (string-match re str) | 3082 | (unless (string-match re str) |
| 3084 | (error "Internal error: %s does not match %s" re str)) | 3083 | (error "Internal error: %s does not match %s" re str)) |
| 3085 | (let* ((pos (if point-idx (match-beginning point-idx) (match-end 0))) | 3084 | (let* ((md (match-data)) |
| 3086 | (md (match-data)) | ||
| 3087 | (start (pop md)) | 3085 | (start (pop md)) |
| 3088 | (end (pop md)) | 3086 | (end (pop md)) |
| 3089 | (len (length str)) | 3087 | (len (length str)) |
| @@ -3137,10 +3135,6 @@ latter (which has two).") | |||
| 3137 | (put-text-property start end | 3135 | (put-text-property start end |
| 3138 | 'font-lock-face 'completions-common-part | 3136 | 'font-lock-face 'completions-common-part |
| 3139 | str) | 3137 | str) |
| 3140 | (if (> (length str) pos) | ||
| 3141 | (put-text-property pos (1+ pos) | ||
| 3142 | 'font-lock-face 'completions-first-difference | ||
| 3143 | str)) | ||
| 3144 | (unless (zerop (length str)) | 3138 | (unless (zerop (length str)) |
| 3145 | (put-text-property | 3139 | (put-text-property |
| 3146 | 0 1 'completion-score | 3140 | 0 1 'completion-score |