From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Protesilaos Stavrou Newsgroups: gmane.emacs.bugs Subject: bug#49162: 28.0.50; [PATCH] Use named face for apropos-face-button Date: Tue, 22 Jun 2021 16:09:43 +0300 Message-ID: <87k0mmavvs.fsf@protesilaos.com> References: <878s333rc3.fsf@protesilaos.com> <83eecuunuw.fsf@gnu.org> <325c9dd4-2f6b-f8a8-bd87-02a8b6f28ba7@gmx.at> <87mtriaykq.fsf@protesilaos.com> <838s32ulcf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37867"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Notmuch/0.32.1 (https://notmuchmail.org) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 49162@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 22 15:10:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lvgAL-0009fB-KM for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Jun 2021 15:10:09 +0200 Original-Received: from localhost ([::1]:41628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvgAK-0001hw-In for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Jun 2021 09:10:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvgAE-0001hh-77 for bug-gnu-emacs@gnu.org; Tue, 22 Jun 2021 09:10:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54781) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lvgAD-0007sT-W6 for bug-gnu-emacs@gnu.org; Tue, 22 Jun 2021 09:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lvgAD-0001j5-Qw for bug-gnu-emacs@gnu.org; Tue, 22 Jun 2021 09:10:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Protesilaos Stavrou Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Jun 2021 13:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49162 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 49162-submit@debbugs.gnu.org id=B49162.16243673966617 (code B ref 49162); Tue, 22 Jun 2021 13:10:01 +0000 Original-Received: (at 49162) by debbugs.gnu.org; 22 Jun 2021 13:09:56 +0000 Original-Received: from localhost ([127.0.0.1]:38094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvgA8-0001if-5D for submit@debbugs.gnu.org; Tue, 22 Jun 2021 09:09:56 -0400 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:53855) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvgA3-0001iL-LN for 49162@debbugs.gnu.org; Tue, 22 Jun 2021 09:09:54 -0400 Original-Received: (Authenticated sender: public@protesilaos.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 60AD7FF806; Tue, 22 Jun 2021 13:09:44 +0000 (UTC) In-Reply-To: <838s32ulcf.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:208855 Archived-At: --=-=-= Content-Type: text/plain On 2021-06-22, 15:37 +0300, Eli Zaretskii wrote: >> From: Protesilaos Stavrou >> Cc: 49162@debbugs.gnu.org >> 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Use-named-face-for-apropos-button-face.patch >From 8183d254688f2f37404c0669e0a7636dd4c18c7e Mon Sep 17 00:00:00 2001 Message-Id: <8183d254688f2f37404c0669e0a7636dd4c18c7e.1624367239.git.info@protesilaos.com> From: Protesilaos Stavrou 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 --=-=-=--