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: Eli Zaretskii
Subject: Re: Consistent face for keys in *Help* and `substitute-command-keys'
Date: Sun, 07 Mar 2021 08:45:39 +0200

> From: Stefan Kangas <stefan@marxist.se>
> Date: Sat, 6 Mar 2021 22:03:05 -0500
> Cc: larsi@gnus.org, emacs-devel@gnu.org
> 
> >> +*** Keybindings in 'help-mode' use the new `help-key-binding' face.
> >
> > I think this should mention substitute-command-keys, and say that any
> > text that is run through that function will be propertized.  I'd also
> > mention the effect on tooltips there.
> 
> How about this:
> 
> *** Keybindings in 'help-mode' use the new 'help-key-binding' face.
> This face is added by 'substitute-command-keys' to any "\[command]"
> substitution.  The return value of that function should consequently
> be assumed to be a propertized string.
> 
> Note that the new face will also be used in tooltips.  When using the
> GTK toolkit, this is only true if 'x-gtk-use-system-tooltips' is t.

SGTM, thanks.

> >> --- a/lisp/help.el
> >> +++ b/lisp/help.el
> >> @@ -104,8 +104,8 @@ help-map
> >>      (define-key map "R" 'info-display-manual)
> >>      (define-key map "s" 'describe-syntax)
> >>      (define-key map "t" 'help-with-tutorial)
> >> -    (define-key map "w" 'where-is)
> >>      (define-key map "v" 'describe-variable)
> >> +    (define-key map "w" 'where-is)
> >>      (define-key map "q" 'help-quit)
> >
> > Why the change in the order?
> 
> It's just to make them alphabetical.

That's what I thought, but then "q" is out of order, isn't it?

> >> +                        (insert (propertize "M-x "
> >> +                                            'face 'help-key-binding
> >> +                                            'font-lock-face 
> >> 'help-key-binding))
> >
> > Why are we fontifying "M-x" here?
> 
> I understand "M-x" to be part of the keybinding for that command, so I
> think it makes sense to use the same face for that part too.  IOW,
> rather than fontifying only "apropos" in "M-x apropos" we fontify the
> whole string.

I'm not sure it's a good idea.  "M-x foobar" is not a key sequence in
the sense we use it for this feature, I think.  This feature is not
about displaying any key sequence in any context, it's about
displaying them in the context of help-related text.

But I have no strong opinions here.



reply via email to

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