all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#21588: 25.0.50: Single quotes becoming curvy quotes in message function
@ 2015-09-29 21:17 Kaushal Modi
  2015-09-29 21:32 ` Glenn Morris
  2015-09-30 21:10 ` Drew Adams
  0 siblings, 2 replies; 9+ messages in thread
From: Kaushal Modi @ 2015-09-29 21:17 UTC (permalink / raw)
  To: 21588

[-- Attachment #1: Type: text/plain, Size: 2701 bytes --]

In an emacs -Q session, when you eval the below,

(message "'Hey'")

you get

’Hey’
"’Hey’"

Note the difference here:

This is what I get when I do "C-u C-x =" on the first single quote in the
message form:

             position: 206 of 208 (99%), column: 14
            character: ' (displayed as ') (codepoint 39, #o47, #x27)
    preferred charset: ascii (ASCII (ISO646 IRV))
code point in charset: 0x27
               script: latin
               syntax: ' which means: prefix
             category: .:Base, a:ASCII, l:Latin, r:Roman
             to input: type "C-x 8 RET 27" or "C-x 8 RET APOSTROPHE"
          buffer code: #x27
            file code: #x27 (encoded by coding system utf-8-unix)
              display: by this font (glyph code)
    xft:-unknown-DejaVu Sans
Mono-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1 (#x0A)

Character code properties: customize what to show
  name: APOSTROPHE
  old-name: APOSTROPHE-QUOTE
  general-category: Po (Punctuation, Other)
  decomposition: (39) (''')

There are text properties here:
  face                 font-lock-string-face
  fontified            nil


This is what I get when I do "C-u C-x =" on the first single quote in the
*Messages* buffer (C-h e):

             position: 67 of 338 (20%), column: 0
            character: ’ (displayed as ’) (codepoint 8217, #o20031, #x2019)
    preferred charset: unicode (Unicode (ISO10646))
code point in charset: 0x2019
               script: symbol
               syntax: . which means: punctuation
             category: .:Base, c:Chinese, h:Korean, j:Japanese
             to input: type "C-x 8 RET 2019" or "C-x 8 RET RIGHT SINGLE
QUOTATION MARK"
          buffer code: #xE2 #x80 #x99
            file code: #xE2 #x80 #x99 (encoded by coding system utf-8-unix)
              display: by this font (glyph code)
    xft:-unknown-DejaVu Sans
Mono-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1 (#x6C1)

Character code properties: customize what to show
  name: RIGHT SINGLE QUOTATION MARK
  old-name: SINGLE COMMA QUOTATION MARK
  general-category: Pf (Punctuation, Final quote)
  decomposition: (8217) ('’')

I believe emacs should not be converting all APOSTROPHE characters to RIGHT
SINGLE QUOTATION MARK characters. The displayed messages look just plain
weird. To fix that, I would then need to replace all 'MSG' (apostrophe MSG
apostrophe) type message displays to `MSG' (back quote MSG apostrophe),
which is not practical.

Or, is there a defcustom I need to set to prevent this character
translation to curvy quotes?


​Question:

Why is emacs converting all single

​

--
Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 9432 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#21588: 25.0.50: Single quotes becoming curvy quotes in message function
  2015-09-29 21:17 bug#21588: 25.0.50: Single quotes becoming curvy quotes in message function Kaushal Modi
@ 2015-09-29 21:32 ` Glenn Morris
  2015-09-29 22:54   ` Kaushal Modi
  2015-09-30 21:10 ` Drew Adams
  1 sibling, 1 reply; 9+ messages in thread
From: Glenn Morris @ 2015-09-29 21:32 UTC (permalink / raw)
  To: Kaushal Modi; +Cc: 21588


This has been discussed to death and is documented in NEWS.
I'm not sure what else there could be left to say.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#21588: 25.0.50: Single quotes becoming curvy quotes in message function
  2015-09-29 21:32 ` Glenn Morris
@ 2015-09-29 22:54   ` Kaushal Modi
  2015-09-30  1:05     ` Kaushal Modi
  0 siblings, 1 reply; 9+ messages in thread
From: Kaushal Modi @ 2015-09-29 22:54 UTC (permalink / raw)
  To: Glenn Morris, 21588-done

[-- Attachment #1: Type: text/plain, Size: 1318 bytes --]

Thanks for the reply.

Among all the noise about curved quotes, I missed out the discussion about
text-quoting-style. I started paying attention to that only recently when
Paul reverted curved quote stuff in the documentation.

I should have looked at NEWS; sorry about that.

I got my answer; I need to set text-quoting-style to 'straight.

For reference,

(progn
  (message "text-quoting-style = default")
  (let ((text-quoting-style))
    (message "'Hey'")
    (message "`Hey'"))
  (message "text-quoting-style = curve")
  (let ((text-quoting-style 'curve))
    (message "'Hey'")
    (message "`Hey'"))
  (message "text-quoting-style = straight")
  (let ((text-quoting-style 'straight))
    (message "'Hey'")
    (message "`Hey'"))
  (message "text-quoting-style = grave")
  (let ((text-quoting-style 'grave))
    (message "'Hey'")
    (message "`Hey'")))

gives


text-quoting-style = default
’Hey’
‘Hey’
text-quoting-style = curve
’Hey’
‘Hey’
text-quoting-style = straight
'Hey' [2 times]
text-quoting-style = grave
'Hey'
`Hey'






--
Kaushal Modi

On Tue, Sep 29, 2015 at 5:32 PM, Glenn Morris <rgm@gnu.org> wrote:

>
> This has been discussed to death and is documented in NEWS.
> I'm not sure what else there could be left to say.
>

[-- Attachment #2: Type: text/html, Size: 4267 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#21588: 25.0.50: Single quotes becoming curvy quotes in message function
  2015-09-29 22:54   ` Kaushal Modi
@ 2015-09-30  1:05     ` Kaushal Modi
  2015-09-30 22:40       ` Paul Eggert
  0 siblings, 1 reply; 9+ messages in thread
From: Kaushal Modi @ 2015-09-30  1:05 UTC (permalink / raw)
  To: Glenn Morris, 21588-done; +Cc: Alan Mackenzie, Paul Eggert, Stefan Monnier

[-- Attachment #1: Type: text/plain, Size: 2940 bytes --]

Hi Glenn,

Can you please re-open this bug if the below argument makes sense?

It doesn't feel right that (message "'Hey'") gets displayed as ’Hey’. The
display looks "buggy" with the default value of text-quoting-style. A user
shouldn't be perplexed with that kind of display in an emacs -Q session. It
just feels wrong.

It would make more sense to have the default value of text-quoting-style as
'grave. That way, (message "'Hey'") prints 'Hey' and (message "`Hey'")
prints `Hey'; there are not surprises.

If we really want the curved quotes rendering, 'Hey' should NOT be rendered
as ’Hey’. It might be fine to render `Hey' as ‘Hey’. But having the default
setup render a common string like 'Hey' with identical curved quotes just
looks wrong.


Please review and reconsider based on the output given by the elisp snippet
in my previous email.

IMO, we are missing a "middle ground" option where if text-quoting-style is
set to 'middle-ground, (message "'Hey'") would yield 'Hey' (preserved
apostrophes) and (message "`Hey'") would give ‘Hey’ (balanced curved
quotes).

If the middle-ground option is decided to not be added, then fine. But
please don't have the unbalanced curved quotes ’Hey’ as the default.

I ended up opening this bug report after having quite a few emacs packages
print stuff with unbalanced curved quotes and that hit my OCD bar.



--
Kaushal Modi

On Tue, Sep 29, 2015 at 6:54 PM, Kaushal Modi <kaushal.modi@gmail.com>
wrote:

> Thanks for the reply.
>
> Among all the noise about curved quotes, I missed out the discussion about
> text-quoting-style. I started paying attention to that only recently when
> Paul reverted curved quote stuff in the documentation.
>
> I should have looked at NEWS; sorry about that.
>
> I got my answer; I need to set text-quoting-style to 'straight.
>
> For reference,
>
> (progn
>   (message "text-quoting-style = default")
>   (let ((text-quoting-style))
>     (message "'Hey'")
>     (message "`Hey'"))
>   (message "text-quoting-style = curve")
>   (let ((text-quoting-style 'curve))
>     (message "'Hey'")
>     (message "`Hey'"))
>   (message "text-quoting-style = straight")
>   (let ((text-quoting-style 'straight))
>     (message "'Hey'")
>     (message "`Hey'"))
>   (message "text-quoting-style = grave")
>   (let ((text-quoting-style 'grave))
>     (message "'Hey'")
>     (message "`Hey'")))
>
> gives
>
>
> text-quoting-style = default
> ’Hey’
> ‘Hey’
> text-quoting-style = curve
> ’Hey’
> ‘Hey’
> text-quoting-style = straight
> 'Hey' [2 times]
> text-quoting-style = grave
> 'Hey'
> `Hey'
>
>
>
>
>
>
> --
> Kaushal Modi
>
> On Tue, Sep 29, 2015 at 5:32 PM, Glenn Morris <rgm@gnu.org> wrote:
>
>>
>> This has been discussed to death and is documented in NEWS.
>> I'm not sure what else there could be left to say.
>>
>
>

[-- Attachment #2: Type: text/html, Size: 8305 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#21588: 25.0.50: Single quotes becoming curvy quotes in message function
  2015-09-29 21:17 bug#21588: 25.0.50: Single quotes becoming curvy quotes in message function Kaushal Modi
  2015-09-29 21:32 ` Glenn Morris
@ 2015-09-30 21:10 ` Drew Adams
  1 sibling, 0 replies; 9+ messages in thread
From: Drew Adams @ 2015-09-30 21:10 UTC (permalink / raw)
  To: Kaushal Modi, 21588

[-- Attachment #1: Type: text/plain, Size: 137 bytes --]

Don't you mean "beautiful"?  ;-)

That's the whole idea behind this, AFAICT.

 

The displayed messages look just plain weird. 

[-- Attachment #2: Type: text/html, Size: 2437 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#21588: 25.0.50: Single quotes becoming curvy quotes in message function
  2015-09-30  1:05     ` Kaushal Modi
@ 2015-09-30 22:40       ` Paul Eggert
  2015-10-01  3:54         ` Kaushal Modi
  0 siblings, 1 reply; 9+ messages in thread
From: Paul Eggert @ 2015-09-30 22:40 UTC (permalink / raw)
  To: Kaushal Modi, Glenn Morris, 21588-done; +Cc: Alan Mackenzie, Stefan Monnier

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'").





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#21588: 25.0.50: Single quotes becoming curvy quotes in message function
  2015-09-30 22:40       ` Paul Eggert
@ 2015-10-01  3:54         ` Kaushal Modi
  2015-10-02  6:51           ` Paul Eggert
  0 siblings, 1 reply; 9+ messages in thread
From: Kaushal Modi @ 2015-10-01  3:54 UTC (permalink / raw)
  To: Paul Eggert; +Cc: 21588-done, Stefan Monnier, Alan Mackenzie

[-- Attachment #1: Type: text/plain, Size: 4221 bytes --]

> 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’.

Correct,
​
`text-quoting-style` was default (nil) and with that, (message "'Hey'") got
displayed as
​
​​
’Hey’.
Now I need to set
​
`text-quoting-style` to 'grave so that apostrophes stay apostrophes and
grave quotes remain grave quotes; no surprising quote conversions. I would
vote for this to be the default.

> I missed some instances and so some minor display glitches remain, but
they can be fixed as they turn up.

Thanks, I am having difficulty grepping for an expression that has both
single and double quotes. But as I find such cases, I will report them or
submit a patch.

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

That is good to know, thank you!

Summary:
- Can the default be changed to 'grave?
- For the message forms that I or anyone else writes in future, is it
correct if I says that you must always use `Hey' format instead of 'Hey'
format? If so, we need to update the documentation that warns the user to
use the correct style.

​Discussion:
​

As per "C-h i g (emacs) Quotation Marks" (excerpt below), we have
contradicting information.

One common way to quote is the typewriter convention, which quotes using
straight apostrophes 'like this' or double-quotes "like this".  Another
common way is the curved quote convention, which uses left and right
single or double quotation marks ‘like this’ or “like this”.  Typewriter
quotes are simple and portable; curved quotes are less ambiguous and
typically look nicer.

On one hand, the default text-quoting-style value of nil will render
(message 'like this') as
​​
’like this’.
On the other hand, it is mentioned that typewriter quotes are simple and
portable.

I agree
​that the typewriter
 quotes
​(straight quotes or apostrophes as I have been referring in my emails) ​
being simple and portable; the user does not need to think of whether to
enter ` or '. But then the default value of text-quoting-style as 'grave
makes more sense.
​ We would not want unwarned people using (message "'Hey'") in default
emacs sessions be faced with ​the
​
’Hey’
​ with unbalanced quotes.​


If we want to keep the default of text-quoting-style as nil (or 'curve),
more logic needs to be added that decides whether left curly quote or right
curly quote should be used, which might have some performance impact as we
then need to check what the previous character is, what the next character
is, etc to decide if the current apostrophe needs to be replaced with a
left or a right quote.

Here
​are
 few common cases that I can think of
:
​
​CASE 1: 'Hey' ->
​
​
‘Hey’
CASE 2: it's awesome -> ​
​it
’
​s awesome
CASE 3: my sisters' weddings -> ​
sisters
’
​ weddings
​CASE 4: He said 'It's awesome!' ->
He said ‘It’s awesome!’    (It should have rather been -- He said "It's
awesome!" (use of double quotes). But I am just putting here all the
apostrophe cases I can think of..)

Based on above cases,

​The apostrophe is replaced with left quote if,

(AND there's a non-space character after the apostrophe
        (OR the apostrophe is first character in the line
               there's white space before the apostrophe)) ​

The apostrophe is replaced with right quote if​,​​

​​
there's a non-space character
​before
 the apostrophe


OR, probably..

If ​
there's a non-space character
​before
 the apostrophe, replace it with right quote, else use left quote.

​I am by no means a literature or typography expert. So I am sure that the
above 4 cases are not enough to define the rules for left/right quotes. I
just wanted to emphasize that we need more intelligence in deciding which
quote to use if we want to keep the 'curly or nil as the default value of
text-quoting-style.​


--
Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 9968 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#21588: 25.0.50: Single quotes becoming curvy quotes in message function
  2015-10-01  3:54         ` Kaushal Modi
@ 2015-10-02  6:51           ` Paul Eggert
  2015-10-02 16:50             ` Kaushal Modi
  0 siblings, 1 reply; 9+ messages in thread
From: Paul Eggert @ 2015-10-02  6:51 UTC (permalink / raw)
  To: Kaushal Modi; +Cc: 21588-done, Stefan Monnier, Alan Mackenzie

[-- Attachment #1: Type: text/plain, Size: 2345 bytes --]

On 09/30/2015 08:54 PM, Kaushal Modi wrote:
 > - Can the default be changed to 'grave?

The GNU coding standards were changed a while ago to recommend against grave 
quoting in diagnostics and many GNU applications have already changed (e.g., 
coreutils, GCC).  Although Emacs has been one of the holdouts, now is as good a 
time as any to make the move.

> we need to update the documentation that warns the user to use the correct style.

Thanks, done in the attached patch, which I just installed in the master branch.

 > it is mentioned that typewriter quotes are simple and portable.

That discussion was intended to be about text files, so I added a phrase to that 
effect in the attached patch.  This should help resolve the seeming contradiction.

> If we want to keep the default of text-quoting-style as nil (or 'curve), more logic needs to be added that decides whether left curly quote or right curly quote should be used, which might have some performance impact as we then need to check what the previous character is, what the next character is, etc to decide if the current apostrophe needs to be replaced with a left or a right quote.

It’s not a significant performance impact.  It’s more a hassle of documenting a 
more-complex approach.  That is partly why I gave up on such an approach after 
implementing it, and went with the simpler approach that is in Emacs master now.

 > CASE 1: 'Hey' -> ‘Hey’
 > CASE 2: it's awesome -> it’s awesome
 > CASE 3: my sisters' weddings -> my sisters’ weddings
 > CASE 4: He said 'It's awesome!' -> He said ‘It’s awesome!’

‘message’ already does cases 2 and 3 that way, as well as the 2nd apostrophe in 
case 4.  The remaining cases are quite rare in Emacs diagnostics, as the Emacs 
style uses directed quotes when single-quoting.

> If there's a non-space character before the apostrophe, replace it with right quote, else use left quote.

That would mishandle common English phrases like “'60s pop culture” and “rock 
'n' roll”.  (These phrases don’t occur in Emacs diagnostics either, but as long 
as we’re being pedantic....)  Any heuristics will go awry sometimes so we need 
some way to override the heuristics; and once we have such an override, there is 
a real benefit to keeping the heuristics simple.

[-- Attachment #2: 0001-Fix-a-few-problems-with-directed-quotes.patch --]
[-- Type: text/plain, Size: 10067 bytes --]

From dd6346e00c0910b16f1bd195e5e94f6ac1d696ee Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu, 1 Oct 2015 21:42:53 -0700
Subject: [PATCH] Fix a few problems with directed quotes

This is in response to a problem report by Kaushal Modi in:
http://bugs.gnu.org/21588#25
* lisp/cedet/mode-local.el (describe-mode-local-overload):
* lisp/emacs-lisp/bytecomp.el (byte-compile-fix-header):
* lisp/info-xref.el (info-xref-check-all-custom):
* lisp/mail/emacsbug.el (report-emacs-bug-hook):
Prefer directed to undirected single quotes in diagnostics.
---
 doc/emacs/text.texi         |  4 ++--
 doc/lispref/control.texi    | 16 +++++++++++-----
 doc/lispref/display.texi    | 22 ++++++++++++++++------
 lisp/cedet/mode-local.el    |  4 ++--
 lisp/emacs-lisp/bytecomp.el |  2 +-
 lisp/emacs-lisp/elint.el    |  2 +-
 lisp/info-xref.el           |  2 +-
 lisp/mail/emacsbug.el       |  3 ++-
 lisp/mh-e/mh-e.el           |  4 ++--
 lisp/net/newst-treeview.el  |  2 +-
 10 files changed, 39 insertions(+), 22 deletions(-)

diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi
index 7f3afd7..bab660e 100644
--- a/doc/emacs/text.texi
+++ b/doc/emacs/text.texi
@@ -417,8 +417,8 @@ beginning of a line.
 using straight apostrophes @t{'like this'} or double-quotes @t{"like
 this"}.  Another common way is the curved quote convention, which uses
 left and right single or double quotation marks @t{‘like this’} or
-@t{“like this”}.  Typewriter quotes are simple and portable; curved
-quotes are less ambiguous and typically look nicer.
+@t{“like this”}.  In text files, typewriter quotes are simple and
+portable; curved quotes are less ambiguous and typically look nicer.
 
   Electric Quote mode makes it easier to type curved quotes.  As you
 type characters it optionally converts @t{`} to @t{‘}, @t{'} to @t{’},
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index fca16da..412903f 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -1,4 +1,4 @@
-@c -*-texinfo-*-
+@c -*- mode: texinfo; coding: utf-8 -*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
 @c Copyright (C) 1990-1995, 1998-1999, 2001-2015 Free Software
 @c Foundation, Inc.
@@ -1002,8 +1002,8 @@ These examples show typical uses of @code{error}:
 @end group
 
 @group
-(error "You have committed %d errors" 10)
-     @error{} You have committed 10 errors
+(error "Invalid name `%s'" "A%%B")
+     @error{} Invalid name ‘A%%B’
 @end group
 @end example
 
@@ -1011,10 +1011,16 @@ These examples show typical uses of @code{error}:
 error symbol @code{error}, and a list containing the string returned by
 @code{format-message}.
 
+In a format string containing single quotes, curved quotes @t{‘like
+this’} and grave quotes @t{`like this'} work better than straight
+quotes @t{'like this'}, as @code{error} typically formats every
+straight quote as a curved closing quote.
+
 @strong{Warning:} If you want to use your own string as an error message
 verbatim, don't just write @code{(error @var{string})}.  If @var{string}
-contains @samp{%}, it will be interpreted as a format specifier, with
-undesirable results.  Instead, use @code{(error "%s" @var{string})}.
+@var{string} contains @samp{%}, @samp{`}, or @samp{'} it may be
+reformatted, with undesirable results.  Instead, use @code{(error "%s"
+@var{string})}.
 @end defun
 
 @defun signal error-symbol data
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 452462a..ad248b1 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -1,4 +1,4 @@
-@c -*-texinfo-*-
+@c -*- mode: texinfo; coding: utf-8 -*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
 @c Copyright (C) 1990-1995, 1998-2015 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
@@ -254,6 +254,11 @@ properties, it is displayed with the specified faces (@pxref{Faces}).
 The string is also added to the @file{*Messages*} buffer, but without
 text properties (@pxref{Logging Messages}).
 
+In a format string containing single quotes, curved quotes @t{‘like
+this’} and grave quotes @t{`like this'} work better than straight
+quotes @t{'like this'}, as @code{message} typically formats every
+straight quote as a curved closing quote.
+
 In batch mode, the message is printed to the standard error stream,
 followed by a newline.
 
@@ -268,21 +273,26 @@ onto the screen immediately.
 
 @example
 @group
-(message "Minibuffer depth is %d."
-         (minibuffer-depth))
- @print{} Minibuffer depth is 0.
-@result{} "Minibuffer depth is 0."
+(message "Reverting `%s'..." (buffer-name))
+ @print{} Reverting ‘subr.el’...
+@result{} "Reverting ‘subr.el’..."
 @end group
 
 @group
 ---------- Echo Area ----------
-Minibuffer depth is 0.
+Reverting ‘subr.el’...
 ---------- Echo Area ----------
 @end group
 @end example
 
 To automatically display a message in the echo area or in a pop-buffer,
 depending on its size, use @code{display-message-or-buffer} (see below).
+
+@strong{Warning:} If you want to use your own string as a message
+verbatim, don't just write @code{(message @var{string})}.  If
+@var{string} contains @samp{%}, @samp{`}, or @samp{'} it may be
+reformatted, with undesirable results.  Instead, use @code{(message
+"%s" @var{string})}.
 @end defun
 
 @defvar inhibit-message
diff --git a/lisp/cedet/mode-local.el b/lisp/cedet/mode-local.el
index 8736a4f..b5995ff 100644
--- a/lisp/cedet/mode-local.el
+++ b/lisp/cedet/mode-local.el
@@ -644,9 +644,9 @@ SYMBOL is a function that can be overridden."
       (insert (overload-docstring-extension symbol) "\n\n")
       (insert (format-message "default function: `%s'\n" default))
       (if override
-	  (insert (format-message "\noverride in buffer '%s': `%s'\n"
+	  (insert (format-message "\noverride in buffer `%s': `%s'\n"
 				  describe-function-orig-buffer override))
-	(insert (format-message "\nno override in buffer '%s'\n"
+	(insert (format-message "\nno override in buffer `%s'\n"
 				describe-function-orig-buffer)))
 
       (mapatoms
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 8699af6..6f7ba33 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -2015,7 +2015,7 @@ and will be removed soon.  See (elisp)Backquote in the manual."))
        (format "     (string-lessp emacs-version \"%s\")\n" minimum-version)
        ;; Because the header must fit in a fixed width, we cannot
        ;; insert arbitrary-length file names (Bug#11585).
-       "     (error \"'%s' was compiled for "
+       "     (error \"`%s' was compiled for "
        (format "Emacs %s or later\" #$))\n\n" minimum-version))
       ;; Now compensate for any change in size, to make sure all
       ;; positions in the file remain valid.
diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el
index 86ac33c..64d65c0 100644
--- a/lisp/emacs-lisp/elint.el
+++ b/lisp/emacs-lisp/elint.el
@@ -520,7 +520,7 @@ Return nil if there are no more forms, t otherwise."
 	      ;;; 	(with-syntax-table emacs-lisp-mode-syntax-table
 	      ;;; 	  (elint-update-env))
 	      ;;; 	(setq env (elint-env-add-env env elint-buffer-env))))
-	      ;;(message "Elint processed (require '%s)" name))
+	      ;;(message "%s" (format "Elint processed (require '%s)" name))
 	  (error "%s.el not found in load-path" libname)))
     (error
      (message "Can't get variables from require'd library %s: %s"
diff --git a/lisp/info-xref.el b/lisp/info-xref.el
index 2b81efa..fcdf532 100644
--- a/lisp/info-xref.el
+++ b/lisp/info-xref.el
@@ -454,7 +454,7 @@ and can take a long time."
         (cond ((symbolp load)
                (condition-case cause (require load)
                  (error
-                  (info-xref-output "Symbol `%s': cannot require '%s: %s"
+                  (info-xref-output "Symbol `%s': cannot require `%s': %s"
                                     symbol load cause))))
               ;; skip if previously loaded
               ((assoc load load-history))
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index f54893f..8e28973 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -417,7 +417,8 @@ and send the mail again%s."
 					 (regexp-quote (system-name)))
 				 from))
 	       (not (yes-or-no-p
-		     (format "Is '%s' really your email address? " from)))
+		     (format-message "Is `%s' really your email address? "
+                                     from)))
 	       (error "Please edit the From address and try again"))))))
 
 
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 96fe7d7..c757920 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -2901,11 +2901,11 @@ This option contains the Unix command line which performs the
 actual printing for the \\[mh-print-msg] command. The string can
 contain one escape, \"%s\", which is replaced by the name of the
 folder and the message number and is useful for print job names.
-I use \"mpage -h'%s' -b Letter -H1of -mlrtb -P\" which produces a
+I use \"mpage -h\\='%s\\=' -b Letter -H1of -mlrtb -P\" which produces a
 nice header and adds a bit of margin so the text fits within my
 printer's margins.
 
-This options is not used by the commands \\[mh-ps-print-msg] or
+This option is not used by the commands \\[mh-ps-print-msg] or
 \\[mh-ps-print-msg-file]."
   :type 'string
   :group 'mh-show
diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el
index 4eef580..0c2df88 100644
--- a/lisp/net/newst-treeview.el
+++ b/lisp/net/newst-treeview.el
@@ -940,7 +940,7 @@ Optional arguments CHANGED-WIDGET and EVENT are ignored."
   "Return propertized copy of string TAG.
 Optional argument NUM-NEW is used for choosing face, other
 arguments NT-ID, FEED, and VFEED are added as properties."
-  ;;(message "newsticker--treeview-propertize-tag '%s' %s" feed nt-id)
+  ;;(message "newsticker--treeview-propertize-tag `%s' %s" feed nt-id)
   (let ((face 'newsticker-treeview-face)
         (map (make-sparse-keymap)))
     (if (and num-new (> num-new 0))
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#21588: 25.0.50: Single quotes becoming curvy quotes in message function
  2015-10-02  6:51           ` Paul Eggert
@ 2015-10-02 16:50             ` Kaushal Modi
  0 siblings, 0 replies; 9+ messages in thread
From: Kaushal Modi @ 2015-10-02 16:50 UTC (permalink / raw)
  To: Paul Eggert; +Cc: 21588-done, Stefan Monnier, Alan Mackenzie

[-- Attachment #1: Type: text/plain, Size: 4203 bytes --]

tl;dr: Thanks Paul, this is awesome!

---

> The GNU coding standards were changed a while ago to recommend against
grave quoting in diagnostics and many GNU applications have already changed
(e.g., coreutils, GCC).  Although Emacs has been one of the holdouts, now
is as good a time as any to make the move.

I was unaware of that. Thanks for letting me know. For future reference for
anyone else, you can learn more about this "C-h i g (standards) Quote
Characters".

> Thanks, done in the attached patch, which I just installed in the master
branch.

Thanks! For future reference for anyone else, these clarifications can be
viewed in the following info nodes:

- (elisp) Displaying Messages
- (elisp) Signaling Errors

> That discussion was intended to be about text files, so I added a phrase
to that effect in the attached patch.  This should help resolve the seeming
contradiction.

- (emacs) Quotation Marks

> Any heuristics will go awry sometimes so we need some way to override the
heuristics; and once we have such an override, there is a real benefit to
keeping the heuristics simple.

I agree to that argument.

Thanks for fixing the quotes in string formats in few other .el files.

In summary:
- I agree with you now that the current default value of text-quoting-style
is good.
- I will stick to that default and find places where the quoting needs to
be updated from 'Hey' to `Hey'.
- I will submit patches/pull requests wherever I find such instances within
emacs or in external packages.

Thank you for all your time and effort in making this clear and fixing up
the documentation and .el files.



--
Kaushal Modi

On Fri, Oct 2, 2015 at 2:51 AM, Paul Eggert <eggert@cs.ucla.edu> wrote:

> On 09/30/2015 08:54 PM, Kaushal Modi wrote:
> > - Can the default be changed to 'grave?
>
> The GNU coding standards were changed a while ago to recommend against
> grave quoting in diagnostics and many GNU applications have already changed
> (e.g., coreutils, GCC).  Although Emacs has been one of the holdouts, now
> is as good a time as any to make the move.
>
> we need to update the documentation that warns the user to use the correct
>> style.
>>
>
> Thanks, done in the attached patch, which I just installed in the master
> branch.
>
> > it is mentioned that typewriter quotes are simple and portable.
>
> That discussion was intended to be about text files, so I added a phrase
> to that effect in the attached patch.  This should help resolve the seeming
> contradiction.
>
> If we want to keep the default of text-quoting-style as nil (or 'curve),
>> more logic needs to be added that decides whether left curly quote or right
>> curly quote should be used, which might have some performance impact as we
>> then need to check what the previous character is, what the next character
>> is, etc to decide if the current apostrophe needs to be replaced with a
>> left or a right quote.
>>
>
> It’s not a significant performance impact.  It’s more a hassle of
> documenting a more-complex approach.  That is partly why I gave up on such
> an approach after implementing it, and went with the simpler approach that
> is in Emacs master now.
>
> > CASE 1: 'Hey' -> ‘Hey’
> > CASE 2: it's awesome -> it’s awesome
> > CASE 3: my sisters' weddings -> my sisters’ weddings
> > CASE 4: He said 'It's awesome!' -> He said ‘It’s awesome!’
>
> ‘message’ already does cases 2 and 3 that way, as well as the 2nd
> apostrophe in case 4.  The remaining cases are quite rare in Emacs
> diagnostics, as the Emacs style uses directed quotes when single-quoting.
>
> If there's a non-space character before the apostrophe, replace it with
>> right quote, else use left quote.
>>
>
> That would mishandle common English phrases like “'60s pop culture” and
> “rock 'n' roll”.  (These phrases don’t occur in Emacs diagnostics either,
> but as long as we’re being pedantic....)  Any heuristics will go awry
> sometimes so we need some way to override the heuristics; and once we have
> such an override, there is a real benefit to keeping the heuristics simple.
>

[-- Attachment #2: Type: text/html, Size: 9313 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-10-02 16:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-29 21:17 bug#21588: 25.0.50: Single quotes becoming curvy quotes in message function Kaushal Modi
2015-09-29 21:32 ` Glenn Morris
2015-09-29 22:54   ` Kaushal Modi
2015-09-30  1:05     ` Kaushal Modi
2015-09-30 22:40       ` Paul Eggert
2015-10-01  3:54         ` Kaushal Modi
2015-10-02  6:51           ` Paul Eggert
2015-10-02 16:50             ` Kaushal Modi
2015-09-30 21:10 ` Drew Adams

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.