emacs-devel
[Top][All Lists]
Advanced

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

Re: Escaping quotes in docstrings, Was: A simple solution to "Upcoming l


From: Paul Eggert
Subject: Re: Escaping quotes in docstrings, Was: A simple solution to "Upcoming loss of usability ..."
Date: Sun, 05 Jul 2015 23:12:36 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

For us to go there, could you please make substitute-command-keys add the
`escaped' property to the escaped characters in its output? And push it to
scratch/quote-escaping.

I've done that, and have discovered a couple of problems.

First, a doc string that contains \[foo] is supposed to generate a key description for 'foo', derived by calling (key-description 'foo). But key-description can return a string that contains quote marks, and in general some of them should be escaped and others should not be. It's not clear to me whether both possibilities can occur in doc strings, but the situation is worrisome.

Second, and more generally, the overall approach seems error prone. It asks programmers to mark every quote character that should not be transformed. But characters can come from many different sources, and it's hard to keep track of each place that can insert user data of some sort. In contrast, it's easy to find grave accents in doc strings, to fix the relative few that aren't already transformed automatically, and to not worry about user data.



reply via email to

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