diff options
| author | Paul Eggert | 2015-08-02 15:58:02 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-08-02 15:58:31 -0700 |
| commit | fa10e77790a207aeabf354c9f5667b3dbde55bb2 (patch) | |
| tree | 9ab7b0e8bbd340d76f34583aeaa7721c7f59008f | |
| parent | fc9206b73a254a400245578b94542cfe82c68e9c (diff) | |
| download | emacs-fa10e77790a207aeabf354c9f5667b3dbde55bb2.tar.gz emacs-fa10e77790a207aeabf354c9f5667b3dbde55bb2.zip | |
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'.
| -rw-r--r-- | doc/lispref/help.texi | 16 | ||||
| -rw-r--r-- | etc/NEWS | 20 | ||||
| -rw-r--r-- | lisp/cus-start.el | 18 | ||||
| -rw-r--r-- | src/doc.c | 27 |
4 files changed, 42 insertions, 39 deletions
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index 779a0d581e2..ca8ae3f314a 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi | |||
| @@ -347,18 +347,18 @@ and @samp{\=\=} puts @samp{\=} into the output. | |||
| 347 | @strong{Please note:} Each @samp{\} must be doubled when written in a | 347 | @strong{Please note:} Each @samp{\} must be doubled when written in a |
| 348 | string in Emacs Lisp. | 348 | string in Emacs Lisp. |
| 349 | 349 | ||
| 350 | @defvar help-quote-translation | 350 | @defvar text-quoting-style |
| 351 | @cindex curved quotes | 351 | @cindex curved quotes |
| 352 | @cindex curly quotes | 352 | @cindex curly quotes |
| 353 | The value of this variable specifies the style | 353 | The value of this variable specifies the style |
| 354 | @code{substitute-command-keys} uses when generating left and right | 354 | @code{substitute-command-keys} uses when generating left and right |
| 355 | quotes. If the variable's value is @code{?‘} (U+2018 LEFT SINGLE | 355 | quotes. If the variable's value is @code{curve}, the style is |
| 356 | QUOTATION MARK), the style is @t{‘like this’} with curved single | 356 | @t{‘like this’} with curved single quotes. If the value is |
| 357 | quotes. If the value is @code{?'} (apostrophe), the style is @t{'like | 357 | @code{straight}, the style is @t{'like this'} with straight |
| 358 | this'} with apostrophes. If the value is @code{?`} (grave accent), | 358 | apostrophes. If the value is @code{grave}, the style is @t{`like |
| 359 | the style is @t{`like this'} with grave accent and apostrophe. The | 359 | this'} with grave accent and apostrophe. The default value @code{nil} |
| 360 | default value @code{nil} means to use curved single quotes if | 360 | acts like @code{curve} if curved single quotes are displayable, and |
| 361 | displayable, and grave accent and apostrophe otherwise. | 361 | like @code{grave} otherwise. |
| 362 | @end defvar | 362 | @end defvar |
| 363 | 363 | ||
| 364 | @defun substitute-command-keys string | 364 | @defun substitute-command-keys string |
| @@ -889,14 +889,14 @@ in languages like German where downcasing rules depend on grammar. | |||
| 889 | +++ | 889 | +++ |
| 890 | ** substitute-command-keys now replaces quotes. | 890 | ** substitute-command-keys now replaces quotes. |
| 891 | That is, it converts documentation strings' quoting style as per the | 891 | That is, it converts documentation strings' quoting style as per the |
| 892 | value of the new custom variable ‘help-quote-translation’: ?‘ means | 892 | value of the new custom variable ‘text-quoting-style’: ‘curve’ means |
| 893 | use curved quotes (also known as curly quotes) ‘like this’, ?' means | 893 | use curved quotes (also known as curly quotes) ‘like this’, ‘straight’ |
| 894 | use apostrophes 'like this', ?` means use grave accent and apostrophe | 894 | means use straight apostrophes 'like this', ‘grave’ means use grave |
| 895 | `like this', and nil (default) means use curved quotes if displayable | 895 | accent and apostrophe `like this', and nil (default) means use curved |
| 896 | and grave accent and apostrophe otherwise. Doc strings in source code | 896 | quotes if displayable and grave accent and apostrophe otherwise. Doc |
| 897 | can use either curved quotes or grave accent and apostrophe. As | 897 | strings in source code can use either curved quotes or grave accent |
| 898 | before, isolated apostrophes and characters preceded by \= are output | 898 | and apostrophe. As before, isolated apostrophes and characters |
| 899 | as-is. | 899 | preceded by \= are output as-is. |
| 900 | 900 | ||
| 901 | +++ | 901 | +++ |
| 902 | ** The character classes [:alpha:] and [:alnum:] in regular expressions | 902 | ** The character classes [:alpha:] and [:alnum:] in regular expressions |
| @@ -1017,8 +1017,8 @@ In the new Electric Quote mode, you can enter curved single quotes | |||
| 1017 | into documentation by typing ` and '. Outside Electric Quote mode, | 1017 | into documentation by typing ` and '. Outside Electric Quote mode, |
| 1018 | you can enter them by typing ‘C-x 8 [’ and ‘C-x 8 ]’, or (if your Alt | 1018 | you can enter them by typing ‘C-x 8 [’ and ‘C-x 8 ]’, or (if your Alt |
| 1019 | key works) by typing ‘A-[’ and ‘A-]’. As described above under | 1019 | key works) by typing ‘A-[’ and ‘A-]’. As described above under |
| 1020 | ‘help-quote-translation’, the user can specify how to display doc | 1020 | ‘text-quoting-style’, the user can specify how to display doc string |
| 1021 | string quotes. | 1021 | quotes. |
| 1022 | 1022 | ||
| 1023 | +++ | 1023 | +++ |
| 1024 | ** show-help-function's arg is converted via substitute-command-keys | 1024 | ** show-help-function's arg is converted via substitute-command-keys |
diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 69dbf0d0c57..7a37198fb2c 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el | |||
| @@ -221,14 +221,16 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of | |||
| 221 | (no-redraw-on-reenter display boolean) | 221 | (no-redraw-on-reenter display boolean) |
| 222 | 222 | ||
| 223 | ;; doc.c | 223 | ;; doc.c |
| 224 | (help-quote-translation help | 224 | (text-quoting-style |
| 225 | (choice | 225 | help |
| 226 | (character :tag "Quote with curved quotes" | 226 | (choice |
| 227 | :value ?‘) | 227 | (const :tag "Quote with curved single quotes" curve) |
| 228 | (character :tag "Quote 'like this'" :value ?\') | 228 | (const :tag "Quote with straight apostrophes 'like this'" |
| 229 | (character :tag "Quote `like this'" :value ?\`) | 229 | straight) |
| 230 | (const :tag "Quote with curved quotes if displayable, 'like this' otherwise" nil)) | 230 | (const :tag "Quote with grave accent and apostrophe `like this'" |
| 231 | "25.1") | 231 | grave) |
| 232 | (const :tag "Use curved quotes if displayable, grave accent and apostrophe otherwise" nil)) | ||
| 233 | "25.1") | ||
| 232 | ;; dosfns.c | 234 | ;; dosfns.c |
| 233 | (dos-display-scancodes display boolean) | 235 | (dos-display-scancodes display boolean) |
| 234 | (dos-hyper-key keyboard integer) | 236 | (dos-hyper-key keyboard integer) |
| @@ -715,7 +715,7 @@ as the keymap for future \\=\\[COMMAND] substrings. | |||
| 715 | Each \\=‘ and \\=’ are replaced by left and right quote. Each \\=` is | 715 | Each \\=‘ and \\=’ are replaced by left and right quote. Each \\=` is |
| 716 | replaced by left quote, and each ' preceded by \\=` and without | 716 | replaced by left quote, and each ' preceded by \\=` and without |
| 717 | intervening ' is replaced by right quote. Left and right quote | 717 | intervening ' is replaced by right quote. Left and right quote |
| 718 | characters are specified by ‘help-quote-translation’. | 718 | characters are specified by ‘text-quoting-style’. |
| 719 | 719 | ||
| 720 | \\=\\= quotes the following character and is discarded; thus, | 720 | \\=\\= quotes the following character and is discarded; thus, |
| 721 | \\=\\=\\=\\= puts \\=\\= into the output, \\=\\=\\=\\[ puts \\=\\[ into the output, and | 721 | \\=\\=\\=\\= puts \\=\\= into the output, \\=\\=\\=\\[ puts \\=\\[ into the output, and |
| @@ -751,11 +751,11 @@ Otherwise, return a new string. */) | |||
| 751 | GCPRO4 (string, tem, keymap, name); | 751 | GCPRO4 (string, tem, keymap, name); |
| 752 | 752 | ||
| 753 | enum { unicode, grave_accent, apostrophe } quote_translation = unicode; | 753 | enum { unicode, grave_accent, apostrophe } quote_translation = unicode; |
| 754 | if (EQ (Vhelp_quote_translation, make_number ('`'))) | 754 | if (EQ (Vtext_quoting_style, Qgrave)) |
| 755 | quote_translation = grave_accent; | 755 | quote_translation = grave_accent; |
| 756 | else if (EQ (Vhelp_quote_translation, make_number ('\''))) | 756 | else if (EQ (Vtext_quoting_style, Qstraight)) |
| 757 | quote_translation = apostrophe; | 757 | quote_translation = apostrophe; |
| 758 | else if (NILP (Vhelp_quote_translation) | 758 | else if (NILP (Vtext_quoting_style) |
| 759 | && DISP_TABLE_P (Vstandard_display_table)) | 759 | && DISP_TABLE_P (Vstandard_display_table)) |
| 760 | { | 760 | { |
| 761 | Lisp_Object dv = DISP_CHAR_VECTOR (XCHAR_TABLE (Vstandard_display_table), | 761 | Lisp_Object dv = DISP_CHAR_VECTOR (XCHAR_TABLE (Vstandard_display_table), |
| @@ -1024,6 +1024,8 @@ void | |||
| 1024 | syms_of_doc (void) | 1024 | syms_of_doc (void) |
| 1025 | { | 1025 | { |
| 1026 | DEFSYM (Qfunction_documentation, "function-documentation"); | 1026 | DEFSYM (Qfunction_documentation, "function-documentation"); |
| 1027 | DEFSYM (Qgrave, "grave"); | ||
| 1028 | DEFSYM (Qstraight, "straight"); | ||
| 1027 | 1029 | ||
| 1028 | DEFVAR_LISP ("internal-doc-file-name", Vdoc_file_name, | 1030 | DEFVAR_LISP ("internal-doc-file-name", Vdoc_file_name, |
| 1029 | doc: /* Name of file containing documentation strings of built-in symbols. */); | 1031 | doc: /* Name of file containing documentation strings of built-in symbols. */); |
| @@ -1033,15 +1035,14 @@ syms_of_doc (void) | |||
| 1033 | doc: /* A list of files used to build this Emacs binary. */); | 1035 | doc: /* A list of files used to build this Emacs binary. */); |
| 1034 | Vbuild_files = Qnil; | 1036 | Vbuild_files = Qnil; |
| 1035 | 1037 | ||
| 1036 | DEFVAR_LISP ("help-quote-translation", Vhelp_quote_translation, | 1038 | DEFVAR_LISP ("text-quoting-style", Vtext_quoting_style, |
| 1037 | doc: /* Style to use for single quotes in help. | 1039 | doc: /* Style to use for single quotes when generating text. |
| 1038 | The value is a left single quote character of some style. | 1040 | ‘curve’ means quote with curved single quotes \\=‘like this\\=’. |
| 1039 | Quote \\=‘like this\\=’ if the value is ?\\=‘ (left single quotation mark). | 1041 | ‘straight’ means quote with straight apostrophes 'like this'. |
| 1040 | Quote 'like this' if the value is ?' (apostrophe). | 1042 | ‘grave’ means quote with grave accent and apostrophe \\=`like this'. |
| 1041 | Quote \\=`like this' if the value is ?\\=` (grave accent). | 1043 | The default value nil acts like ‘curve’ if curved single quotes are |
| 1042 | The default value is nil, which means quote with left single quotation mark | 1044 | displayable, and like ‘grave’ otherwise. */); |
| 1043 | if displayable, and with grave accent otherwise. */); | 1045 | Vtext_quoting_style = Qnil; |
| 1044 | Vhelp_quote_translation = Qnil; | ||
| 1045 | 1046 | ||
| 1046 | defsubr (&Sdocumentation); | 1047 | defsubr (&Sdocumentation); |
| 1047 | defsubr (&Sdocumentation_property); | 1048 | defsubr (&Sdocumentation_property); |