aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorPaul Eggert2015-06-19 00:35:43 -0700
committerPaul Eggert2015-06-19 00:38:45 -0700
commitc4151ebe15479de4c2e511b068cdf9af6a4576cf (patch)
tree14933519830d5da23b6962cdaff705081eb85313 /doc
parentaad7ea32c57c7b9673a8d429524e050dac2d210c (diff)
downloademacs-c4151ebe15479de4c2e511b068cdf9af6a4576cf.tar.gz
emacs-c4151ebe15479de4c2e511b068cdf9af6a4576cf.zip
Improve the optional translation of quotes
Fix several problems with the recently-added custom variable help-quote-translation where the code would quote inconsistently in help buffers. Add support for quoting 'like this', which is common in other GNU programs in ASCII environments. Change help-quote-translation to use more mnemonic values: values are now the initial quoting char, e.g., (setq help-quote-translation ?`) gets the traditional Emacs help-buffer quoting style `like this'. Change the default behavior of substitute-command-keys to match what's done in set-locale-environment, i.e., quote ‘like this’ if displayable, 'like this' otherwise. * doc/lispref/help.texi (Keys in Documentation): Document new behavior of substitute-command-keys, and document help-quote-translation. * doc/lispref/tips.texi (Documentation Tips): Mention the effect of help-quote-translation. * etc/NEWS: Mention new behavior of substitute-command-keys, and merge help-quote-translation news into it. When talking about doc strings, mention new ways to type quotes. * lisp/cedet/mode-local.el (overload-docstring-extension): Revert my recent change to this function, which shouldn't be needed as the result is a doc string. * lisp/cedet/mode-local.el (mode-local-print-binding) (mode-local-describe-bindings-2): * lisp/cedet/srecode/srt-mode.el (srecode-macro-help): * lisp/cus-theme.el (describe-theme-1): * lisp/descr-text.el (describe-text-properties-1, describe-char): * lisp/emacs-lisp/cl-generic.el (cl--generic-describe): * lisp/emacs-lisp/eieio-opt.el (eieio-help-class) (eieio-help-constructor): * lisp/emacs-lisp/package.el (describe-package-1): * lisp/faces.el (describe-face): * lisp/help-fns.el (help-fns--key-bindings) (help-fns--compiler-macro, help-fns--parent-mode) (help-fns--obsolete, help-fns--interactive-only) (describe-function-1, describe-variable): * lisp/help.el (describe-mode): Use substitute-command-keys to ensure a more-consistent quoting style in help buffers. * lisp/cus-start.el (standard): Document new help-quote-translation behavior. * lisp/emacs-lisp/lisp-mode.el (lisp-fdefs): * lisp/help-mode.el (help-xref-symbol-regexp, help-xref-info-regexp) (help-xref-url-regexp): * lisp/international/mule-cmds.el (help-xref-mule-regexp-template): * lisp/wid-edit.el (widget-documentation-link-regexp): Also match 'foo', in case we're in a help buffer generated when help-quote-translation is ?'. * src/doc.c: Include disptab.h, for DISP_CHAR_VECTOR. (LEFT_SINGLE_QUOTATION_MARK, uLSQM0, uLSQM1, uLSQM2, uRSQM0) (uRSQM1, uRSQM2, LSQM, RSQM): New constants. (Fsubstitute_command_keys): Document and implement new behavior. (Vhelp_quote_translation): Document new behavior.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/help.texi29
-rw-r--r--doc/lispref/tips.texi8
2 files changed, 32 insertions, 5 deletions
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi
index ce29f3f5bc3..44a680c4a22 100644
--- a/doc/lispref/help.texi
+++ b/doc/lispref/help.texi
@@ -319,10 +319,22 @@ specifies @var{mapvar}'s value as the keymap for any following
319@samp{\[@var{command}]} sequences in this documentation string. 319@samp{\[@var{command}]} sequences in this documentation string.
320 320
321@item ` 321@item `
322(grave accent) stands for a left single quotation mark (@samp{‘}). 322(grave accent) stands for a left quote, and alters the interpretation
323of the next unmatched apostrophe.
323 324
324@item ' 325@item '
325(apostrophe) stands for a right single quotation mark (@samp{’}) if 326(apostrophe) stands for a right quote if preceded by grave accent and
327there are no intervening apostrophes. Otherwise, apostrophe stands
328for itself.
329
330@item ‘
331(left single quotation mark) stands for a left quote.
332
333@item ’
334(right single quotation mark) stands for a right quote.
335
336@item '
337(apostrophe) stands for a right quote if
326preceded by grave accent and there are no intervening apostrophes. 338preceded by grave accent and there are no intervening apostrophes.
327Otherwise, apostrophe stands for itself. 339Otherwise, apostrophe stands for itself.
328 340
@@ -335,6 +347,19 @@ and @samp{\=\=} puts @samp{\=} into the output.
335@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
336string in Emacs Lisp. 348string in Emacs Lisp.
337 349
350@defvar help-quote-translation
351@cindex curved quotes
352The value of this variable specifies the style
353@code{substitute-command-keys} uses when generating left and right
354quotes. If the variable's value is @code{?‘} (U+2018 LEFT SINGLE
355QUOTATION MARK), the style is @t{‘like this’} with curved single
356quotes. If the value is @code{?'} (apostrophe), the style is @t{'like
357this'} with apostrophes. If the value is @code{?`} (grave accent),
358the style is @t{`like this'} with grave accent and apostrophe. The
359default value @code{nil} means to use curved single quotes if
360displayable and apostrophes otherwise.
361@end defvar
362
338@defun substitute-command-keys string 363@defun substitute-command-keys string
339This function scans @var{string} for the above special sequences and 364This function scans @var{string} for the above special sequences and
340replaces them by what they stand for, returning the result as a string. 365replaces them by what they stand for, returning the result as a string.
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi
index 9144497d5f1..7107bb45872 100644
--- a/doc/lispref/tips.texi
+++ b/doc/lispref/tips.texi
@@ -671,9 +671,11 @@ Documentation strings can also use an older single-quoting convention,
671which quotes symbols with grave accent @t{`} and apostrophe 671which quotes symbols with grave accent @t{`} and apostrophe
672@t{'}: @t{`like-this'} rather than @t{‘like-this’}. This 672@t{'}: @t{`like-this'} rather than @t{‘like-this’}. This
673older convention was designed for now-obsolete displays in which grave 673older convention was designed for now-obsolete displays in which grave
674accent and apostrophe were mirror images. Documentation in this older 674accent and apostrophe were mirror images.
675convention is converted to the standard convention when it is copied 675
676into a help buffer. @xref{Keys in Documentation}. 676Documentation using either convention is converted to the user's
677preferred format when it is copied into a help buffer. @xref{Keys in
678Documentation}.
677 679
678@cindex hyperlinks in documentation strings 680@cindex hyperlinks in documentation strings
679Help mode automatically creates a hyperlink when a documentation string 681Help mode automatically creates a hyperlink when a documentation string