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#46748: 28.0.50; [PATCH] Use named faces in shortdoc Date: Wed, 24 Feb 2021 11:15:59 +0200 Message-ID: <87zgztq10w.fsf@protesilaos.com> 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="30903"; mail-complaints-to="usenet@ciao.gmane.io" To: 46748@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 24 14:37:05 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 1lEuLh-0007vy-Av for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Feb 2021 14:37:05 +0100 Original-Received: from localhost ([::1]:45702 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEuLg-0007sp-AR for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Feb 2021 08:37:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEu4G-0006K9-Gw for bug-gnu-emacs@gnu.org; Wed, 24 Feb 2021 08:19:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50561) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lEu4E-0007LA-RN for bug-gnu-emacs@gnu.org; Wed, 24 Feb 2021 08:19:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lEu4E-0001We-MC for bug-gnu-emacs@gnu.org; Wed, 24 Feb 2021 08:19:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Protesilaos Stavrou Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Feb 2021 13:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46748 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16141726975795 (code B ref -1); Wed, 24 Feb 2021 13:19:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Feb 2021 13:18:17 +0000 Original-Received: from localhost ([127.0.0.1]:33870 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lEu3V-0001VN-AM for submit@debbugs.gnu.org; Wed, 24 Feb 2021 08:18:17 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:47062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lEqHB-0001bs-0V for submit@debbugs.gnu.org; Wed, 24 Feb 2021 04:16:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEqHA-0008HD-S3 for bug-gnu-emacs@gnu.org; Wed, 24 Feb 2021 04:16:08 -0500 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:41873) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEqH8-0006AK-Oz for bug-gnu-emacs@gnu.org; Wed, 24 Feb 2021 04:16:08 -0500 X-Originating-IP: 94.46.225.161 Original-Received: from kronos (unknown [94.46.225.161]) (Authenticated sender: public@protesilaos.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 0CB44240014 for ; Wed, 24 Feb 2021 09:16:01 +0000 (UTC) Received-SPF: none client-ip=217.70.183.193; envelope-from=public@protesilaos.com; helo=relay1-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 24 Feb 2021 08:18:16 -0500 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:200715 Archived-At: --=-=-= Content-Type: text/plain Dear maintainers, The shortdoc.el library applies faces in a way that is difficult for users/themes to customise. The attached patch addresses that issue. All the best, Protesilaos -- Protesilaos Stavrou protesilaos.com --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Use-named-faces-in-shortdoc.patch >From 4f6f62a10da39646692ed70eec60ff05726d7c32 Mon Sep 17 00:00:00 2001 Message-Id: <4f6f62a10da39646692ed70eec60ff05726d7c32.1614158067.git.info@protesilaos.com> From: Protesilaos Stavrou Date: Wed, 24 Feb 2021 11:01:20 +0200 Subject: [PATCH] Use named faces in shortdoc * shortdoc.el (shortdoc-heading): Define new face for headings. (shortdoc-display-group): Apply new heading face. (shortdoc--display-function): Use existing face for section text. * etc/NEWS: Document new face. --- etc/NEWS | 4 ++++ lisp/emacs-lisp/shortdoc.el | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 5df8ee140c..2bad41f5ee 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1734,6 +1734,10 @@ If this is bound to something non-nil, functions like This is a plain 2D button, but uses the background color instead of the foreground color. +--- +*** New face 'shortdoc-heading'. +Applies to headings of shortdoc sections. + +++ *** New predicate functions 'length<', 'length>' and 'length='. Using these functions may be more efficient than using 'length' (if diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el index 39e69f5aab..789d6325e9 100644 --- a/lisp/emacs-lisp/shortdoc.el +++ b/lisp/emacs-lisp/shortdoc.el @@ -40,6 +40,11 @@ shortdoc-separator (t :height 0.1 :inverse-video t :extend t)) "Face used to separate sections.") +(defface shortdoc-heading + '((t :inherit variable-pitch :height 1.3 :weight bold)) + "Face used for a heading." + :version "28.1") + (defface shortdoc-section '((t :inherit variable-pitch)) "Face used for a section.") @@ -1107,7 +1112,7 @@ shortdoc-display-group (insert "\n")) (insert (propertize (concat (substitute-command-keys data) "\n\n") - 'face '(variable-pitch (:height 1.3 :weight bold)) + 'face 'shortdoc-heading 'shortdoc-section t))) ;; There may be functions not yet defined in the data. ((fboundp (car data)) @@ -1175,7 +1180,7 @@ shortdoc--display-function (prin1 value (current-buffer))) (insert "\n " single-arrow " " (propertize "[it depends]" - 'face 'variable-pitch) + 'face 'shortdoc-section) "\n")) (:no-value (if (stringp value) -- 2.30.1 --=-=-=--