[Top][All Lists]

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

Re: A simple solution to "Upcoming loss of usability ..."

From: Dmitry Gutov
Subject: Re: A simple solution to "Upcoming loss of usability ..."
Date: Sat, 27 Jun 2015 20:53:25 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0

On 06/27/2015 08:28 PM, Paul Eggert wrote:

In that case I don't understand the patch being against f743819.
f743819 already has some curved quotes in docstrings, to avoid
ambiguities of using grave accent and apostrophe to quote.  So that
patch against f743819 won't determine whether font-lock can address this
issue without using curved quotes in docstrings.

I just needed a version where substitute-command-keys doesn't replace the quotes (so that the font-lock rules do have something to work on). The question of ambiguity is a matter of refining the patch.

Even with this in mind, though, the patch mishandles some quotes.  For
example, the docstring for texinfo-format-verb contains:

   For example, @verb\{|@|\} results in @ and
   @verb\{+@'e?`!`+} results in @'e?`!`.

The patch displays this as:

   For example, @verb{|@|} results in @ and
   @verb{+@'e?`!‘+} results in @’e?`!`.

which is incorrect: those curved quotes should be grave accent and

Only because the regexp is constructed this way, and we haven't picked an escaping syntax.

It'd be impractical to work around this sort of problem entirely with
clever font-lock regular expressions.  We will need some escape syntax
to suppress transliteration for exceptional docstrings like the above.
I think you've mentioned the need for that sort of thing, but it's not
clear what it would look like or

I've described the possible options in the previous message here of this subthread (in the second half):


So, do you find "\\" acceptable? Should I send a patch with support for it?

> how it would be implemented with font-lock.

There are several examples in our Lisp code of searching for only unescaped instances of some character, using a regexp. But failing that, examining characters preceding a match would work almost as well.

Plus, as we've mentioned, the patch can mishandle user-supplied values
that contain grave accent and apostrophe.

Nothing surprising there either. I'll try to handle it in the next version of the patch.

It will be very easy to limit the conversion to only within strings.

As I understand it we gave up on transliteration of Elisp source code
after you wrote the above, so for now I'll not comment on this point (or
the other points of the message that talk about transliterating source

You have also snipped the suggestions about the escaping syntax.

Is Info actually relevant in this discussion? Looking at info.el, it
seems to

It's relevant, as it uses and displays the curved quotes that some users
find objectionable, and did so even in 24.5.

I thought the external program performs the conversion. But yes, converting those curly quotes to straight ones in font-lock is also possible.

reply via email to

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