diff options
| author | Alan Mackenzie | 2017-09-21 20:31:06 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2017-10-01 11:27:15 +0000 |
| commit | d5e4e004fa134cb81989bcf40c5d6c79b837301f (patch) | |
| tree | 7588a351b8bd89612cdb457979f84b5f9f90c826 /doc | |
| parent | 1ba3471b9b443f0617662f4a50439bec211162ba (diff) | |
| download | emacs-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 'doc')
| -rw-r--r-- | doc/emacs/display.texi | 15 | ||||
| -rw-r--r-- | doc/lispref/control.texi | 3 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 3 | ||||
| -rw-r--r-- | doc/lispref/help.texi | 31 | ||||
| -rw-r--r-- | doc/lispref/strings.texi | 7 |
5 files changed, 38 insertions, 21 deletions
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index 6afd8366b25..5860bacb9d8 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi | |||
| @@ -1548,11 +1548,20 @@ for details. | |||
| 1548 | @cindex curly quotes | 1548 | @cindex curly quotes |
| 1549 | @cindex curved quotes | 1549 | @cindex curved quotes |
| 1550 | @cindex homoglyph face | 1550 | @cindex homoglyph face |
| 1551 | |||
| 1552 | Emacs tries to determine if the curved quotes @samp{‘} and @samp{’} | ||
| 1553 | can be displayed on the current display. By default, if this seems to | ||
| 1554 | be so, then Emacs will translate the @acronym{ASCII} quotes (@samp{`} | ||
| 1555 | and @samp{'}), when they appear in messages and help texts, to these | ||
| 1556 | curved quotes. You can influence or inhibit this translation by | ||
| 1557 | customizing the user option @code{text-quoting-style} (@pxref{Keys in | ||
| 1558 | Documentation,,, elisp, The Emacs Lisp Reference Manual}). | ||
| 1559 | |||
| 1551 | If the curved quotes @samp{‘}, @samp{’}, @samp{“}, and @samp{”} are | 1560 | If the curved quotes @samp{‘}, @samp{’}, @samp{“}, and @samp{”} are |
| 1552 | known to look just like @acronym{ASCII} characters, they are shown | 1561 | known to look just like @acronym{ASCII} characters, they are shown |
| 1553 | with the @code{homoglyph} face. Curved quotes that cannot be | 1562 | with the @code{homoglyph} face. Curved quotes that are known not to |
| 1554 | displayed are shown as their @acronym{ASCII} approximations @samp{`}, | 1563 | be displayable are shown as their @acronym{ASCII} approximations |
| 1555 | @samp{'}, and @samp{"} with the @code{homoglyph} face. | 1564 | @samp{`}, @samp{'}, and @samp{"} with the @code{homoglyph} face. |
| 1556 | 1565 | ||
| 1557 | @node Cursor Display | 1566 | @node Cursor Display |
| 1558 | @section Displaying the Cursor | 1567 | @section Displaying the Cursor |
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index 401a999cf23..09435f57966 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi | |||
| @@ -1108,6 +1108,9 @@ generates a message like @t{"Missing ‘foo’"} with matching curved | |||
| 1108 | quotes. In contrast, a call using a format like @t{"Missing '%s'"} | 1108 | quotes. In contrast, a call using a format like @t{"Missing '%s'"} |
| 1109 | with only apostrophes typically generates a message like @t{"Missing | 1109 | with only apostrophes typically generates a message like @t{"Missing |
| 1110 | ’foo’"} with only closing curved quotes, an unusual style in English. | 1110 | ’foo’"} with only closing curved quotes, an unusual style in English. |
| 1111 | One way around this problem is to bind @code{text-quoting-style} to | ||
| 1112 | @code{nil} around the call to @code{error}; this causes the | ||
| 1113 | @acronym{ASCII} quote characters to be output unchanged. | ||
| 1111 | 1114 | ||
| 1112 | @strong{Warning:} If you want to use your own string as an error message | 1115 | @strong{Warning:} If you want to use your own string as an error message |
| 1113 | verbatim, don't just write @code{(error @var{string})}. If @var{string} | 1116 | verbatim, don't just write @code{(error @var{string})}. If @var{string} |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 3dae984f339..8f58fca506f 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -272,6 +272,9 @@ generates a message like @t{"Missing ‘foo’"} with matching curved | |||
| 272 | quotes. In contrast, a call using a format like @t{"Missing '%s'"} | 272 | quotes. In contrast, a call using a format like @t{"Missing '%s'"} |
| 273 | with only apostrophes typically generates a message like @t{"Missing | 273 | with only apostrophes typically generates a message like @t{"Missing |
| 274 | ’foo’"} with only closing curved quotes, an unusual style in English. | 274 | ’foo’"} with only closing curved quotes, an unusual style in English. |
| 275 | One way around this problem is to bind @code{text-quoting-style} to | ||
| 276 | @code{nil} around calls to @code{message}; this causes the | ||
| 277 | @acronym{ASCII} quote characters to be output unchanged. | ||
| 275 | 278 | ||
| 276 | In batch mode, the message is printed to the standard error stream, | 279 | In batch mode, the message is printed to the standard error stream, |
| 277 | followed by a newline. | 280 | followed by a newline. |
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index cb214113523..e1e98124e08 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi | |||
| @@ -351,25 +351,24 @@ and @samp{\=\=} puts @samp{\=} into the output. | |||
| 351 | @strong{Please note:} Each @samp{\} must be doubled when written in a | 351 | @strong{Please note:} Each @samp{\} must be doubled when written in a |
| 352 | string in Emacs Lisp. | 352 | string in Emacs Lisp. |
| 353 | 353 | ||
| 354 | @defvar text-quoting-style | 354 | @defopt text-quoting-style |
| 355 | @cindex curved quotes | 355 | @cindex curved quotes |
| 356 | @cindex curly quotes | 356 | @cindex curly quotes |
| 357 | The value of this variable is a symbol that specifies the style Emacs | 357 | The value of this variable is a symbol that specifies the style Emacs |
| 358 | should use for single quotes in the wording of help and messages. | 358 | should use for single quotes in the wording of help and messages. If |
| 359 | If the variable's value is @code{curve}, the style is | 359 | the variable's value is @code{curve}, the style is @t{‘like this’} |
| 360 | @t{‘like this’} with curved single quotes. If the value is | 360 | with curved single quotes. If the value is @code{straight}, the style |
| 361 | @code{straight}, the style is @t{'like this'} with straight | 361 | is @t{'like this'} with straight apostrophes. If the value is |
| 362 | apostrophes. If the value is @code{grave}, | 362 | @code{nil} or @code{grave}, quotes are not translated and the style is |
| 363 | quotes are not translated and the style is @t{`like | 363 | @t{`like this'} with grave accent and apostrophe, the standard style |
| 364 | this'} with grave accent and apostrophe, the standard style | 364 | before Emacs version 25. The default value @code{t} acts like |
| 365 | before Emacs version 25. The default value @code{nil} | 365 | @code{curve} if curved single quotes seem to be displayable, and like |
| 366 | acts like @code{curve} if curved single quotes are displayable, and | 366 | @code{nil} otherwise. |
| 367 | like @code{grave} otherwise. | 367 | |
| 368 | 368 | This option is useful on platforms that have problems with curved | |
| 369 | This variable can be used by experts on platforms that have problems | 369 | quotes. You can customize it freely according to your personal |
| 370 | with curved quotes. As it is not intended for casual use, it is not a | 370 | preference. |
| 371 | user option. | 371 | @end defopt |
| 372 | @end defvar | ||
| 373 | 372 | ||
| 374 | @defun substitute-command-keys string | 373 | @defun substitute-command-keys string |
| 375 | This function scans @var{string} for the above special sequences and | 374 | This function scans @var{string} for the above special sequences and |
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index 219225d412b..117a373a190 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi | |||
| @@ -835,8 +835,11 @@ A format that quotes with grave accents and apostrophes @t{`like | |||
| 835 | this'} typically generates curved quotes @t{‘like this’}. In | 835 | this'} typically generates curved quotes @t{‘like this’}. In |
| 836 | contrast, a format that quotes with only apostrophes @t{'like this'} | 836 | contrast, a format that quotes with only apostrophes @t{'like this'} |
| 837 | typically generates two closing curved quotes @t{’like this’}, an | 837 | typically generates two closing curved quotes @t{’like this’}, an |
| 838 | unusual style in English. @xref{Keys in Documentation}, for how the | 838 | unusual style in English. One way around such problems is to bind |
| 839 | @code{text-quoting-style} variable affects generated quotes. | 839 | @code{text-quoting-style} to @code{nil} around calls to |
| 840 | @code{format-message}; this causes the @acronym{ASCII} quoting | ||
| 841 | characters to be output unchanged. @xref{Keys in Documentation}, for | ||
| 842 | how the @code{text-quoting-style} variable affects generated quotes. | ||
| 840 | @end defun | 843 | @end defun |
| 841 | 844 | ||
| 842 | @cindex @samp{%} in format | 845 | @cindex @samp{%} in format |