From 5f76ac150a28e4de940790f96f0f751c8ee5d4c7 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Fri, 22 Sep 2017 21:52:03 +0000 Subject: [PATCH] Make the value nil in text-quoting-style mean what it does in Emacs 25. This is a partial reversion of yesterday's commit by the same author, which changed the meaning of nil and introduced the new value t. * src/doc.c (text_quoting_style, text-quoting-style) (internal--text-quoting-flag): Revert yesterday's changes. * lisp/cus-start.el: (top level): Amend the entry for text-quoting-style. * etc/NEWS: Amend the entry for text-quoting-style. * doc/lispref/control.texi (Signalling Errors) * doc/lispref/display.texi (Displaying Messages) * doc/lispref/strings.texi (Formatting Strings): Bind text-quoting-style to grave rather than nil to inhibit translation of quotes. * doc/lispref/help.texi (Keys in Documentation): Revert the description of the proposed new default, t. --- doc/lispref/control.texi | 2 +- doc/lispref/display.texi | 2 +- doc/lispref/help.texi | 10 +++++----- doc/lispref/strings.texi | 8 ++++---- etc/NEWS | 14 ++++++-------- lisp/cus-start.el | 5 ++--- src/doc.c | 36 ++++++++++++++++-------------------- 7 files changed, 35 insertions(+), 42 deletions(-) diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index 09435f57966..c39e035459e 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi @@ -1109,7 +1109,7 @@ quotes. In contrast, a call using a format like @t{"Missing '%s'"} with only apostrophes typically generates a message like @t{"Missing ’foo’"} with only closing curved quotes, an unusual style in English. One way around this problem is to bind @code{text-quoting-style} to -@code{nil} around the call to @code{error}; this causes the +the symbol @code{grave} around the call to @code{error}; this causes @acronym{ASCII} quote characters to be output unchanged. @strong{Warning:} If you want to use your own string as an error message diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 8f58fca506f..62b136f6c60 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -273,7 +273,7 @@ quotes. In contrast, a call using a format like @t{"Missing '%s'"} with only apostrophes typically generates a message like @t{"Missing ’foo’"} with only closing curved quotes, an unusual style in English. One way around this problem is to bind @code{text-quoting-style} to -@code{nil} around calls to @code{message}; this causes the +the symbol @code{grave} around calls to @code{message}; this causes @acronym{ASCII} quote characters to be output unchanged. In batch mode, the message is printed to the standard error stream, diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index e1e98124e08..74dc6dac9cb 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi @@ -359,11 +359,11 @@ should use for single quotes in the wording of help and messages. 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{nil} or @code{grave}, quotes are not translated and the style is -@t{`like this'} with grave accent and apostrophe, the standard style -before Emacs version 25. The default value @code{t} acts like -@code{curve} if curved single quotes seem to be displayable, and like -@code{nil} otherwise. +@code{grave}, quotes are not translated and the style is @t{`like +this'} with grave accent and apostrophe, the standard style before +Emacs version 25. The default value @code{nil} acts like @code{curve} +if curved single quotes seem to be displayable, and like @code{grave} +otherwise. This option is useful on platforms that have problems with curved quotes. You can customize it freely according to your personal diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 117a373a190..10385e05501 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -836,10 +836,10 @@ this'} typically generates curved quotes @t{‘like this’}. In contrast, a format that quotes with only apostrophes @t{'like this'} typically generates two closing curved quotes @t{’like this’}, an unusual style in English. One way around such problems is to bind -@code{text-quoting-style} to @code{nil} around calls to -@code{format-message}; this causes the @acronym{ASCII} quoting -characters to be output unchanged. @xref{Keys in Documentation}, for -how the @code{text-quoting-style} variable affects generated quotes. +@code{text-quoting-style} to the symbol @code{grave} around calls to +@code{format-message}; this causes @acronym{ASCII} quoting characters +to be output unchanged. @xref{Keys in Documentation}, for how the +@code{text-quoting-style} variable affects generated quotes. @end defun @cindex @samp{%} in format diff --git a/etc/NEWS b/etc/NEWS index d518d5e277e..20182c1b816 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1244,15 +1244,13 @@ change FOO, respectively. The exhaustive list of removed variables is: *** Many variables obsoleted in 22.1 referring to face symbols +++ -** The variable `text-quoting-style' is now a customizable option. It +** The variable 'text-quoting-style' is now a customizable option. It controls whether to and how to translate ASCII quotes in messages and -help output. The value nil now means "no translation", and the value -t, the default, means "use curved quotes if displayable" (as nil did -in Emacs 25). The other possible values remain unchanged. -`text-quoting-style' no longer affects the treatment of curved quotes -in format arguments to functions like `message' and `format-message'. -In particular, when this variable's value is `grave', all quotes in -formats are output as-is. +help output. Its possible values and their semantics remain unchanged +from Emacs 25, except that 'text-quoting-style' no longer affects the +treatment of curved quotes in format arguments to functions like +'message' and 'format-message'. In particular, when this variable's +value is 'grave', all quotes in formats are output as-is. --- ** Functions like 'check-declare-file' and 'check-declare-directory' diff --git a/lisp/cus-start.el b/lisp/cus-start.el index f5e1431f6bb..a5ec223fe51 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -226,11 +226,10 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of ;; doc.c (text-quoting-style display (choice - (const :tag "No translation" nil) - (const :tag "Prefer \\=‘curved\\=’ quotes, if possible" t) + (const :tag "Prefer \\=‘curved\\=’ quotes, if possible" nil) (const :tag "\\=‘Curved\\=’ quotes" curved) (const :tag "\\='Straight\\=' quotes" straight) - (const :tag "\\=`Grave\\=' quotes" grave))) + (const :tag "\\=`Grave\\=' quotes (no translation)" grave))) ;; dosfns.c (dos-display-scancodes display boolean) diff --git a/src/doc.c b/src/doc.c index e2af39ef07f..3286c12675a 100644 --- a/src/doc.c +++ b/src/doc.c @@ -690,9 +690,8 @@ enum text_quoting_style text_quoting_style (void) { if (NILP (Vtext_quoting_style) - || (EQ (Vtext_quoting_style, Qt) - ? default_to_grave_quoting_style () - : EQ (Vtext_quoting_style, Qgrave))) + ? default_to_grave_quoting_style () + : EQ (Vtext_quoting_style, Qgrave)) return GRAVE_QUOTING_STYLE; else if (EQ (Vtext_quoting_style, Qstraight)) return STRAIGHT_QUOTING_STYLE; @@ -1019,25 +1018,22 @@ syms_of_doc (void) Vbuild_files = Qnil; DEFVAR_LISP ("text-quoting-style", Vtext_quoting_style, - doc: /* How to translate single quotes in help and messages. -Its value should be a symbol, and describes the style of quote -substituted for ASCII quote characters GRAVE ACCENT (\\=`, \\=\\x60) and -APOSTROPHE (\\=', \\=\\x27). This is done in help output and in functions -like `message' and `format-message'. It is not done in `format'. - -The value nil means do not translate the quotes at all. The value t -(the default) acts like `curve' if curved single quotes appear to be -displayable, and like nil otherwise. `curve' means quote with curved -single quotes ‘like this’. `straight' means quote with apostrophes -\\='like this\\='. `grave' means do not translate quote marks and is -now a synonym for nil. - -(The value t was newly introduced in Emacs 26, and in Emacs 25 nil -meant what t means now.) */); - Vtext_quoting_style = Qt; + doc: /* Style to use for single quotes in help and messages. +Its value should be a symbol. It works by substituting certain single +quotes for grave accent and apostrophe. This is done in help output +and in functions like `message' and `format-message'. It is not done +in `format'. + +`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\\='; +i.e., do not alter quote marks. The default value nil acts like +`curve' if curved single quotes are displayable, and like `grave' +otherwise. */); + Vtext_quoting_style = Qnil; DEFVAR_BOOL ("internal--text-quoting-flag", text_quoting_flag, - doc: /* If nil, a `text-quoting-style' value t is treated as `nil'. */); + doc: /* If nil, a nil `text-quoting-style' is treated as `grave'. */); /* Initialized by ‘main’. */ defsubr (&Sdocumentation); -- 2.39.5