aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorAlan Mackenzie2017-09-21 20:31:06 +0000
committerAlan Mackenzie2017-10-01 11:27:15 +0000
commitd5e4e004fa134cb81989bcf40c5d6c79b837301f (patch)
tree7588a351b8bd89612cdb457979f84b5f9f90c826 /doc
parent1ba3471b9b443f0617662f4a50439bec211162ba (diff)
downloademacs-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.texi15
-rw-r--r--doc/lispref/control.texi3
-rw-r--r--doc/lispref/display.texi3
-rw-r--r--doc/lispref/help.texi31
-rw-r--r--doc/lispref/strings.texi7
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
1552Emacs tries to determine if the curved quotes @samp{‘} and @samp{’}
1553can be displayed on the current display. By default, if this seems to
1554be so, then Emacs will translate the @acronym{ASCII} quotes (@samp{`}
1555and @samp{'}), when they appear in messages and help texts, to these
1556curved quotes. You can influence or inhibit this translation by
1557customizing the user option @code{text-quoting-style} (@pxref{Keys in
1558Documentation,,, 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
1552known to look just like @acronym{ASCII} characters, they are shown 1561known to look just like @acronym{ASCII} characters, they are shown
1553with the @code{homoglyph} face. Curved quotes that cannot be 1562with the @code{homoglyph} face. Curved quotes that are known not to
1554displayed are shown as their @acronym{ASCII} approximations @samp{`}, 1563be 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
1108quotes. In contrast, a call using a format like @t{"Missing '%s'"} 1108quotes. In contrast, a call using a format like @t{"Missing '%s'"}
1109with only apostrophes typically generates a message like @t{"Missing 1109with 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.
1111One 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
1113verbatim, don't just write @code{(error @var{string})}. If @var{string} 1116verbatim, 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
272quotes. In contrast, a call using a format like @t{"Missing '%s'"} 272quotes. In contrast, a call using a format like @t{"Missing '%s'"}
273with only apostrophes typically generates a message like @t{"Missing 273with 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.
275One 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
276In batch mode, the message is printed to the standard error stream, 279In batch mode, the message is printed to the standard error stream,
277followed by a newline. 280followed 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
352string in Emacs Lisp. 352string 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
357The value of this variable is a symbol that specifies the style Emacs 357The value of this variable is a symbol that specifies the style Emacs
358should use for single quotes in the wording of help and messages. 358should use for single quotes in the wording of help and messages. If
359If the variable's value is @code{curve}, the style is 359the variable's value is @code{curve}, the style is @t{‘like this’}
360@t{‘like this’} with curved single quotes. If the value is 360with curved single quotes. If the value is @code{straight}, the style
361@code{straight}, the style is @t{'like this'} with straight 361is @t{'like this'} with straight apostrophes. If the value is
362apostrophes. If the value is @code{grave}, 362@code{nil} or @code{grave}, quotes are not translated and the style is
363quotes are not translated and the style is @t{`like 363@t{`like this'} with grave accent and apostrophe, the standard style
364this'} with grave accent and apostrophe, the standard style 364before Emacs version 25. The default value @code{t} acts like
365before Emacs version 25. The default value @code{nil} 365@code{curve} if curved single quotes seem to be displayable, and like
366acts like @code{curve} if curved single quotes are displayable, and 366@code{nil} otherwise.
367like @code{grave} otherwise. 367
368 368This option is useful on platforms that have problems with curved
369This variable can be used by experts on platforms that have problems 369quotes. You can customize it freely according to your personal
370with curved quotes. As it is not intended for casual use, it is not a 370preference.
371user option. 371@end defopt
372@end defvar
373 372
374@defun substitute-command-keys string 373@defun substitute-command-keys string
375This function scans @var{string} for the above special sequences and 374This 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
835this'} typically generates curved quotes @t{‘like this’}. In 835this'} typically generates curved quotes @t{‘like this’}. In
836contrast, a format that quotes with only apostrophes @t{'like this'} 836contrast, a format that quotes with only apostrophes @t{'like this'}
837typically generates two closing curved quotes @t{’like this’}, an 837typically generates two closing curved quotes @t{’like this’}, an
838unusual style in English. @xref{Keys in Documentation}, for how the 838unusual 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
841characters to be output unchanged. @xref{Keys in Documentation}, for
842how 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