@strong{Please note:} Each @samp{\} must be doubled when written in a
string in Emacs Lisp.
-@defvar help-quote-translation
+@defvar text-quoting-style
@cindex curved quotes
@cindex curly quotes
The value of this variable specifies the style
@code{substitute-command-keys} uses when generating left and right
-quotes. If the variable's value is @code{?‘} (U+2018 LEFT SINGLE
-QUOTATION MARK), the style is @t{‘like this’} with curved single
-quotes. If the value is @code{?'} (apostrophe), the style is @t{'like
-this'} with apostrophes. If the value is @code{?`} (grave accent),
-the style is @t{`like this'} with grave accent and apostrophe. The
-default value @code{nil} means to use curved single quotes if
-displayable, and grave accent and apostrophe otherwise.
+quotes. 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{grave}, the style is @t{`like
+this'} with grave accent and apostrophe. The default value @code{nil}
+acts like @code{curve} if curved single quotes are displayable, and
+like @code{grave} otherwise.
@end defvar
@defun substitute-command-keys string
+++
** substitute-command-keys now replaces quotes.
That is, it converts documentation strings' quoting style as per the
-value of the new custom variable ‘help-quote-translation’: ?‘ means
-use curved quotes (also known as curly quotes) ‘like this’, ?' means
-use apostrophes 'like this', ?` means use grave accent and apostrophe
-`like this', and nil (default) means use curved quotes if displayable
-and grave accent and apostrophe otherwise. Doc strings in source code
-can use either curved quotes or grave accent and apostrophe. As
-before, isolated apostrophes and characters preceded by \= are output
-as-is.
+value of the new custom variable ‘text-quoting-style’: ‘curve’ means
+use curved quotes (also known as curly quotes) ‘like this’, ‘straight’
+means use straight apostrophes 'like this', ‘grave’ means use grave
+accent and apostrophe `like this', and nil (default) means use curved
+quotes if displayable and grave accent and apostrophe otherwise. Doc
+strings in source code can use either curved quotes or grave accent
+and apostrophe. As before, isolated apostrophes and characters
+preceded by \= are output as-is.
+++
** The character classes [:alpha:] and [:alnum:] in regular expressions
into documentation by typing ` and '. Outside Electric Quote mode,
you can enter them by typing ‘C-x 8 [’ and ‘C-x 8 ]’, or (if your Alt
key works) by typing ‘A-[’ and ‘A-]’. As described above under
-‘help-quote-translation’, the user can specify how to display doc
-string quotes.
+‘text-quoting-style’, the user can specify how to display doc string
+quotes.
+++
** show-help-function's arg is converted via substitute-command-keys
(no-redraw-on-reenter display boolean)
;; doc.c
- (help-quote-translation help
- (choice
- (character :tag "Quote with curved quotes"
- :value ?‘)
- (character :tag "Quote 'like this'" :value ?\')
- (character :tag "Quote `like this'" :value ?\`)
- (const :tag "Quote with curved quotes if displayable, 'like this' otherwise" nil))
- "25.1")
+ (text-quoting-style
+ help
+ (choice
+ (const :tag "Quote with curved single quotes" curve)
+ (const :tag "Quote with straight apostrophes 'like this'"
+ straight)
+ (const :tag "Quote with grave accent and apostrophe `like this'"
+ grave)
+ (const :tag "Use curved quotes if displayable, grave accent and apostrophe otherwise" nil))
+ "25.1")
;; dosfns.c
(dos-display-scancodes display boolean)
(dos-hyper-key keyboard integer)
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
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),
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. */);
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);