[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BIKESHED: completion faces

From: João Távora
Subject: Re: BIKESHED: completion faces
Date: Wed, 6 Nov 2019 15:31:09 +0000

On Wed, Nov 6, 2019 at 3:11 PM Dmitry Gutov <address@hidden> wrote:

> OK, thank you. I'm sorry to say, it's too convoluted for my liking. But
> others' opinions are welcome.

Really, you think the patch below is "convoluted"?


diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 43dd277a2e..c202863ee0 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1682,14 +1682,19 @@ completion-setup-hook
 The completion list buffer is available as the value of `standard-output'.
 See also `display-completion-list'.")
-(defface completions-first-difference
+(defface completions-emphasis
   '((t (:inherit bold)))
-  "Face for the first character after point in completions.
-See also the face `completions-common-part'.")
+  "Primary face for highlighting important parts of completions.
+See also the face `completions-secondary-emphasis'.")
-(defface completions-common-part '((t nil))
-  "Face for the parts of completions which matched the pattern.
-See also the face `completions-first-difference'.")
+(defface completions-secondary-emphasis '((t nil))
+  "Secondary face for highlighting important parts of completions.
+See also the face `completions-emphasis'.")
+  'completions-first-difference 'completion-emphasis "27.1")
+  'completions-common-part 'completion-secondary-emphasis "27.1")
 (defun completion-hilit-commonality (completions prefix-len &optional base-size)
   "Apply font-lock highlighting to a list of completions, COMPLETIONS.
@@ -1721,11 +1726,11 @@ completion-hilit-commonality
              ;; values, all-completions may return strings
              ;; that don't contain the prefix.
              (min com-str-len (length str))
-             'face 'completions-common-part str)
+             'face 'completions-secondary-emphasis str)
             (if (> (length str) com-str-len)
                 (font-lock-prepend-text-property com-str-len (1+ com-str-len)
-                                                 'completions-first-difference
+                                                 'completions-emphasis
@@ -3145,16 +3150,16 @@ completion-pcm--hilit-commonality
            (while md
              (funcall update-score start (car md))
              (put-text-property start (pop md)
-                                'font-lock-face 'completions-common-part
+                                'font-lock-face 'completions-emphasis
              (setq start (pop md)))
            (funcall update-score len len)
            (put-text-property start end
-                              'font-lock-face 'completions-common-part
+                              'font-lock-face 'completions-emphasis
            (if (> (length str) pos)
                (put-text-property pos (1+ pos)
-                                  'font-lock-face 'completions-first-difference
+                                  'font-lock-face 'completions-secondary-emphasis
            (unless (zerop (length str))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]