Commit 5f76ac15 authored by Alan Mackenzie's avatar Alan Mackenzie

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.
parent d5e4e004
...@@ -1109,7 +1109,7 @@ quotes. In contrast, a call using a format like @t{"Missing '%s'"} ...@@ -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 with only apostrophes typically generates a message like @t{"Missing
’foo’"} with only closing curved quotes, an unusual style in English. ’foo’"} with only closing curved quotes, an unusual style in English.
One way around this problem is to bind @code{text-quoting-style} to 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. @acronym{ASCII} quote characters to be output unchanged.
@strong{Warning:} If you want to use your own string as an error message @strong{Warning:} If you want to use your own string as an error message
......
...@@ -273,7 +273,7 @@ quotes. In contrast, a call using a format like @t{"Missing '%s'"} ...@@ -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 with only apostrophes typically generates a message like @t{"Missing
’foo’"} with only closing curved quotes, an unusual style in English. ’foo’"} with only closing curved quotes, an unusual style in English.
One way around this problem is to bind @code{text-quoting-style} to 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. @acronym{ASCII} quote characters to be output unchanged.
In batch mode, the message is printed to the standard error stream, In batch mode, the message is printed to the standard error stream,
......
...@@ -359,11 +359,11 @@ should use for single quotes in the wording of help and messages. If ...@@ -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’} 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 with curved single quotes. If the value is @code{straight}, the style
is @t{'like this'} with straight apostrophes. If the value is is @t{'like this'} with straight apostrophes. If the value is
@code{nil} or @code{grave}, quotes are not translated and the style is @code{grave}, quotes are not translated and the style is @t{`like
@t{`like this'} with grave accent and apostrophe, the standard style this'} with grave accent and apostrophe, the standard style before
before Emacs version 25. The default value @code{t} acts like Emacs version 25. The default value @code{nil} acts like @code{curve}
@code{curve} if curved single quotes seem to be displayable, and like if curved single quotes seem to be displayable, and like @code{grave}
@code{nil} otherwise. otherwise.
This option is useful on platforms that have problems with curved This option is useful on platforms that have problems with curved
quotes. You can customize it freely according to your personal quotes. You can customize it freely according to your personal
......
...@@ -836,10 +836,10 @@ this'} typically generates curved quotes @t{‘like this’}. In ...@@ -836,10 +836,10 @@ this'} typically generates curved quotes @t{‘like this’}. In
contrast, a format that quotes with only apostrophes @t{'like this'} contrast, a format that quotes with only apostrophes @t{'like this'}
typically generates two closing curved quotes @t{’like this’}, an typically generates two closing curved quotes @t{’like this’}, an
unusual style in English. One way around such problems is to bind unusual style in English. One way around such problems is to bind
@code{text-quoting-style} to @code{nil} around calls to @code{text-quoting-style} to the symbol @code{grave} around calls to
@code{format-message}; this causes the @acronym{ASCII} quoting @code{format-message}; this causes @acronym{ASCII} quoting characters
characters to be output unchanged. @xref{Keys in Documentation}, for to be output unchanged. @xref{Keys in Documentation}, for how the
how the @code{text-quoting-style} variable affects generated quotes. @code{text-quoting-style} variable affects generated quotes.
@end defun @end defun
@cindex @samp{%} in format @cindex @samp{%} in format
......
...@@ -1244,15 +1244,13 @@ change FOO, respectively. The exhaustive list of removed variables is: ...@@ -1244,15 +1244,13 @@ change FOO, respectively. The exhaustive list of removed variables is:
*** Many variables obsoleted in 22.1 referring to face symbols *** 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 controls whether to and how to translate ASCII quotes in messages and
help output. The value nil now means "no translation", and the value help output. Its possible values and their semantics remain unchanged
t, the default, means "use curved quotes if displayable" (as nil did from Emacs 25, except that 'text-quoting-style' no longer affects the
in Emacs 25). The other possible values remain unchanged. treatment of curved quotes in format arguments to functions like
`text-quoting-style' no longer affects the treatment of curved quotes 'message' and 'format-message'. In particular, when this variable's
in format arguments to functions like `message' and `format-message'. value is 'grave', all quotes in formats are output as-is.
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' ** Functions like 'check-declare-file' and 'check-declare-directory'
......
...@@ -226,11 +226,10 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of ...@@ -226,11 +226,10 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
;; doc.c ;; doc.c
(text-quoting-style display (text-quoting-style display
(choice (choice
(const :tag "No translation" nil) (const :tag "Prefer \\=curved\\= quotes, if possible" nil)
(const :tag "Prefer \\=curved\\= quotes, if possible" t)
(const :tag "\\=Curved\\= quotes" curved) (const :tag "\\=Curved\\= quotes" curved)
(const :tag "\\='Straight\\=' quotes" straight) (const :tag "\\='Straight\\=' quotes" straight)
(const :tag "\\=`Grave\\=' quotes" grave))) (const :tag "\\=`Grave\\=' quotes (no translation)" grave)))
;; dosfns.c ;; dosfns.c
(dos-display-scancodes display boolean) (dos-display-scancodes display boolean)
......
...@@ -690,9 +690,8 @@ enum text_quoting_style ...@@ -690,9 +690,8 @@ enum text_quoting_style
text_quoting_style (void) text_quoting_style (void)
{ {
if (NILP (Vtext_quoting_style) if (NILP (Vtext_quoting_style)
|| (EQ (Vtext_quoting_style, Qt) ? default_to_grave_quoting_style ()
? default_to_grave_quoting_style () : EQ (Vtext_quoting_style, Qgrave))
: EQ (Vtext_quoting_style, Qgrave)))
return GRAVE_QUOTING_STYLE; return GRAVE_QUOTING_STYLE;
else if (EQ (Vtext_quoting_style, Qstraight)) else if (EQ (Vtext_quoting_style, Qstraight))
return STRAIGHT_QUOTING_STYLE; return STRAIGHT_QUOTING_STYLE;
...@@ -1019,25 +1018,22 @@ syms_of_doc (void) ...@@ -1019,25 +1018,22 @@ syms_of_doc (void)
Vbuild_files = Qnil; Vbuild_files = Qnil;
DEFVAR_LISP ("text-quoting-style", Vtext_quoting_style, DEFVAR_LISP ("text-quoting-style", Vtext_quoting_style,
doc: /* How to translate single quotes in help and messages. doc: /* Style to use for single quotes in help and messages.
Its value should be a symbol, and describes the style of quote Its value should be a symbol. It works by substituting certain single
substituted for ASCII quote characters GRAVE ACCENT (\\=`, \\=\\x60) and quotes for grave accent and apostrophe. This is done in help output
APOSTROPHE (\\=', \\=\\x27). This is done in help output and in functions and in functions like `message' and `format-message'. It is not done
like `message' and `format-message'. It is not done in `format'. in `format'.
The value nil means do not translate the quotes at all. The value t `curve' means quote with curved single quotes ‘like this’.
(the default) acts like `curve' if curved single quotes appear to be `straight' means quote with straight apostrophes \\='like this\\='.
displayable, and like nil otherwise. `curve' means quote with curved `grave' means quote with grave accent and apostrophe \\=`like this\\=';
single quotes ‘like this’. `straight' means quote with apostrophes i.e., do not alter quote marks. The default value nil acts like
\\='like this\\='. `grave' means do not translate quote marks and is `curve' if curved single quotes are displayable, and like `grave'
now a synonym for nil. otherwise. */);
Vtext_quoting_style = Qnil;
(The value t was newly introduced in Emacs 26, and in Emacs 25 nil
meant what t means now.) */);
Vtext_quoting_style = Qt;
DEFVAR_BOOL ("internal--text-quoting-flag", text_quoting_flag, 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’. */ /* Initialized by ‘main’. */
defsubr (&Sdocumentation); defsubr (&Sdocumentation);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment