* bug#46748: 28.0.50; [PATCH] Use named faces in shortdoc
@ 2021-02-24 9:15 Protesilaos Stavrou
2021-02-24 16:18 ` Lars Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Protesilaos Stavrou @ 2021-02-24 9:15 UTC (permalink / raw)
To: 46748
[-- Attachment #1: Type: text/plain, Size: 226 bytes --]
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-named-faces-in-shortdoc.patch --]
[-- Type: text/x-patch, Size: 2535 bytes --]
From 4f6f62a10da39646692ed70eec60ff05726d7c32 Mon Sep 17 00:00:00 2001
Message-Id: <4f6f62a10da39646692ed70eec60ff05726d7c32.1614158067.git.info@protesilaos.com>
From: Protesilaos Stavrou <info@protesilaos.com>
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* bug#46748: 28.0.50; [PATCH] Use named faces in shortdoc
2021-02-24 9:15 bug#46748: 28.0.50; [PATCH] Use named faces in shortdoc Protesilaos Stavrou
@ 2021-02-24 16:18 ` Lars Ingebrigtsen
0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2021-02-24 16:18 UTC (permalink / raw)
To: Protesilaos Stavrou; +Cc: 46748
Protesilaos Stavrou <public@protesilaos.com> writes:
> The shortdoc.el library applies faces in a way that is difficult for
> users/themes to customise. The attached patch addresses that issue.
Thanks; applied to Emacs 28.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-02-24 16:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-24 9:15 bug#46748: 28.0.50; [PATCH] Use named faces in shortdoc Protesilaos Stavrou
2021-02-24 16:18 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.