GNU bug report logs - #23425
master branch: `message' wrongly corrupts ' to curly quote.

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Mon, 2 May 2016 15:26:02 UTC

Severity: normal

Tags: notabug, wontfix

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #270 received at 23425 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Alan Mackenzie <acm <at> muc.de>
Cc: Glenn Morris <rgm <at> gnu.org>, 23425 <at> debbugs.gnu.org
Subject: Re: bug#23425: master branch: `message' wrongly corrupts ' to curly
 quote.
Date: Fri, 9 Jun 2017 14:44:54 -0700
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.





This bug report was last modified 7 years and 338 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.