Subject: bug#21588: 25.0.50: Single quotes becoming curvy quotes in message function

From: Paul Eggert <[email-masked]>
Date: Wed, 30 Sep 2015 15:40:53 -0700

Kaushal Modi wrote:
> It doesn't feel right that (message "'Hey'") gets displayed as ’Hey’.

This shouldn't happen if your ~/.emacs has (setq text-quoting-style 
'grave) or (setq text-quoting-style 'straight), so I assume the issue 
came up because your text-quoting-style is ‘curve’ or defaults to ‘curve’.

The initial version of the ‘curve’ code behaved as you suggested, and 
left isolated apostrophes alone.  But as Dmitry pointed out, apostrophe 
in English is represented by right single quotation mark as standard 
typographic practice in fonts with directed quotes.  In traditional 
Emacs usage most isolated apostrophes in docstrings and diagnostics are 
English apostrophes, so it seemed appropriate to default to 
transliterating them as in English, of course with an escape hatch for 
the exceptions intended to be straight apostrophes.  So I changed the 
code to translate all non-escaped apostrophes.  This simplified the 
transformation rules, which was also a win.

Although there were a few diagnostics in Elisp that quoted English 
phrases 'like this', as I recall RMS said that directed quotes were 
preferred, so I fixed the instances I found to quote `like this' in 
message format strings.  Undoubtedly I missed some instances and so some 
minor display glitches remain, but they can be fixed as they turn up.

To get typewriter-style straight quoting in your own code, independent 
of text-quoting-style, you can write (message "%s" "'Hey'").