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

From: Protesilaos Stavrou <[email-masked]>
Date: Mon, 21 Jun 2021 23:17:32 +0300

Dear maintainers,

The attached patch defines a new face for the Apropos buffer which
applies to buttons that indicate faces.

Before the attributes were hardcoded and could thus not be edited by the
user/theme.

All the best,
Protesilaos

-- 
Protesilaos Stavrou
https://protesilaos.com
>From fed7e750cb8a6b0057c8c036c6113335f3ebeb44 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-face-button

* etc/NEWS: Document new face.
* lisp/apropos.el (apropos-face): Define new face.
(apropos-face-button): 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..4cbd87b917 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-face-button'.
+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..f24448599f 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-face-button
+  '((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-face-button
   'help-echo "mouse-2, RET: Display more help on this face"
   'follow-link t
   'action (lambda (button)
-- 
2.32.0