aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2017-09-22 21:52:03 +0000
committerAlan Mackenzie2017-10-01 11:27:16 +0000
commit5f76ac150a28e4de940790f96f0f751c8ee5d4c7 (patch)
treec5bcacf053fcb197638073f3f167719831f17ff8
parentd5e4e004fa134cb81989bcf40c5d6c79b837301f (diff)
downloademacs-5f76ac150a28e4de940790f96f0f751c8ee5d4c7.tar.gz
emacs-5f76ac150a28e4de940790f96f0f751c8ee5d4c7.zip
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.
-rw-r--r--doc/lispref/control.texi2
-rw-r--r--doc/lispref/display.texi2
-rw-r--r--doc/lispref/help.texi10
-rw-r--r--doc/lispref/strings.texi8
-rw-r--r--etc/NEWS14
-rw-r--r--lisp/cus-start.el5
-rw-r--r--src/doc.c36
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'"}
1109with only apostrophes typically generates a message like @t{"Missing 1109with only apostrophes typically generates a message like @t{"Missing
1110’foo’"} with only closing curved quotes, an unusual style in English. 1110’foo’"} with only closing curved quotes, an unusual style in English.
1111One way around this problem is to bind @code{text-quoting-style} to 1111One way around this problem is to bind @code{text-quoting-style} to
1112@code{nil} around the call to @code{error}; this causes the 1112the symbol @code{grave} around the call to @code{error}; this causes
1113@acronym{ASCII} quote characters to be output unchanged. 1113@acronym{ASCII} quote characters to be output unchanged.
1114 1114
1115@strong{Warning:} If you want to use your own string as an error message 1115@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'"}
273with only apostrophes typically generates a message like @t{"Missing 273with only apostrophes typically generates a message like @t{"Missing
274’foo’"} with only closing curved quotes, an unusual style in English. 274’foo’"} with only closing curved quotes, an unusual style in English.
275One way around this problem is to bind @code{text-quoting-style} to 275One way around this problem is to bind @code{text-quoting-style} to
276@code{nil} around calls to @code{message}; this causes the 276the symbol @code{grave} around calls to @code{message}; this causes
277@acronym{ASCII} quote characters to be output unchanged. 277@acronym{ASCII} quote characters to be output unchanged.
278 278
279In batch mode, the message is printed to the standard error stream, 279In 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
359the variable's value is @code{curve}, the style is @t{‘like this’} 359the variable's value is @code{curve}, the style is @t{‘like this’}
360with curved single quotes. If the value is @code{straight}, the style 360with curved single quotes. If the value is @code{straight}, the style
361is @t{'like this'} with straight apostrophes. If the value is 361is @t{'like this'} with straight apostrophes. If the value is
362@code{nil} or @code{grave}, quotes are not translated and the style is 362@code{grave}, quotes are not translated and the style is @t{`like
363@t{`like this'} with grave accent and apostrophe, the standard style 363this'} with grave accent and apostrophe, the standard style before
364before Emacs version 25. The default value @code{t} acts like 364Emacs version 25. The default value @code{nil} acts like @code{curve}
365@code{curve} if curved single quotes seem to be displayable, and like 365if curved single quotes seem to be displayable, and like @code{grave}
366@code{nil} otherwise. 366otherwise.
367 367
368This option is useful on platforms that have problems with curved 368This option is useful on platforms that have problems with curved
369quotes. You can customize it freely according to your personal 369quotes. 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
836contrast, a format that quotes with only apostrophes @t{'like this'} 836contrast, a format that quotes with only apostrophes @t{'like this'}
837typically generates two closing curved quotes @t{’like this’}, an 837typically generates two closing curved quotes @t{’like this’}, an
838unusual style in English. One way around such problems is to bind 838unusual style in English. One way around such problems is to bind
839@code{text-quoting-style} to @code{nil} around calls to 839@code{text-quoting-style} to the symbol @code{grave} around calls to
840@code{format-message}; this causes the @acronym{ASCII} quoting 840@code{format-message}; this causes @acronym{ASCII} quoting characters
841characters to be output unchanged. @xref{Keys in Documentation}, for 841to be output unchanged. @xref{Keys in Documentation}, for how the
842how the @code{text-quoting-style} variable affects generated quotes. 842@code{text-quoting-style} variable affects generated quotes.
843@end defun 843@end defun
844 844
845@cindex @samp{%} in format 845@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:
1244*** Many variables obsoleted in 22.1 referring to face symbols 1244*** Many variables obsoleted in 22.1 referring to face symbols
1245 1245
1246+++ 1246+++
1247** The variable `text-quoting-style' is now a customizable option. It 1247** The variable 'text-quoting-style' is now a customizable option. It
1248controls whether to and how to translate ASCII quotes in messages and 1248controls whether to and how to translate ASCII quotes in messages and
1249help output. The value nil now means "no translation", and the value 1249help output. Its possible values and their semantics remain unchanged
1250t, the default, means "use curved quotes if displayable" (as nil did 1250from Emacs 25, except that 'text-quoting-style' no longer affects the
1251in Emacs 25). The other possible values remain unchanged. 1251treatment of curved quotes in format arguments to functions like
1252`text-quoting-style' no longer affects the treatment of curved quotes 1252'message' and 'format-message'. In particular, when this variable's
1253in format arguments to functions like `message' and `format-message'. 1253value is 'grave', all quotes in formats are output as-is.
1254In particular, when this variable's value is `grave', all quotes in
1255formats are output as-is.
1256 1254
1257--- 1255---
1258** Functions like 'check-declare-file' and 'check-declare-directory' 1256** 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
226 ;; doc.c 226 ;; doc.c
227 (text-quoting-style display 227 (text-quoting-style display
228 (choice 228 (choice
229 (const :tag "No translation" nil) 229 (const :tag "Prefer \\=‘curved\\=’ quotes, if possible" nil)
230 (const :tag "Prefer \\=‘curved\\=’ quotes, if possible" t)
231 (const :tag "\\=‘Curved\\=’ quotes" curved) 230 (const :tag "\\=‘Curved\\=’ quotes" curved)
232 (const :tag "\\='Straight\\=' quotes" straight) 231 (const :tag "\\='Straight\\=' quotes" straight)
233 (const :tag "\\=`Grave\\=' quotes" grave))) 232 (const :tag "\\=`Grave\\=' quotes (no translation)" grave)))
234 233
235 ;; dosfns.c 234 ;; dosfns.c
236 (dos-display-scancodes display boolean) 235 (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
690text_quoting_style (void) 690text_quoting_style (void)
691{ 691{
692 if (NILP (Vtext_quoting_style) 692 if (NILP (Vtext_quoting_style)
693 || (EQ (Vtext_quoting_style, Qt) 693 ? default_to_grave_quoting_style ()
694 ? default_to_grave_quoting_style () 694 : EQ (Vtext_quoting_style, Qgrave))
695 : EQ (Vtext_quoting_style, Qgrave)))
696 return GRAVE_QUOTING_STYLE; 695 return GRAVE_QUOTING_STYLE;
697 else if (EQ (Vtext_quoting_style, Qstraight)) 696 else if (EQ (Vtext_quoting_style, Qstraight))
698 return STRAIGHT_QUOTING_STYLE; 697 return STRAIGHT_QUOTING_STYLE;
@@ -1019,25 +1018,22 @@ syms_of_doc (void)
1019 Vbuild_files = Qnil; 1018 Vbuild_files = Qnil;
1020 1019
1021 DEFVAR_LISP ("text-quoting-style", Vtext_quoting_style, 1020 DEFVAR_LISP ("text-quoting-style", Vtext_quoting_style,
1022 doc: /* How to translate single quotes in help and messages. 1021 doc: /* Style to use for single quotes in help and messages.
1023Its value should be a symbol, and describes the style of quote 1022Its value should be a symbol. It works by substituting certain single
1024substituted for ASCII quote characters GRAVE ACCENT (\\=`, \\=\\x60) and 1023quotes for grave accent and apostrophe. This is done in help output
1025APOSTROPHE (\\=', \\=\\x27). This is done in help output and in functions 1024and in functions like `message' and `format-message'. It is not done
1026like `message' and `format-message'. It is not done in `format'. 1025in `format'.
1027 1026
1028The value nil means do not translate the quotes at all. The value t 1027`curve' means quote with curved single quotes ‘like this’.
1029(the default) acts like `curve' if curved single quotes appear to be 1028`straight' means quote with straight apostrophes \\='like this\\='.
1030displayable, and like nil otherwise. `curve' means quote with curved 1029`grave' means quote with grave accent and apostrophe \\=`like this\\=';
1031single quotes ‘like this’. `straight' means quote with apostrophes 1030i.e., do not alter quote marks. The default value nil acts like
1032\\='like this\\='. `grave' means do not translate quote marks and is 1031`curve' if curved single quotes are displayable, and like `grave'
1033now a synonym for nil. 1032otherwise. */);
1034 1033 Vtext_quoting_style = Qnil;
1035(The value t was newly introduced in Emacs 26, and in Emacs 25 nil
1036meant what t means now.) */);
1037 Vtext_quoting_style = Qt;
1038 1034
1039 DEFVAR_BOOL ("internal--text-quoting-flag", text_quoting_flag, 1035 DEFVAR_BOOL ("internal--text-quoting-flag", text_quoting_flag,
1040 doc: /* If nil, a `text-quoting-style' value t is treated as `nil'. */); 1036 doc: /* If nil, a nil `text-quoting-style' is treated as `grave'. */);
1041 /* Initialized by ‘main’. */ 1037 /* Initialized by ‘main’. */
1042 1038
1043 defsubr (&Sdocumentation); 1039 defsubr (&Sdocumentation);