all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 21588-done@debbugs.gnu.org,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	Alan Mackenzie <acm@muc.de>
Subject: bug#21588: 25.0.50: Single quotes becoming curvy quotes in message function
Date: Wed, 30 Sep 2015 23:54:02 -0400	[thread overview]
Message-ID: <CAFyQvY0+DibmZr56iGTTEO3fJ8UZezSmQauT4qQECCFarLeX-A@mail.gmail.com> (raw)
In-Reply-To: <560C64F5.3060007@cs.ucla.edu>

[-- 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 --]

  reply	other threads:[~2015-10-01  3:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2015-10-02  6:51           ` Paul Eggert
2015-10-02 16:50             ` Kaushal Modi
2015-09-30 21:10 ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFyQvY0+DibmZr56iGTTEO3fJ8UZezSmQauT4qQECCFarLeX-A@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=21588-done@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=eggert@cs.ucla.edu \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.