aboutsummaryrefslogtreecommitdiffstats
path: root/src/doc.c
diff options
context:
space:
mode:
authorAlan Mackenzie2017-09-21 20:31:06 +0000
committerAlan Mackenzie2017-10-01 11:27:15 +0000
commitd5e4e004fa134cb81989bcf40c5d6c79b837301f (patch)
tree7588a351b8bd89612cdb457979f84b5f9f90c826 /src/doc.c
parent1ba3471b9b443f0617662f4a50439bec211162ba (diff)
downloademacs-d5e4e004fa134cb81989bcf40c5d6c79b837301f.tar.gz
emacs-d5e4e004fa134cb81989bcf40c5d6c79b837301f.zip
Make text-quoting-style customizable. Introduce t and new meaning for nil.
A value of nil for text-quoting-style now means "no translation". t means "Use curved quotes if displayable". * src/doc.c (text-quoting-style (function)): modify for new semantics. (text-quoting-style (variable)): Amend the doc string, set the default value to t. * lisp/cus-start.el: (top level): Create a customize entry for text-quoting-style in group display. * etc/NEWS: Amend the entry for text-quoting-style. * doc/emacs/display.texi (Text Display): Describe the translation of ASCII quotes to curved quotes, and how to influence or inhibit it. * doc/lispref/control.texi (Signalling Errors) * doc/lispref/display.texi (Displaying Messages) * doc/lispref/strings.texi (Formatting Strings): Describe binding text-quoting-style to nil to inhibit unwanted quote translation. * doc/lispref/help.texi (Keys in Documentation): Change text-quoting-style from a variable to a user option. Describe its changed set of values. State that it can be customized freely.
Diffstat (limited to 'src/doc.c')
-rw-r--r--src/doc.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/doc.c b/src/doc.c
index 3286c12675a..e2af39ef07f 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -690,8 +690,9 @@ 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 ? default_to_grave_quoting_style () 693 || (EQ (Vtext_quoting_style, Qt)
694 : EQ (Vtext_quoting_style, Qgrave)) 694 ? default_to_grave_quoting_style ()
695 : EQ (Vtext_quoting_style, Qgrave)))
695 return GRAVE_QUOTING_STYLE; 696 return GRAVE_QUOTING_STYLE;
696 else if (EQ (Vtext_quoting_style, Qstraight)) 697 else if (EQ (Vtext_quoting_style, Qstraight))
697 return STRAIGHT_QUOTING_STYLE; 698 return STRAIGHT_QUOTING_STYLE;
@@ -1018,22 +1019,25 @@ syms_of_doc (void)
1018 Vbuild_files = Qnil; 1019 Vbuild_files = Qnil;
1019 1020
1020 DEFVAR_LISP ("text-quoting-style", Vtext_quoting_style, 1021 DEFVAR_LISP ("text-quoting-style", Vtext_quoting_style,
1021 doc: /* Style to use for single quotes in help and messages. 1022 doc: /* How to translate single quotes in help and messages.
1022Its value should be a symbol. It works by substituting certain single 1023Its value should be a symbol, and describes the style of quote
1023quotes for grave accent and apostrophe. This is done in help output 1024substituted for ASCII quote characters GRAVE ACCENT (\\=`, \\=\\x60) and
1024and in functions like `message' and `format-message'. It is not done 1025APOSTROPHE (\\=', \\=\\x27). This is done in help output and in functions
1025in `format'. 1026like `message' and `format-message'. It is not done in `format'.
1026 1027
1027`curve' means quote with curved single quotes ‘like this’. 1028The value nil means do not translate the quotes at all. The value t
1028`straight' means quote with straight apostrophes \\='like this\\='. 1029(the default) acts like `curve' if curved single quotes appear to be
1029`grave' means quote with grave accent and apostrophe \\=`like this\\='; 1030displayable, and like nil otherwise. `curve' means quote with curved
1030i.e., do not alter quote marks. The default value nil acts like 1031single quotes ‘like this’. `straight' means quote with apostrophes
1031`curve' if curved single quotes are displayable, and like `grave' 1032\\='like this\\='. `grave' means do not translate quote marks and is
1032otherwise. */); 1033now a synonym for nil.
1033 Vtext_quoting_style = Qnil; 1034
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;
1034 1038
1035 DEFVAR_BOOL ("internal--text-quoting-flag", text_quoting_flag, 1039 DEFVAR_BOOL ("internal--text-quoting-flag", text_quoting_flag,
1036 doc: /* If nil, a nil `text-quoting-style' is treated as `grave'. */); 1040 doc: /* If nil, a `text-quoting-style' value t is treated as `nil'. */);
1037 /* Initialized by ‘main’. */ 1041 /* Initialized by ‘main’. */
1038 1042
1039 defsubr (&Sdocumentation); 1043 defsubr (&Sdocumentation);