[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: Paul Eggert
Subject: Re: A simple solution to "Upcoming loss of usability ..."
Date: Sun, 28 Jun 2015 08:20:54 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

Dmitry Gutov wrote:

Ok, try this, please. "\\" before a quote keeps it untranslated.

However, it order for us to be able to show an arbitrary number of backslashes
before a quote (both translated or not), the backslashes also escape themselves.
I've limited this effect to only before a quote, so that we don't have to add
them in a lot of places (like substitute-command-keys docstring).

That rule is too complicated. Please let's keep it simple. It's simpler to explain if the escape sequence always works. It should be rare to need these escapes, so it's OK if they are multicharacter. How about your other suggestion of using backslash-tilde? This would be \\~ in the source-file string. This is unlikely to occur in docstrings; there are no occurrences in the current Emacs sources.

+Quote \\'like this\\' if the value is ?\\' (apostrophe).
+Quote \\`like this\\' if the value is ?\\` (grave accent).

There should be no need to escape the apostrophes in these lines (see the next comment).

+   nil '(("\\(?:\\=\\|[^\\]\\)\\(\\\\*\\)[`']"

First, this translates all apostrophes to quotes. It should translate only the apostrophes that are used as quotes (i.e., those that match grave accents). That's what the current master does, and what your earlier prototype did. We shouldn't try to second-guess unmatched apostrophe, any more than we should try to second-guess double-quote.

Second, the last bracketed RE should be [`'‘’] if we are to mimic the current-master behavior. (However, please see the next comment.)

+           ((or (and (null help-quote-translation)
+                     (char-displayable-p ?‘))
+                (eq help-quote-translation ?‘))

As I understand it, the need for help-quote-translation has gone away, since the primary impetus for it was that one couldn't easily search for quotes, and that problem has been fixed in the meantime by Artur's commits. So this part can be simplified and the code can always assume that the above expression evaluates to t. (This is also true of the current master of course.)

I meant an example of a Help buffer where we must not translate quotes in the 

Ah, OK, try loading the attached file. The file name contains accent grave and apostrophe, which should not be translated when one types ‘C-h v foo’.

PS. Can you please attach patches instead of pasting them bodily into your email? I could not apply the patch in your email automatically, as some characters were munged somewhere in the process.

Attachment: `big deal'.el
Description: Text Data

reply via email to

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