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: Stefan Kangas
Subject: Re: Consistent face for keys in *Help* and `substitute-command-keys'
Date: Wed, 24 Feb 2021 10:35:47 -0600

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

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

Fixed.

>> 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?

We do need `insert' here.  Fixed.

>>                  (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?

Using it would introduce a circular dependency between help-macro.el and
help.el.

Thanks for your comments.



reply via email to

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