[Top][All Lists]

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

bug#23425: master branch: `message' wrongly corrupts ' to curly quote.

From: Paul Eggert
Subject: bug#23425: master branch: `message' wrongly corrupts ' to curly quote.
Date: Fri, 9 Jun 2017 14:44:54 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0

On 06/09/2017 12:41 PM, Alan Mackenzie wrote:

> It's not OK to have two functions doing the same thing.

Nobody is proposing that. Although the proposed function is similar to the message function, it differs in that it does not restyle quotes. There is lots of precedent for having two functions with similar but not identical behavior: for example, the error and user-error functions.

>> If having one single function would mean changing hundreds or thousands of callers, then there is an important sense in which one single function would not be better.
> That depends solely on whether anybody's prepared to do the work.

No, it also depends on people who have to deal with the modified code afterwards, as the resulting formats would be harder to read. And it depends not only on doing the work for Emacs itself, but also for third-party software written in Elisp. These are significant costs.

Users should not be required to litter their code with hard-to-read formats like "Can%'t encode %`0x%x%' with this buffer%'s coding system" to get decent quoting. This would be more error-prone than what we have now, and although I do not object to adding support for new formats I would object to requiring their use in place of what we have now.

> You're proposing changing `message' to `memo' for those callers anyway.

No, existing callers such as (message "%s" filename) would continue to operate as before, and would not need to be changed.

> This would leave unsolved the problem of format strings containing both literal quote characters and quote characters for possible replacement by curlies.

I don’t see this as a significant problem in practice. In practice, formats typically want all quotes translated, or no quotes translated. If I am wrong I would like to see practical examples of the problem before worrying about possible solutions. One can address the problem without making any changes to Emacs; whether changing Emacs would be helpful depends on how the problem comes up in practice.

>> We discussed and rejected more-“surreptitious” options back before his stuff was installed. For example, we discussed changing ‘format’ to behave like ‘format-message’ does now.
> In effect, that's what was actually done.

Not at all. Had we made the more-drastic change, we would have had to rewrite calls like (format "\\`%s" not-word-symbol-re). This would have been considerably more work, and would have resulted in far more compatibility problems, than the change that was eventually installed.

reply via email to

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