]> git.eshelyaron.com Git - emacs.git/commitdiff
Use named faces in shortdoc
authorProtesilaos Stavrou <info@protesilaos.com>
Wed, 24 Feb 2021 16:18:26 +0000 (17:18 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 24 Feb 2021 16:18:26 +0000 (17:18 +0100)
* 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 (bug#46748).

etc/NEWS
lisp/emacs-lisp/shortdoc.el

index 5df8ee140cd87ae91a590bf2ce9e1f142f7bdac0..2bad41f5ee9190d87124e8aff4af5ca592e68386 100644 (file)
--- 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
index 39e69f5aab9f38b7816330a5ff06c0a606e43824..789d6325e9a510d8de984c50c637266cc545fc2b 100644 (file)
     (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 @@ There can be any number of :example/:result elements."
            (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 @@ function's documentation in the Info manual")))
                     (prin1 value (current-buffer)))
                   (insert "\n    " single-arrow " "
                           (propertize "[it depends]"
-                                      'face 'variable-pitch)
+                                      'face 'shortdoc-section)
                           "\n"))
                  (:no-value
                   (if (stringp value)