From e4b9e1c66cf582f9bf3c149839252fb5aab0497e Mon Sep 17 00:00:00 2001 From: Protesilaos Stavrou Date: Tue, 22 Jun 2021 15:33:26 +0200 Subject: [PATCH] Use named face for apropos-button * etc/NEWS: Document new face. * lisp/apropos.el (apropos-button): Define new face. (apropos-face): Specify face instead of hardcoding attributes (bug#49162). --- etc/NEWS | 3 +++ lisp/apropos.el | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 40c7c931624..0631eaf8227 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1612,6 +1612,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'. +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 17665a725ac..f2460643ab3 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -96,6 +96,11 @@ include key-binding information in its output." "Face for property name in Apropos output, or nil for none." :version "24.3") +(defface apropos-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 @@ before `apropos-mode' makes it buffer-local.") (define-button-type 'apropos-face 'apropos-label "Face" 'apropos-short-label "F" - 'face '(font-lock-variable-name-face button) + 'face 'apropos-button 'help-echo "mouse-2, RET: Display more help on this face" 'follow-link t 'action (lambda (button) -- 2.39.2