emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] master 9ce1d38: Use curved quotes in core elisp diagno


From: Paul Eggert
Subject: Re: [Emacs-diffs] master 9ce1d38: Use curved quotes in core elisp diagnostics
Date: Sat, 22 Aug 2015 16:45:46 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0

Dmitry Gutov wrote:

An ambiguity in `format' can cause an unexpected error due to a
program, say, being unable to open a file.

Yes, although that's a longstanding problem: it's not something that the recent quoting-style changes have introduced, and it's not something that we really need to address now.

That being said, we could attack the problem somewhat by having %qs not only quote its output, but also insert backslashes in front of each troublesome character (which should include the characters in the string "\n\\\"'‘’“”", say). This would work only in output contexts where backslash escapes make sense, but that's reasonably common and anyway the output would be unambiguous, which is better than what we have now.

A possible downside of changing %q's behavior in this way is that it'll double backslashes in file names, and maybe MS-Windows users wouldn't like that. For example, if NAME is the file name ‘C:\Documents and Settings\Eggert\Example.png’, then:

   (error "Cannot find image file %qs" name)

would output:

   Cannot find image file ‘C:\\Documents and Settings\\Eggert\\Example.png’

and the doubled backslashes could be a bit disconcerting.



reply via email to

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