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: Thu, 03 Oct 2019 19:31:38 +0300

> From: Clément Pit-Claudel <address@hidden>
> Date: Thu, 3 Oct 2019 09:52:31 -0400
> 
> I think I've seen a thread about this in the past, but I can't find it. 
> What's the expected way to escape a string before its fed to 
> substitute-command-keys, so that substitute-command-keys reconstructs the 
> original string?
> 
> The reason for this question is that since 2015 Emacs has been calling 
> substitute-command-keys on help-echo messages, which breaks flycheck and 
> flymake (a simple way to reproduce the issue is to enable flymake in a Python 
> buffer containing just xxx and to hover over the xxx with the mouse: Emacs 
> shows a tooltip containing "Undefined name ’xxx’").
> 
> So, what's the right way to escape a string to be fed to 
> substitute-command-keys?  Alternatively, is there be a way to disable the 
> transformation for a particular help-echo string, rather than forcing an 
> unnecessary rountrip?  Maybe we could add a text property, so that if a 
> string is tagged with a 'text-quoting-style property that style is used 
> instead of the default one?

If I understand what you are looking for, the answer is in the manual:
quote any character with \= (in a Lisp string, that's "\\=", of
course).  See the node "Keys in Documentation" in the ELisp manual.

If this is not what you want, please tell more.



reply via email to

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