unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* how to turn off automatic curly-quoting?
@ 2015-08-02 17:18 Drew Adams
  2015-08-02 19:25 ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: Drew Adams @ 2015-08-02 17:18 UTC (permalink / raw)
  To: emacs-devel

I thought that the recent move to using curly quotes was
going to be optional for users.  But so far, it seems to
be hard-coded.  E.g., in `describe-function'.

I looked at NEWS, but I found only advertisements for the
touted new-&-improved behavior - nothing about how to get
back the classic one.

Oh, I did find `electric-quote-mode', which (sensibly) is
turned off by default.  But that apparently makes no
difference - I still see curly quotes substituted for
the longstanding, sane behavior.

Please tell us how a user can turn off this purportedly
optional curly-quote behavior - everywhere.

Oh, and please put this info in the Emacs manual, as well
as NEWS.  The only index entries for "curly quote" tell
you how to *insert* them, using (1) `C-x 8 RET' (`Inserting
Text') and (2) `electric-quote-mode' (`Quotation Marks').



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

* Re: how to turn off automatic curly-quoting?
  2015-08-02 17:18 Drew Adams
@ 2015-08-02 19:25 ` Eli Zaretskii
  2015-08-02 19:46   ` Paul Eggert
  0 siblings, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2015-08-02 19:25 UTC (permalink / raw)
  To: Drew Adams; +Cc: emacs-devel

> Date: Sun, 2 Aug 2015 10:18:45 -0700 (PDT)
> From: Drew Adams <drew.adams@oracle.com>
> 
> I thought that the recent move to using curly quotes was
> going to be optional for users.  But so far, it seems to
> be hard-coded.  E.g., in `describe-function'.

Please be more specific about what do you think is hard-coded in
'describe-function'.  It's hard to respond to such a vague
request/claim.

> Please tell us how a user can turn off this purportedly
> optional curly-quote behavior - everywhere.

Again, "everywhere" is too broad.  My best guess is that you want to
customize 'help-quote-translation', but please verify that it is what
you want.  If it is, you will find it mentioned in NEWS, so if that
entry needs to be amended, please tell what is missing from it.

> Oh, and please put this info in the Emacs manual, as well
> as NEWS.

The above variable is in the ELisp manual already.

In any case, contents of manuals is not finalized until Emacs is in
pretest.  (Volunteers to do it earlier by looking up undocumented NEWS
entries are welcome, of course.)



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

* Re: how to turn off automatic curly-quoting?
  2015-08-02 19:25 ` Eli Zaretskii
@ 2015-08-02 19:46   ` Paul Eggert
  2015-08-02 20:11     ` Drew Adams
  0 siblings, 1 reply; 22+ messages in thread
From: Paul Eggert @ 2015-08-02 19:46 UTC (permalink / raw)
  To: emacs-devel

Eli Zaretskii wrote:
> The above variable is in the ELisp manual already.

Yes, I expect Drew searched for "curly quote" whereas the manual and/or NEWS 
said "curved quote".  I just now added "curly quote" as an alias in both places.



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

* RE: how to turn off automatic curly-quoting?
  2015-08-02 19:46   ` Paul Eggert
@ 2015-08-02 20:11     ` Drew Adams
  2015-08-02 20:26       ` Paul Eggert
  0 siblings, 1 reply; 22+ messages in thread
From: Drew Adams @ 2015-08-02 20:11 UTC (permalink / raw)
  To: Paul Eggert, emacs-devel

> > The above variable is in the ELisp manual already.
> 
> Yes, I expect Drew searched for "curly quote" whereas the manual
> and/or NEWS said "curved quote".  I just now added "curly quote"
> as an alias in both places.

In the build I used, from 7/03, 
GNU Emacs 25.0.50.1 (i686-pc-mingw32) of 2015-07-03 on LEG570
all of these index entries are present:

* curly quotes:          Inserting Text.      (line  59)
* curly quotes <1>:      Quotation Marks.     (line   6)
* curved quotes:         Inserting Text.      (line  59)
* curved quotes <1>:     Quotation Marks.     (line   6)

So I wonder what you "just now added".




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

* Re: how to turn off automatic curly-quoting?
  2015-08-02 20:11     ` Drew Adams
@ 2015-08-02 20:26       ` Paul Eggert
  0 siblings, 0 replies; 22+ messages in thread
From: Paul Eggert @ 2015-08-02 20:26 UTC (permalink / raw)
  To: Drew Adams, emacs-devel

Drew Adams wrote:
> I wonder what you "just now added".

See git commit d2c4309d46529bac656f332677d2c5e199577845.  It's dated today so 
you won't see it in a July 3 build.



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

* RE: how to turn off automatic curly-quoting?
       [not found] ` <<83fv41v6fh.fsf@gnu.org>
@ 2015-08-02 21:47   ` Drew Adams
  2015-08-02 23:06     ` Paul Eggert
       [not found]   ` <<5681a732-5741-4f56-b3d7-cb1edb739d32@default>
  1 sibling, 1 reply; 22+ messages in thread
From: Drew Adams @ 2015-08-02 21:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

> > I thought that the recent move to using curly quotes was
> > going to be optional for users.  But so far, it seems to
> > be hard-coded.  E.g., in `describe-function'.
> 
> Please be more specific about what do you think is hard-coded
> in 'describe-function'.  It's hard to respond to such a vague
> request/claim.

Below, please.

> > Please tell us how a user can turn off this purportedly
> > optional curly-quote behavior - everywhere.
> 
> Again, "everywhere" is too broad.

Not for me, it's not.  I'm one user who wants to turn it off 
_everywhere_, just as it was before this change.  I would
like a user option that restores the "Classic Emacs" behavior
of `...' instead of '...' that we've enjoyed for 40 years.

> My best guess is that you want to customize
> 'help-quote-translation', but please verify that it is
> what you want.

It seems to be.  Thanks.  But you tell me.  Does it restore
the behavior as it was - everywhere?  IOW, does it effectively
remove this feature of replacing `...' by curly-quoting
everywhere that the replacement is done?  If it does, then
great. If it does not, then not so great.

> If it is, you will find it mentioned in NEWS,

I see it now.  I saw the manual updated for curly quoting,
but with no mention of this option.  And grepping Lisp
shows it only in cus-edit.el (not relevant).  Its handling
is evidently only in C code (I don't have that code locally).

> so if that entry needs to be amended, please tell what
> is missing from it.

The main problem with the option is its default value.
This feature should be opt-in, not opt-out, IMHO.
Please give us "Classic Emacs" by default, and let those
who are offended by `...' and want something fancier opt
for that by customizing the option.

Please consider also changing the option values so that
you can use `M-x set-variable` in a reasonable way (i.e.,
without needing to know that ?` is 96 etc. - you cannot
type ?` at the prompt).  Character values are not helpful
in such a context.

Also, why is the name about "translation"?  Shouldn't
this option just be about what style is used for quoting
Emacs terms?  I don't see it as only about "help", though
I suppose you can interpret that term as broadly as you
like.  It is about how Emacs talks about itself.  Is that
just "help", or is it something more?

Anyway, "help" is not the biggest problem with the name.
"Translation" speaks perhaps to the implementation changes
made recently, but it is not a user-facing way to describe
what the option controls.

I would sooner imagine "style" or "format" or some such
term in the name than "translation".  The user should not
need to think that s?he is translating something or that
s?he is asking Emacs to translate something.  That
presupposes that there is something original that can be
translated.  That's what the new code does, perhaps
(translates a default format to another one).  But that's
not how a user should need to think about it.

[Another problem (but it will continue to be a problem,
I guess) is that in some fonts it can be difficult to tell
what the different quote chars are, when reading about
the possible option values.]

> > Oh, and please put this info in the Emacs manual, as well
> > as NEWS.
> 
> The above variable is in the ELisp manual already.

It is not in the most recent Windows binary I have (from
7/03).  If it was added since then, great; thanks.

Hopefully it is also mentioned (e.g. cross-referenced) each
time the manual mentions such quoting, and in particular in
the two nodes where curly quotes are mentioned.

> In any case, contents of manuals is not finalized until
> Emacs is in pretest.

Yes, I know.  What I found was that the feature of curly
quoting in this way was documented (`electric-quote-mode',
node `Quotation Marks'), but there was (so far) nothing
about `help-quote-translation'.

To me, how to turn it off is at least as important as
advertising the new feature.  Anyway, even if it was only
a late arrival or an afterthought, I'm glad the option was
added (and documented).

As for the question about hard-coding curly quotes in
help: I was obviously mistaken.

It turns out that the many printings of ' and ', are each
wrapped in `substitute-command-keys', which (coded in C)
is presumably where these chars are in fact *not* printed
if `help-quote-translation' has a sane value.  None of
this was obvious to me from examining the Lisp code.

FWIW: The doc string of `substitute-command-keys' is
not too bad.  But I find it confusing that it refers
to "left and right quote characters" as something other
than the "quotation mark" character referred to in the
doc of `help-quote-translation'.

IOW, please try to more clearly distinguish the notion of
abstract, configurable left and right quote characters
(and use the qualifier "single") from the concrete left
and right single quotation mark chars (aka curly quotes).
Otherwise this becomes difficult to read, if not altogether
unintelligible.

Paul & company would presumably be the first to say that
` and ' are not "left and right quote characters".  Some
better way of talking about this needs to be found, IMO.



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

* Re: how to turn off automatic curly-quoting?
  2015-08-02 21:47   ` how to turn off automatic curly-quoting? Drew Adams
@ 2015-08-02 23:06     ` Paul Eggert
  2015-08-02 23:57       ` Artur Malabarba
                         ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Paul Eggert @ 2015-08-02 23:06 UTC (permalink / raw)
  To: Drew Adams; +Cc: emacs-devel

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

Drew Adams wrote:

> Does it restore the behavior as it was - everywhere?

Yes and no.  It does restore behavior for doc strings in traditional format that 
uses grave accent and apostrophe to quote.  However, it does transliterate 
curved quotes in doc strings to grave accent and apostrophe, which is new. 
Presumably any such doc strings are recent introductions so this caveat 
shouldn't affect traditional usage.

> This feature should be opt-in, not opt-out, IMHO.

No, let's enable it in environments where it seems to work.  That's what other 
GNU projects do (GCC, coreutils, etc.).  The new feature is disabled by default 
in traditional environments that can't display curved quotes; that should be 
good enough.

> Please consider also changing the option values so that
> you can use `M-x set-variable` in a reasonable way (i.e.,
> without needing to know that ?` is 96 etc. - you cannot
> type ?` at the prompt).  Character values are not helpful
> in such a context.

Alan made a similar suggestion a while ago, and it's easy enough to implement. 
Done in the attached patch, which I pushed just now.

> Also, why is the name about "translation"?  Shouldn't
> this option just be about what style is used for quoting
> Emacs terms?

That point has also been made.  I changed the name to 'text-quoting-style' in 
the attached patch.  Although it's just a name, it does have uses outside help 
buffers so at least the 'help' part of the name was misleading.  Other Emacs 
packages (e.g., coreutils) use "quoting-style" but that's too generic for Emacs 
which has other interpretation of the word "quoting".

> FWIW: The doc string of `substitute-command-keys' is
> not too bad.  But I find it confusing that it refers
> to "left and right quote characters" as something other
> than the "quotation mark" character referred to in the
> doc of `help-quote-translation'.

I don't see the confusion, quite possibly because I'm too close to the code. 
Suggestions for improved wording would be welcome.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Redo-text-quoting-style-variable.patch --]
[-- Type: text/x-diff; name="0001-Redo-text-quoting-style-variable.patch", Size: 8925 bytes --]

From 416d7fd2d863935b7ef4ed349f6c72f14e73dd4d Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sun, 2 Aug 2015 15:58:02 -0700
Subject: [PATCH] Redo text-quoting-style variable

Rename help-quote-translation to text-quoting-style,
and use symbols rather than characters as values.
This follows suggestions along these lines by Alan Mackenzie in:
http://lists.gnu.org/archive/html/emacs-devel/2015-06/msg00343.html
and by Drew Adams in:
http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00048.html
* doc/lispref/help.texi (Keys in Documentation)
* etc/NEWS:
* lisp/cus-start.el (standard):
* src/doc.c (Fsubstitute_command_keys, syms_of_doc):
Document and/or implement the new behavior instead of the old.
(syms_of_doc): New symbols 'grave' and 'straight'.
---
 doc/lispref/help.texi | 16 ++++++++--------
 etc/NEWS              | 20 ++++++++++----------
 lisp/cus-start.el     | 18 ++++++++++--------
 src/doc.c             | 27 ++++++++++++++-------------
 4 files changed, 42 insertions(+), 39 deletions(-)

diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi
index 779a0d5..ca8ae3f 100644
--- a/doc/lispref/help.texi
+++ b/doc/lispref/help.texi
@@ -347,18 +347,18 @@ and @samp{\=\=} puts @samp{\=} into the output.
 @strong{Please note:} Each @samp{\} must be doubled when written in a
 string in Emacs Lisp.
 
-@defvar help-quote-translation
+@defvar text-quoting-style
 @cindex curved quotes
 @cindex curly quotes
 The value of this variable specifies the style
 @code{substitute-command-keys} uses when generating left and right
-quotes.  If the variable's value is @code{?‘} (U+2018 LEFT SINGLE
-QUOTATION MARK), the style is @t{‘like this’} with curved single
-quotes.  If the value is @code{?'} (apostrophe), the style is @t{'like
-this'} with apostrophes.  If the value is @code{?`} (grave accent),
-the style is @t{`like this'} with grave accent and apostrophe.  The
-default value @code{nil} means to use curved single quotes if
-displayable, and grave accent and apostrophe otherwise.
+quotes.  If the variable's value is @code{curve}, the style is
+@t{‘like this’} with curved single quotes.  If the value is
+@code{straight}, the style is @t{'like this'} with straight
+apostrophes.  If the value is @code{grave}, the style is @t{`like
+this'} with grave accent and apostrophe.  The default value @code{nil}
+acts like @code{curve} if curved single quotes are displayable, and
+like @code{grave} otherwise.
 @end defvar
 
 @defun substitute-command-keys string
diff --git a/etc/NEWS b/etc/NEWS
index 85df716..e384d17 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -889,14 +889,14 @@ in languages like German where downcasing rules depend on grammar.
 +++
 ** substitute-command-keys now replaces quotes.
 That is, it converts documentation strings' quoting style as per the
-value of the new custom variable ‘help-quote-translation’: ?‘ means
-use curved quotes (also known as curly quotes) ‘like this’, ?' means
-use apostrophes 'like this', ?` means use grave accent and apostrophe
-`like this', and nil (default) means use curved quotes if displayable
-and grave accent and apostrophe otherwise.  Doc strings in source code
-can use either curved quotes or grave accent and apostrophe.  As
-before, isolated apostrophes and characters preceded by \= are output
-as-is.
+value of the new custom variable ‘text-quoting-style’: ‘curve’ means
+use curved quotes (also known as curly quotes) ‘like this’, ‘straight’
+means use straight apostrophes 'like this', ‘grave’ means use grave
+accent and apostrophe `like this', and nil (default) means use curved
+quotes if displayable and grave accent and apostrophe otherwise.  Doc
+strings in source code can use either curved quotes or grave accent
+and apostrophe.  As before, isolated apostrophes and characters
+preceded by \= are output as-is.
 
 +++
 ** The character classes [:alpha:] and [:alnum:] in regular expressions
@@ -1017,8 +1017,8 @@ In the new Electric Quote mode, you can enter curved single quotes
 into documentation by typing ` and '.  Outside Electric Quote mode,
 you can enter them by typing ‘C-x 8 [’ and ‘C-x 8 ]’, or (if your Alt
 key works) by typing ‘A-[’ and ‘A-]’.  As described above under
-‘help-quote-translation’, the user can specify how to display doc
-string quotes.
+‘text-quoting-style’, the user can specify how to display doc string
+quotes.
 
 +++
 ** show-help-function's arg is converted via substitute-command-keys
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 69dbf0d..7a37198 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -221,14 +221,16 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
 	     (no-redraw-on-reenter display boolean)
 
 	     ;; doc.c
-	     (help-quote-translation help
-				     (choice
-				      (character :tag "Quote with curved quotes"
-                                                 :value ?‘)
-				      (character :tag "Quote 'like this'" :value ?\')
-				      (character :tag "Quote `like this'" :value ?\`)
-				      (const :tag "Quote with curved quotes if displayable, 'like this' otherwise" nil))
-				     "25.1")
+	     (text-quoting-style
+              help
+              (choice
+               (const :tag "Quote with curved single quotes" curve)
+               (const :tag "Quote with straight apostrophes 'like this'"
+                      straight)
+               (const :tag "Quote with grave accent and apostrophe `like this'"
+                      grave)
+               (const :tag "Use curved quotes if displayable, grave accent and apostrophe otherwise" nil))
+              "25.1")
              ;; dosfns.c
 	     (dos-display-scancodes display boolean)
 	     (dos-hyper-key keyboard integer)
diff --git a/src/doc.c b/src/doc.c
index 78a7815..36619e1 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -715,7 +715,7 @@ as the keymap for future \\=\\[COMMAND] substrings.
 Each \\=‘ and \\=’ are replaced by left and right quote.  Each \\=` is
 replaced by left quote, and each ' preceded by \\=` and without
 intervening ' is replaced by right quote.  Left and right quote
-characters are specified by ‘help-quote-translation’.
+characters are specified by ‘text-quoting-style’.
 
 \\=\\= quotes the following character and is discarded; thus,
 \\=\\=\\=\\= puts \\=\\= into the output, \\=\\=\\=\\[ puts \\=\\[ into the output, and
@@ -751,11 +751,11 @@ Otherwise, return a new string.  */)
   GCPRO4 (string, tem, keymap, name);
 
   enum { unicode, grave_accent, apostrophe } quote_translation = unicode;
-  if (EQ (Vhelp_quote_translation, make_number ('`')))
+  if (EQ (Vtext_quoting_style, Qgrave))
     quote_translation = grave_accent;
-  else if (EQ (Vhelp_quote_translation, make_number ('\'')))
+  else if (EQ (Vtext_quoting_style, Qstraight))
     quote_translation = apostrophe;
-  else if (NILP (Vhelp_quote_translation)
+  else if (NILP (Vtext_quoting_style)
 	   && DISP_TABLE_P (Vstandard_display_table))
     {
       Lisp_Object dv = DISP_CHAR_VECTOR (XCHAR_TABLE (Vstandard_display_table),
@@ -1024,6 +1024,8 @@ void
 syms_of_doc (void)
 {
   DEFSYM (Qfunction_documentation, "function-documentation");
+  DEFSYM (Qgrave, "grave");
+  DEFSYM (Qstraight, "straight");
 
   DEFVAR_LISP ("internal-doc-file-name", Vdoc_file_name,
 	       doc: /* Name of file containing documentation strings of built-in symbols.  */);
@@ -1033,15 +1035,14 @@ syms_of_doc (void)
                doc: /* A list of files used to build this Emacs binary.  */);
   Vbuild_files = Qnil;
 
-  DEFVAR_LISP ("help-quote-translation", Vhelp_quote_translation,
-               doc: /* Style to use for single quotes in help.
-The value is a left single quote character of some style.
-Quote \\=‘like this\\=’ if the value is ?\\=‘ (left single quotation mark).
-Quote 'like this' if the value is ?' (apostrophe).
-Quote \\=`like this' if the value is ?\\=` (grave accent).
-The default value is nil, which means quote with left single quotation mark
-if displayable, and with grave accent otherwise.  */);
-  Vhelp_quote_translation = Qnil;
+  DEFVAR_LISP ("text-quoting-style", Vtext_quoting_style,
+               doc: /* Style to use for single quotes when generating text.
+‘curve’ means quote with curved single quotes \\=‘like this\\=’.
+‘straight’ means quote with straight apostrophes 'like this'.
+‘grave’ means quote with grave accent and apostrophe \\=`like this'.
+The default value nil acts like ‘curve’ if curved single quotes are
+displayable, and like ‘grave’ otherwise.  */);
+  Vtext_quoting_style = Qnil;
 
   defsubr (&Sdocumentation);
   defsubr (&Sdocumentation_property);
-- 
2.1.0


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

* Re: how to turn off automatic curly-quoting?
  2015-08-02 23:06     ` Paul Eggert
@ 2015-08-02 23:57       ` Artur Malabarba
  2015-08-03  0:11         ` Paul Eggert
  2015-08-03  0:02       ` Drew Adams
  2015-08-03 15:13       ` Eli Zaretskii
  2 siblings, 1 reply; 22+ messages in thread
From: Artur Malabarba @ 2015-08-02 23:57 UTC (permalink / raw)
  To: Paul Eggert; +Cc: Drew Adams, emacs-devel

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

>> This feature should be opt-in, not opt-out, IMHO.
>
> No, let's enable it in environments where it seems to work.

Yes, please.

>> Please consider also changing the option values so that
>> you can use `M-x set-variable` in a reasonable way (i.e.,
>> without needing to know that ?` is 96 etc. - you cannot
>> type ?` at the prompt).  Character values are not helpful
>> in such a context.
>
>
> Alan made a similar suggestion a while ago, and it's easy enough to
implement. Done in the attached patch, which I pushed just now.

The options look good.
Did I misread the patch, or is there no value for "just display the quote
verbatim, never translating"?

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

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

* RE: how to turn off automatic curly-quoting?
  2015-08-02 23:06     ` Paul Eggert
  2015-08-02 23:57       ` Artur Malabarba
@ 2015-08-03  0:02       ` Drew Adams
  2015-08-03  0:40         ` Paul Eggert
  2015-08-03 15:13       ` Eli Zaretskii
  2 siblings, 1 reply; 22+ messages in thread
From: Drew Adams @ 2015-08-03  0:02 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

> Yes and no.  It does restore behavior for doc strings in traditional
> format that uses grave accent and apostrophe to quote.  However, it
> does transliterate curved quotes in doc strings to grave accent and
> apostrophe, which is new. Presumably any such doc strings are recent 
> introductions so this caveat shouldn't affect traditional usage.

That's OK, if limited to such contexts.  What you are saying I guess
is that there are now (in Emacs itself? or there just could be, in
3rd-party code?) some doc strings that hard-code ‘...’ instead of
`...'.  That's too bad.

(BTW, those are curly quotes before "instead of", but I see now
that my mails, when received, have had each curly quote changed
to an apostrophe: ‘...’ has been changed to '...'.  Dunno why that
is.  It has nothing to do with Emacs or the mailing list: a test
mail just to myself shows the same problem.  I guess it has
something to do with my mail client when using plain-text messages.
That makes it hard to communicate on this subject - sorry.)

> > This feature should be opt-in, not opt-out, IMHO.
> 
> No, let's enable it in environments where it seems to work.  That's
> what other GNU projects do (GCC, coreutils, etc.).  The new feature
> is disabled by default in traditional environments that can't display
> curved quotes; that should be good enough.

That is not the case for Emacs.  It might be true in some cases
that we decide to turn on some new option by default.  But that
is not the case as a rule.

And in fact my impression is that the opposite is generally the
case: new features (especially this kind of thing) are opt-in.

It took us decades to convince RMS to turn on `transient-mark-mode'
by default.  It was considered a "new feature" that might interfere
with what Emacs users were used to.  We still haven't turned on
`delete-selection-mode' by default - even though the world outside
has been using something close to `transient-mark-mode' +
`delete-selection-mode' for decades.

So much for the argument that we need to turn this on by default
because it is what the world outside does.  Or that this is some
kind of a GNU rule.

Font lock is another example.  Decades went by before we turned
it on by default.  Time enough to get lots of user experience
and feedback.

You are in a giant hurry to expose your shiny new feature.
Emacs should not be in a hurry for this.

> > Please consider also changing the option values so that
> > you can use `M-x set-variable` in a reasonable way (i.e.,
> > without needing to know that ?` is 96 etc. - you cannot
> > type ?` at the prompt).  Character values are not helpful
> > in such a context.
> 
> Alan made a similar suggestion a while ago, and it's easy enough to
> implement.  Done in the attached patch, which I pushed just now.

Thx.

> > Also, why is the name about "translation"?  Shouldn't
> > this option just be about what style is used for quoting
> > Emacs terms?
> 
> That point has also been made.  I changed the name to
> 'text-quoting-style' in the attached patch.

That name is OK, I guess.  Though this is not at all about
quoting text.  That is the effect, since you are using quote
marks.  But this is not text quoting, as I've explained
previously.

At any rate, 'text-quoting-style' is better than
`help-quote-translation'.

> ... use "quoting-style" but that's too generic for
> Emacs which has other interpretation of the word "quoting".

Exactly.  And this is not even text quoting.  It is mention
instead of use, so in logic it is considered a kind of
quotation, but it is not the ordinary quoting of text
fragments, which is what quote marks are used for.

This is mention ("quoting") of Emacs-Lisp sexps, keys, and
such.  It makes such things stand out the way other info
systems might use highlighting or a different font (typically
monospaced, for code fragments).

> > FWIW: The doc string of `substitute-command-keys' is
> > not too bad.  But I find it confusing that it refers
> > to "left and right quote characters" as something other
> > than the "quotation mark" character referred to in the
> > doc of `help-quote-translation'.
> 
> I don't see the confusion, quite possibly because I'm too
> close to the code.

You can't have "left quote character" mean both a Unicode
left quote character and, in effect, a character variable
whose value can be any of several characters, some of which
are not, by name, quote chars.  That's the point.



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

* Re: how to turn off automatic curly-quoting?
  2015-08-02 23:57       ` Artur Malabarba
@ 2015-08-03  0:11         ` Paul Eggert
  0 siblings, 0 replies; 22+ messages in thread
From: Paul Eggert @ 2015-08-03  0:11 UTC (permalink / raw)
  To: bruce.connor.am; +Cc: Drew Adams, emacs-devel

Artur Malabarba wrote:
> Did I misread the patch, or is there no value for "just display the quote
> verbatim, never translating"?

That's correct.  I didn't see a realistic use case for such an option.

Possibly there could be an option to disable substitute-command-keys entirely 
(turning it into a no-op) for some oddball kinds of debugging, but the utility 
of even that seemed relatively small as well.  It would be like having a GCC 
option to disable escape processing in all C strings.



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

* Re: how to turn off automatic curly-quoting?
  2015-08-03  0:02       ` Drew Adams
@ 2015-08-03  0:40         ` Paul Eggert
  2015-08-03  2:28           ` Drew Adams
  0 siblings, 1 reply; 22+ messages in thread
From: Paul Eggert @ 2015-08-03  0:40 UTC (permalink / raw)
  To: Drew Adams; +Cc: emacs-devel

Drew Adams wrote:
> You can't have "left quote character" mean both a Unicode
> left quote character and, in effect, a character variable
> whose value can be any of several characters, some of which
> are not, by name, quote chars.

It means the latter.  The former wouldn't make any sense, as there is no single 
Unicode "left quote character".



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

* RE: how to turn off automatic curly-quoting?
  2015-08-03  0:40         ` Paul Eggert
@ 2015-08-03  2:28           ` Drew Adams
  2015-08-03  5:11             ` Paul Eggert
  0 siblings, 1 reply; 22+ messages in thread
From: Drew Adams @ 2015-08-03  2:28 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

> > You can't have "left quote character" mean both a Unicode
> > left quote character and, in effect, a character variable
> > whose value can be any of several characters, some of which
> > are not, by name, quote chars.
> 
> It means the latter.  The former wouldn't make any sense, as there is no
> single Unicode "left quote character".

You are playing word games.  You are the first to say that
` and ' are not, in any sense, quote characters.  There may
be multiple Unicode left quote characters, but ` is not
one of them, just as ' is not one of the Unicode right quote
chars.

The description is not clear.  That's the point.



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

* Re: how to turn off automatic curly-quoting?
  2015-08-03  2:28           ` Drew Adams
@ 2015-08-03  5:11             ` Paul Eggert
  0 siblings, 0 replies; 22+ messages in thread
From: Paul Eggert @ 2015-08-03  5:11 UTC (permalink / raw)
  To: Drew Adams; +Cc: emacs-devel

Drew Adams wrote:

> The description is not clear.

Please feel free to propose clearer wording.




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

* Re: how to turn off automatic curly-quoting?
  2015-08-02 23:06     ` Paul Eggert
  2015-08-02 23:57       ` Artur Malabarba
  2015-08-03  0:02       ` Drew Adams
@ 2015-08-03 15:13       ` Eli Zaretskii
  2015-08-03 16:49         ` Paul Eggert
  2 siblings, 1 reply; 22+ messages in thread
From: Eli Zaretskii @ 2015-08-03 15:13 UTC (permalink / raw)
  To: Paul Eggert; +Cc: drew.adams, emacs-devel

> Date: Sun, 02 Aug 2015 16:06:57 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
> Cc: emacs-devel@gnu.org
> 
> > Also, why is the name about "translation"?  Shouldn't
> > this option just be about what style is used for quoting
> > Emacs terms?
> 
> That point has also been made.  I changed the name to 'text-quoting-style' in 
> the attached patch.  Although it's just a name, it does have uses outside help 
> buffers so at least the 'help' part of the name was misleading.  Other Emacs 
> packages (e.g., coreutils) use "quoting-style" but that's too generic for Emacs 
> which has other interpretation of the word "quoting".

How about 'symbol-quoting-style'?  Isn't that more accurate than
'text-quoting-style'?



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

* RE: how to turn off automatic curly-quoting?
       [not found]       ` <<83a8u8v1zk.fsf@gnu.org>
@ 2015-08-03 15:48         ` Drew Adams
  2015-08-03 16:14           ` Eli Zaretskii
  0 siblings, 1 reply; 22+ messages in thread
From: Drew Adams @ 2015-08-03 15:48 UTC (permalink / raw)
  To: Eli Zaretskii, Paul Eggert; +Cc: drew.adams, emacs-devel

> > > Also, why is the name about "translation"?  Shouldn't
> > > this option just be about what style is used for quoting
> > > Emacs terms?
> >
> > That point has also been made.  I changed the name to 'text-quoting-style'
> > in the attached patch.  Although it's just a name, it does have uses
> > outside help buffers so at least the 'help' part of the name was misleading.
> > Other Emacs packages (e.g., coreutils) use "quoting-style" but that's too
> > generic for Emacs which has other interpretation of the word "quoting".
> 
> How about 'symbol-quoting-style'?  Isn't that more accurate than
> 'text-quoting-style'?

Definitely.  But this "quoting" is used not only for symbols but also
for Lisp (and other language?) sexps generally.  It is also used for
key sequences.  And I've seen other uses too - cross-refs, file names,
or URLs, perhaps?

`sexp-quoting-style' is better than `symbol-quoting-style' is (much!)
better than `text-quoting-style', which is quite misleading.

What about just `quoting-style'?

But again, this is not at all about ordinary text quoting (which is
why we should not be using ordinary curly quotes for this at all).



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

* Re: how to turn off automatic curly-quoting?
  2015-08-03 15:48         ` Drew Adams
@ 2015-08-03 16:14           ` Eli Zaretskii
  0 siblings, 0 replies; 22+ messages in thread
From: Eli Zaretskii @ 2015-08-03 16:14 UTC (permalink / raw)
  To: Drew Adams; +Cc: eggert, drew.adams, emacs-devel

> Date: Mon, 3 Aug 2015 08:48:37 -0700 (PDT)
> From: Drew Adams <drew.adams@oracle.com>
> Cc: drew.adams@oracle.com, emacs-devel@gnu.org
> 
> > How about 'symbol-quoting-style'?  Isn't that more accurate than
> > 'text-quoting-style'?
> 
> Definitely.  But this "quoting" is used not only for symbols but also
> for Lisp (and other language?) sexps generally.  It is also used for
> key sequences.  And I've seen other uses too - cross-refs, file names,
> or URLs, perhaps?
> 
> `sexp-quoting-style' is better than `symbol-quoting-style' is (much!)
> better than `text-quoting-style', which is quite misleading.

"Symbol" is more general and its meaning more clear (at least to
newbies) than "sexp", IMO.

> What about just `quoting-style'?

Too general, and thus misleading, IMO.



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

* Re: how to turn off automatic curly-quoting?
  2015-08-03 15:13       ` Eli Zaretskii
@ 2015-08-03 16:49         ` Paul Eggert
  2015-08-03 17:31           ` Drew Adams
  2015-08-03 19:14           ` Eli Zaretskii
  0 siblings, 2 replies; 22+ messages in thread
From: Paul Eggert @ 2015-08-03 16:49 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: drew.adams, emacs-devel

Eli Zaretskii wrote:
> How about 'symbol-quoting-style'?  Isn't that more accurate than
> 'text-quoting-style'?

No, as the style is used for quoting pretty much anything, not just symbols.  It 
can quote symbols, node references, file names, and various English phrases such 
as ‘C source code’.  And once we change the ‘message’ function to use the style, 
it'll quote even more things.




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

* RE: how to turn off automatic curly-quoting?
  2015-08-03 16:49         ` Paul Eggert
@ 2015-08-03 17:31           ` Drew Adams
  2015-08-03 18:59             ` Paul Eggert
  2015-08-03 19:14           ` Eli Zaretskii
  1 sibling, 1 reply; 22+ messages in thread
From: Drew Adams @ 2015-08-03 17:31 UTC (permalink / raw)
  To: Paul Eggert, Eli Zaretskii; +Cc: emacs-devel

> > How about 'symbol-quoting-style'?  Isn't that more accurate than
> > 'text-quoting-style'?
> 
> No, as the style is used for quoting pretty much anything, not just
> symbols.  It can quote symbols, node references, file names,

Yes.

> and various English phrases such as ‘C source code’. 

The latter is a mistake (a bug) IMHO.  I assume you are referring
to the fact that `C-h f' shows this:

 forward-char is an interactive built-in function in ‘C source code’.

The quoted phrase here is ordinary English.  It happens to be a link.
Whoever added that linked phrase should not have quoted it in any way.

Do you know of other occurrences of quoting ordinary text with `...'
in Emacs?  I doubt it, but there might be one or two such bugs.  It
happens that people updating the manual sometimes use "..." or `...'
inappropriately.  But it is rare.

The kind of "quoting" we are talking about (which was `...') should
_not at all be used for ordinary text quoting_.  It should be limited
to what is shown in most doc systems using a monospaced font.  The
best example is showing code fragments inline, i.e., in the middle of
a sentence of ordinary text.

> And once we change the ‘message’ function to use the style, it'll
> quote even more things.

That would be quite misguided - a big mistake, IMHO.  But please be
specific about what change you have in mind here.

Think ordinary docs, and how they talk about code fragments.  They
typically use a monospace font for that.  Or sometimes they use
highlighting.  They do *not* use quote marks.  And most importantly,
they do not use the same thing they use for quoting ordinary text.

If you start using ‘...’ (curly quotes) for everything under the
sun then you will lose the ability to distinguish things.  And you
will confuse readers.



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

* Re: how to turn off automatic curly-quoting?
  2015-08-03 17:31           ` Drew Adams
@ 2015-08-03 18:59             ` Paul Eggert
  2015-08-03 19:33               ` Drew Adams
  0 siblings, 1 reply; 22+ messages in thread
From: Paul Eggert @ 2015-08-03 18:59 UTC (permalink / raw)
  To: Drew Adams; +Cc: emacs-devel

Drew Adams wrote:
> Do you know of other occurrences of quoting ordinary text with `...'
> in Emacs?  I doubt it

It's done all the time.  Here are some examples:

"Add `See also ...' to WIDGET if there are any links...."
"... The `ISO year' corresponds approximately to the Gregorian year, but
weeks start on Monday and end on Sunday...."
"If nil, Comint will interpret `carriage control' characters in output...."

Although I tend to agree with you that this is not good style, evidently not 
everyone shares our tastes.  In any event there's no harm translating these to 
curved quotes, as is done in current Emacs master.

> please be specific about what change you have in mind here.

Nothing fancy.  Basically, the ‘message’ function should pass its format 
argument through ‘substitute-command-keys’ before using the format, so that 
quotation marks are displayed according to user preference.



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

* Re: how to turn off automatic curly-quoting?
  2015-08-03 16:49         ` Paul Eggert
  2015-08-03 17:31           ` Drew Adams
@ 2015-08-03 19:14           ` Eli Zaretskii
  1 sibling, 0 replies; 22+ messages in thread
From: Eli Zaretskii @ 2015-08-03 19:14 UTC (permalink / raw)
  To: Paul Eggert; +Cc: drew.adams, emacs-devel

> Date: Mon, 03 Aug 2015 09:49:16 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
> CC: drew.adams@oracle.com, emacs-devel@gnu.org
> 
> Eli Zaretskii wrote:
> > How about 'symbol-quoting-style'?  Isn't that more accurate than
> > 'text-quoting-style'?
> 
> No, as the style is used for quoting pretty much anything, not just symbols.

Yes, but the vast majority is symbols.



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

* RE: how to turn off automatic curly-quoting?
  2015-08-03 18:59             ` Paul Eggert
@ 2015-08-03 19:33               ` Drew Adams
  2015-08-03 21:06                 ` Paul Eggert
  0 siblings, 1 reply; 22+ messages in thread
From: Drew Adams @ 2015-08-03 19:33 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

> > Do you know of other occurrences of quoting ordinary text with `...'
> > in Emacs?  I doubt it
> 
> It's done all the time.  Here are some examples:
> 
> "Add `See also ...' to WIDGET if there are any links...."
> "... The `ISO year' corresponds approximately to the Gregorian year, but
> weeks start on Monday and end on Sunday...."
> "If nil, Comint will interpret `carriage control' characters in
> output...."

1. All bugs, IMO, though I don't have the contexts.

Without context it's hard to know just what is the fix in each case.
If "ISO year" is meant to be a placeholder such as a parameter, for
example, then the Elisp manual would instead use ISO-YEAR (no quotes
and no spaces).

I don't see `ISO year' in either the Emacs manual or the Elisp manual.
And yes, it is more likely that doc/manual bugs are found in other
manuals, especially when written by 3rd parties.  Eli doesn't have the
same time to devote to all other manuals as he does to the two main
manuals, where he often identifies and fixes such bugs.  And there
are fewer user eyes on such manuals, so such problems get reported
less often.

2. If you are quoting ordinary text then use whatever Emacs uses to
quote ordinary text (not code, keys, URLs, and file names).

So what does Emacs use to quote ordinary text?

* It might be "..." (which it uses to introduce glossary terms), or it
  might not be.  The use of "..." for anything other than code strings
  is also a bad idea, IMO.  Unless we systematically put inline code
  strings within code quotes (e.g., ‘"a code string"’).

* It could be curly double-quotes, but it doesn't seem to be so far.

* It could be curly single-quotes, if Emacs adopted British style.  It
  could be the case for American style too, but only for an embedded
  quote (of which there are probably none in the existing doc).

Whatever it is, it might well apply to the examples you just gave.
At first sight, at least, those just quote ordinary text, AFAICT.

> Although I tend to agree with you that this is not good style, evidently
> not everyone shares our tastes.  In any event there's no harm translating
> these to curved quotes, as is done in current Emacs master.

There is definitely harm in doing so, since that's the convention you
are adopting for code etc.  That's the point.

Inline code etc. is not just ordinary text-quoting.  You've chosen an
inappropriate mechanism for setting off code etc., one that is easily
confusable with ordinary text quoting.  A no-no, by any ordinary doc
 standards.  But of course, Emacs can do whatever it likes - or apparently
whatever you like.



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

* Re: how to turn off automatic curly-quoting?
  2015-08-03 19:33               ` Drew Adams
@ 2015-08-03 21:06                 ` Paul Eggert
  0 siblings, 0 replies; 22+ messages in thread
From: Paul Eggert @ 2015-08-03 21:06 UTC (permalink / raw)
  To: Drew Adams; +Cc: emacs-devel

On 08/03/2015 12:33 PM, Drew Adams wrote:
> Without context it's hard to know just what is the fix in each case.

They're all doc strings in the Emacs source code.  You can find them 
with 'grep -r'.  The three functions and variables in question are 
custom-add-see-also, calendar-iso-to-absolute, 
comint-inhibit-carriage-motion.  These are just examples of course.

> I don't see `ISO year' in either the Emacs manual or the Elisp manual.

The manual is a different topic.  Its info and PDF files switched to 
curved quotes some time ago (this is in Emacs 24.5).  Its source files 
continue to quote `like this'.  None of the stuff in this email thread 
affects the manual or how it's edited or displayed.

> The use of "..." for anything other than code strings is also a bad 
> idea, IMO.

That's a style issue.  Other GNU projects often use American-style 
straight double-quotes when quoting ordinary English text "like this", 
and use British-style straight apostrophes when quoting code '(like 
this)'; this style is simple and easy to explain and you'll see quite a 
few instances of it in Emacs too.  However, for historical reasons Emacs 
often quotes English text and/or code with grave accent and apostrophe 
`like this'.

If I could wave a magic wand and change the Emacs style to resemble that 
of other GNU projects, without offending existing developers, I'd do 
it.  Unfortunately no magic wands are available and in the meantime we 
need to deal with the quoting that Emacs code actually uses.



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

end of thread, other threads:[~2015-08-03 21:06 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <<36f6e67e-45d9-4eca-8302-ad9a06d138f1@default>
     [not found] ` <<83fv41v6fh.fsf@gnu.org>
2015-08-02 21:47   ` how to turn off automatic curly-quoting? Drew Adams
2015-08-02 23:06     ` Paul Eggert
2015-08-02 23:57       ` Artur Malabarba
2015-08-03  0:11         ` Paul Eggert
2015-08-03  0:02       ` Drew Adams
2015-08-03  0:40         ` Paul Eggert
2015-08-03  2:28           ` Drew Adams
2015-08-03  5:11             ` Paul Eggert
2015-08-03 15:13       ` Eli Zaretskii
2015-08-03 16:49         ` Paul Eggert
2015-08-03 17:31           ` Drew Adams
2015-08-03 18:59             ` Paul Eggert
2015-08-03 19:33               ` Drew Adams
2015-08-03 21:06                 ` Paul Eggert
2015-08-03 19:14           ` Eli Zaretskii
     [not found]   ` <<5681a732-5741-4f56-b3d7-cb1edb739d32@default>
     [not found]     ` <<55BEA291.70402@cs.ucla.edu>
     [not found]       ` <<83a8u8v1zk.fsf@gnu.org>
2015-08-03 15:48         ` Drew Adams
2015-08-03 16:14           ` Eli Zaretskii
2015-08-02 17:18 Drew Adams
2015-08-02 19:25 ` Eli Zaretskii
2015-08-02 19:46   ` Paul Eggert
2015-08-02 20:11     ` Drew Adams
2015-08-02 20:26       ` Paul Eggert

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).