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: Thu, 4 Mar 2021 00:24:14 -0600

Eli Zaretskii <eliz@gnu.org> writes:

>> I think it is okay that tooltips do not use the `help-key-binding' face.
>
> If you are willing to give up on key sequences in tooltips, then why
> do it in substitute-command-keys?

I have thought a bit more about this and I can see that supporting this
in tooltips could be useful.  So I'll look into it.

> So I guess we will need to change the design of this to avoid overriding
> the whole face of a tooltip, or maybe add some special code to
> help_echo_substitute_command_keys.

Could we just use `add-face-text-property' here, perhaps?

It seems to do what we want:

    (let ((foo "x") bar)
      (add-face-text-property 0 (length foo) 'bold nil foo)
      (setq bar (concat "y" foo "y"))
      (add-face-text-property 0 (length bar) 'italic nil bar)
      bar)

    => #("yxy" 0 1 (face italic) 1 2 (face (italic bold)) 2 3 (face italic))



reply via email to

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