emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Consistent face for keys in *Help* and `substitute-command-keys'


From: Basil L. Contovounesios
Subject: Re: Consistent face for keys in *Help* and `substitute-command-keys'
Date: Wed, 24 Feb 2021 14:00:25 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Stefan Kangas <stefan@marxist.se> writes:

> Thoughts welcome.

Thanks, just some questions from me.

[...]

> +(defface help-key-binding '((t :weight semi-bold :foreground "ForestGreen"))
> +  "Face for keybindings in *Help* buffers."
> +  :group 'help)

Missing :version?

> diff --git a/lisp/help-fns.el b/lisp/help-fns.el
> index 7244695094..8277bbdad1 100644
> --- a/lisp/help-fns.el
> +++ b/lisp/help-fns.el
> @@ -466,12 +466,15 @@ help-fns--key-bindings
>                ;; If lots of ordinary text characters run this command,
>                ;; don't mention them one by one.
>                (if (< (length non-modified-keys) 10)
> -                  (princ (mapconcat #'key-description keys ", "))
> +                  (with-current-buffer standard-output
> +                    (insert (mapconcat #'help--key-description-fontified
> +                                       keys ", ")))

Why is insert needed in place of princ here, but not below?

>                  (dolist (key non-modified-keys)
>                    (setq keys (delq key keys)))
>                  (if keys
>                      (progn
> -                      (princ (mapconcat #'key-description keys ", "))
> +                      (princ (mapconcat #'help--key-description-fontified
> +                                        keys ", "))

[...]

> +                 (replace-match (propertize
> +                                 (key-description
> +                                  (substring (this-command-keys) 0 -1))
> +                                 'font-lock-face 'help-key-binding
> +                                 'face 'help-key-binding)

Why not use help--key-description-fontified here?

-- 
Basil



reply via email to

[Prev in Thread] Current Thread [Next in Thread]