Subject: bug#49162: 28.0.50; [PATCH] Use named face for apropos-face-button

From: Protesilaos Stavrou <[email-masked]>
Date: Tue, 22 Jun 2021 16:09:43 +0300

On 2021-06-22, 15:37 +0300, Eli Zaretskii <[email-masked]> wrote:

>> From: Protesilaos Stavrou <[email-masked]>
>> Cc: [email-masked]
>> Date: Tue, 22 Jun 2021 15:11:33 +0300
>> 
>> Thank you Martin and Eli!  I picked that symbol because it was already
>> given by the implicit face.
>> 
>> You can try it with emacs -Q:
>> 
>> - M-x apropos RET font-lock-variable RET
>> - Place point over the underlined "Face" text and M-x describe-char
>> - In the resulting Help buffer, you will find the reference to
>>   'apropos-face-button', whose specification is defined thus:
>> 
>>     Category apropos-face-button:
>
> That's the _button_, not its _face_.  It is cumbersome to call a face
> by a name that ends with "-button", IMO.

I see.  Thank you!  Please find attached the revised patch for
'apropos-button-face'

-- 
Protesilaos Stavrou
https://protesilaos.com
>From 8183d254688f2f37404c0669e0a7636dd4c18c7e Mon Sep 17 00:00:00 2001
Message-Id: <[email-masked]>
From: Protesilaos Stavrou <[email-masked]>
Date: Mon, 21 Jun 2021 23:11:35 +0300
Subject: [PATCH] Use named face for apropos-button-face

* etc/NEWS: Document new face.
* lisp/apropos.el (apropos-face): Define new face.
(apropos-button-face): Specify face instead of hardcoding attributes.
---
 etc/NEWS        | 3 +++
 lisp/apropos.el | 7 ++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index 3c7d5ca10b..1bf8801566 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1606,6 +1606,9 @@ These new navigation commands are bound to 'n' and 'p' in
 *** New command 'apropos-function'.
 This works like 'C-u M-x apropos-command' but is more discoverable.
 
+*** New face 'apropos-button-face'.
+Applies to buttons that indicate a face.
+
 ** CC Mode
 
 *** Added support for Doxygen documentation style.
diff --git a/lisp/apropos.el b/lisp/apropos.el
index 17665a725a..c6c86f6db0 100644
--- a/lisp/apropos.el
+++ b/lisp/apropos.el
@@ -96,6 +96,11 @@ (defface apropos-property
   "Face for property name in Apropos output, or nil for none."
   :version "24.3")
 
+(defface apropos-button-face
+  '((t (:inherit (font-lock-variable-name-face button))))
+  "Face for buttons that indicate a face in Apropos."
+  :version "28.1")
+
 (defface apropos-function-button
   '((t (:inherit (font-lock-function-name-face button))))
   "Button face indicating a function, macro, or command in Apropos."
@@ -276,7 +281,7 @@ (define-button-type 'apropos-user-option
 (define-button-type 'apropos-face
   'apropos-label "Face"
   'apropos-short-label "F"
-  'face '(font-lock-variable-name-face button)
+  'face 'apropos-button-face
   'help-echo "mouse-2, RET: Display more help on this face"
   'follow-link t
   'action (lambda (button)
-- 
2.32.0