diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2015-08-02 15:58:02 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-08-02 15:58:31 -0700 |
commit | fa10e77790a207aeabf354c9f5667b3dbde55bb2 (patch) | |
tree | 9ab7b0e8bbd340d76f34583aeaa7721c7f59008f /src | |
parent | fc9206b73a254a400245578b94542cfe82c68e9c (diff) | |
download | emacs-fa10e77790a207aeabf354c9f5667b3dbde55bb2.tar.gz |
Redo text-quoting-style variable
Rename help-quote-translation to text-quoting-style,
and use symbols rather than characters as values.
This follows suggestions along these lines by Alan Mackenzie in:
http://lists.gnu.org/archive/html/emacs-devel/2015-06/msg00343.html
and by Drew Adams in:
http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00048.html
* doc/lispref/help.texi (Keys in Documentation)
* etc/NEWS:
* lisp/cus-start.el (standard):
* src/doc.c (Fsubstitute_command_keys, syms_of_doc):
Document and/or implement the new behavior instead of the old.
(syms_of_doc): New symbols 'grave' and 'straight'.
Diffstat (limited to 'src')
-rw-r--r-- | src/doc.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/doc.c b/src/doc.c index 78a7815aade..36619e1142e 100644 --- a/src/doc.c +++ b/src/doc.c @@ -715,7 +715,7 @@ as the keymap for future \\=\\[COMMAND] substrings. Each \\=‘ and \\=’ are replaced by left and right quote. Each \\=` is replaced by left quote, and each ' preceded by \\=` and without intervening ' is replaced by right quote. Left and right quote -characters are specified by ‘help-quote-translation’. +characters are specified by ‘text-quoting-style’. \\=\\= quotes the following character and is discarded; thus, \\=\\=\\=\\= puts \\=\\= into the output, \\=\\=\\=\\[ puts \\=\\[ into the output, and @@ -751,11 +751,11 @@ Otherwise, return a new string. */) GCPRO4 (string, tem, keymap, name); enum { unicode, grave_accent, apostrophe } quote_translation = unicode; - if (EQ (Vhelp_quote_translation, make_number ('`'))) + if (EQ (Vtext_quoting_style, Qgrave)) quote_translation = grave_accent; - else if (EQ (Vhelp_quote_translation, make_number ('\''))) + else if (EQ (Vtext_quoting_style, Qstraight)) quote_translation = apostrophe; - else if (NILP (Vhelp_quote_translation) + else if (NILP (Vtext_quoting_style) && DISP_TABLE_P (Vstandard_display_table)) { Lisp_Object dv = DISP_CHAR_VECTOR (XCHAR_TABLE (Vstandard_display_table), @@ -1024,6 +1024,8 @@ void syms_of_doc (void) { DEFSYM (Qfunction_documentation, "function-documentation"); + DEFSYM (Qgrave, "grave"); + DEFSYM (Qstraight, "straight"); DEFVAR_LISP ("internal-doc-file-name", Vdoc_file_name, doc: /* Name of file containing documentation strings of built-in symbols. */); @@ -1033,15 +1035,14 @@ syms_of_doc (void) doc: /* A list of files used to build this Emacs binary. */); Vbuild_files = Qnil; - DEFVAR_LISP ("help-quote-translation", Vhelp_quote_translation, - doc: /* Style to use for single quotes in help. -The value is a left single quote character of some style. -Quote \\=‘like this\\=’ if the value is ?\\=‘ (left single quotation mark). -Quote 'like this' if the value is ?' (apostrophe). -Quote \\=`like this' if the value is ?\\=` (grave accent). -The default value is nil, which means quote with left single quotation mark -if displayable, and with grave accent otherwise. */); - Vhelp_quote_translation = Qnil; + DEFVAR_LISP ("text-quoting-style", Vtext_quoting_style, + doc: /* Style to use for single quotes when generating text. +‘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'. +The default value nil acts like ‘curve’ if curved single quotes are +displayable, and like ‘grave’ otherwise. */); + Vtext_quoting_style = Qnil; defsubr (&Sdocumentation); defsubr (&Sdocumentation_property); |