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: Clément Pit-Claudel
Subject: Re: Escaping a string for substitute-command-keys
Date: Sat, 5 Oct 2019 04:04:34 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 2019-10-05 03:12, Eli Zaretskii wrote:
>> 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.

Makes sense.

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

Sounds good, and I can work on the patch.  I think I like the first solution 
better, if we can come up with something elegant: the second case will force us 
to define priorities, and besides we already have kbd-help in addition to 
help-echo.

What about the following: before performing a conversion, 
substitute-command-keys could check a property of the string that it receives, 
say help-echo-conversion, and if that property is nil it would not perform the 
conversion.

Alternatively, there's the option of performing conversion only on those 
'help-echo' properties that are string, and leaving (the output of) the ones 
that are functions untouched.

What do you think?
Clément.



reply via email to

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