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'"}
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
......
......@@ -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,
......
......@@ -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
......
......@@ -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
......
......@@ -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'
......
......@@ -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)
......
......@@ -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);
......
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