emacs-devel
[Top][All Lists]
Advanced

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

Re: Escaping a string for substitute-command-keys


From: Eli Zaretskii
Subject: Re: Escaping a string for substitute-command-keys
Date: Sat, 05 Oct 2019 10:12:22 +0300

> Cc: address@hidden
> From: Clément Pit-Claudel <address@hidden>
> Date: Sat, 5 Oct 2019 00:06:43 -0400
> 
> On 2019-10-04 10:17, Eli Zaretskii wrote:
> > help-echo is for displaying documentation, not for displaying
> > general-purpose text strings.
> 
> Btw, it was surprising to me to see that very little code in Emacs actually 
> takes advantage of this command-substitution facility in help-echo; most 
> help-echo strings that mention commands actually hardcode the default binding.

Most probably because the call to substitute-command-keys there is a
relatively recent addition.

> Also related is the fact that help-echo allows kinds of values: strings or 
> functions.  In Flycheck's case (the one I know the best), it would be enough 
> to say that help-echo is only passed through substitute-command-keys if it's 
> a string, but not if it's a function (the reasoning being that it's easy to 
> run the substitution inside the function, if needed).  Of course, shr and 
> Flymake would then need to switch to using functions instead of strings, as 
> well.

I'm not sure whether this is a feature or a bug.

I guess we need to add some feature to control whether help-echo gets
run through substitute-command-keys, or add an alternative to
help-echo that works exactly like it, but without substitutions.
Patches welcome.



reply via email to

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