aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorAlan Mackenzie2017-09-30 11:08:16 +0000
committerAlan Mackenzie2017-10-01 11:27:16 +0000
commit8c18dcbc784a97196d6513e5556de48af4cea617 (patch)
treec929074b0c9d9e6eabbefac9326c90dc4511d06c /doc
parent5f76ac150a28e4de940790f96f0f751c8ee5d4c7 (diff)
downloademacs-8c18dcbc784a97196d6513e5556de48af4cea617.tar.gz
emacs-8c18dcbc784a97196d6513e5556de48af4cea617.zip
Amend documentation for text-quoting-style becoming a user option.
* doc/lispref/control.texi (Signaling Errors): * doc/lispref/display.texi (Displaying Messages): * doc/lispref/strings.texi (Formatting Strings): Edit for brevity, farming out the details to the new Text Quoting Style node. * doc/lispref/help.texi (Text Quoting Style): New section. Move detailed discussion of text-quoting-style here. Add discussion about how to output grave accent and apostrophe in documentation and messages. Adjust xrefs to point to this section when appropriate. * etc/NEWS: text-quoting-style semantics have not changed.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/control.texi14
-rw-r--r--doc/lispref/display.texi16
-rw-r--r--doc/lispref/elisp.texi1
-rw-r--r--doc/lispref/help.texi49
-rw-r--r--doc/lispref/strings.texi14
-rw-r--r--doc/lispref/syntax.texi13
6 files changed, 70 insertions, 37 deletions
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index c39e035459e..4eddbe9c122 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -1101,16 +1101,10 @@ These examples show typical uses of @code{error}:
1101error symbol @code{error}, and a list containing the string returned by 1101error symbol @code{error}, and a list containing the string returned by
1102@code{format-message}. 1102@code{format-message}.
1103 1103
1104The @code{text-quoting-style} variable controls what quotes are 1104Typically grave accent and apostrophe in the format translate to
1105generated; @xref{Keys in Documentation}. A call using a format like 1105matching curved quotes, e.g., @t{"Missing `%s'"} might result in
1106@t{"Missing `%s'"} with grave accents and apostrophes typically 1106@t{"Missing ‘foo’"}. @xref{Text Quoting Style}, for how to influence
1107generates a message like @t{"Missing ‘foo’"} with matching curved 1107or inhibit this translation.
1108quotes. In contrast, a call using a format like @t{"Missing '%s'"}
1109with only apostrophes typically generates a message like @t{"Missing
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
1112the symbol @code{grave} around the call to @code{error}; this causes
1113@acronym{ASCII} quote characters to be output unchanged.
1114 1108
1115@strong{Warning:} If you want to use your own string as an error message 1109@strong{Warning:} If you want to use your own string as an error message
1116verbatim, don't just write @code{(error @var{string})}. If @var{string} 1110verbatim, don't just write @code{(error @var{string})}. If @var{string}
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 62b136f6c60..afd09cfb330 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -265,16 +265,10 @@ properties, it is displayed with the specified faces (@pxref{Faces}).
265The string is also added to the @file{*Messages*} buffer, but without 265The string is also added to the @file{*Messages*} buffer, but without
266text properties (@pxref{Logging Messages}). 266text properties (@pxref{Logging Messages}).
267 267
268The @code{text-quoting-style} variable controls what quotes are 268Typically grave accent and apostrophe in the format translate to
269generated; @xref{Keys in Documentation}. A call using a format like 269matching curved quotes, e.g., @t{"Missing `%s'"} might result in
270@t{"Missing `%s'"} with grave accents and apostrophes typically 270@t{"Missing ‘foo’"}. @xref{Text Quoting Style}, for how to influence
271generates a message like @t{"Missing ‘foo’"} with matching curved 271or inhibit this translation.
272quotes. In contrast, a call using a format like @t{"Missing '%s'"}
273with only apostrophes typically generates a message like @t{"Missing
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
276the symbol @code{grave} around calls to @code{message}; this causes
277@acronym{ASCII} quote characters to be output unchanged.
278 272
279In batch mode, the message is printed to the standard error stream, 273In batch mode, the message is printed to the standard error stream,
280followed by a newline. 274followed by a newline.
@@ -7038,7 +7032,7 @@ window display table nor a buffer display table defined, or when Emacs
7038is outputting text to the standard output or error streams. Although its 7032is outputting text to the standard output or error streams. Although its
7039default is typically @code{nil}, in an interactive session if the 7033default is typically @code{nil}, in an interactive session if the
7040terminal cannot display curved quotes, its default maps curved quotes 7034terminal cannot display curved quotes, its default maps curved quotes
7041to ASCII approximations. @xref{Keys in Documentation}. 7035to ASCII approximations. @xref{Text Quoting Style}.
7042@end defvar 7036@end defvar
7043 7037
7044The @file{disp-table} library defines several functions for changing 7038The @file{disp-table} library defines several functions for changing
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index 4cbcdf855d1..c7525945845 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -940,6 +940,7 @@ Documentation
940* Documentation Basics:: Where doc strings are defined and stored. 940* Documentation Basics:: Where doc strings are defined and stored.
941* Accessing Documentation:: How Lisp programs can access doc strings. 941* Accessing Documentation:: How Lisp programs can access doc strings.
942* Keys in Documentation:: Substituting current key bindings. 942* Keys in Documentation:: Substituting current key bindings.
943* Text Quoting Style:: Quotation marks in doc strings and messages.
943* Describing Characters:: Making printable descriptions of 944* Describing Characters:: Making printable descriptions of
944 non-printing characters and key sequences. 945 non-printing characters and key sequences.
945* Help Functions:: Subroutines used by Emacs help facilities. 946* Help Functions:: Subroutines used by Emacs help facilities.
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi
index 74dc6dac9cb..4aa9b95180e 100644
--- a/doc/lispref/help.texi
+++ b/doc/lispref/help.texi
@@ -33,6 +33,7 @@ Help, emacs, The GNU Emacs Manual}.
33* Documentation Basics:: Where doc strings are defined and stored. 33* Documentation Basics:: Where doc strings are defined and stored.
34* Accessing Documentation:: How Lisp programs can access doc strings. 34* Accessing Documentation:: How Lisp programs can access doc strings.
35* Keys in Documentation:: Substituting current key bindings. 35* Keys in Documentation:: Substituting current key bindings.
36* Text Quoting Style:: Quotation marks in doc strings and messages.
36* Describing Characters:: Making printable descriptions of 37* Describing Characters:: Making printable descriptions of
37 non-printing characters and key sequences. 38 non-printing characters and key sequences.
38* Help Functions:: Subroutines used by Emacs help facilities. 39* Help Functions:: Subroutines used by Emacs help facilities.
@@ -336,6 +337,7 @@ specifies @var{mapvar}'s value as the keymap for any following
336(grave accent) stands for a left quote. 337(grave accent) stands for a left quote.
337This generates a left single quotation mark, an apostrophe, or a grave 338This generates a left single quotation mark, an apostrophe, or a grave
338accent depending on the value of @code{text-quoting-style}. 339accent depending on the value of @code{text-quoting-style}.
340@xref{Text Quoting Style}.
339 341
340@item ' 342@item '
341(apostrophe) stands for a right quote. 343(apostrophe) stands for a right quote.
@@ -428,6 +430,53 @@ C-g abort-recursive-edit
428strings---for instance, you can refer to functions, variables, and 430strings---for instance, you can refer to functions, variables, and
429sections of this manual. @xref{Documentation Tips}, for details. 431sections of this manual. @xref{Documentation Tips}, for details.
430 432
433@node Text Quoting Style
434@section Text Quoting Style
435
436 Typically, grave accents and apostrophes are treated specially in
437documentation strings and diagnostic messages, and translate to matching
438single quotation marks (also called ``curved quotes''). For example,
439the documentation string @t{"Alias for `foo'."} and the function call
440@code{(message "Alias for `foo'.")} both translate to @t{"Alias for
441‘foo’."}. Less commonly, Emacs displays grave accents and apostrophes
442as themselves, or as apostrophes only (e.g., @t{"Alias for 'foo'."}).
443Documentation strings and message formats should be written so that
444they display well with any of these styles. For example, the
445documentation string @t{"Alias for 'foo'."} is probably not what you
446want, as it can display as @t{"Alias for ’foo’."}, an unusual style in
447English.
448
449 Sometimes you may need to display a grave accent or apostrophe
450without translation, regardless of text quoting style. In a
451documentation string, you can do this with escapes. For example, in
452the documentation string @t{"\\=`(a ,(sin 0)) ==> (a 0.0)"} the grave
453accent is intended to denote Lisp code, so it is escaped and displays
454as itself regardless of quoting style. In a call to @code{message} or
455@code{error}, you can avoid translation by using a format @t{"%s"}
456with an argument that is a call to @code{format}. For example,
457@code{(message "%s" (format "`(a ,(sin %S)) ==> (a %S)" x (sin x)))}
458displays a message that starts with grave accent regardless of text
459quoting style.
460
461@defopt text-quoting-style
462@cindex curved quotes
463@cindex curly quotes
464The value of this user option is a symbol that specifies the style
465Emacs should use for single quotes in the wording of help and
466messages. If the option's value is @code{curve}, the style is
467@t{‘like this’} with curved single quotes. If the value is
468@code{straight}, the style is @t{'like this'} with straight
469apostrophes. If the value is @code{grave}, quotes are not translated
470and the style is @t{`like this'} with grave accent and apostrophe, the
471standard style before Emacs version 25. The default value @code{nil}
472acts like @code{curve} if curved single quotes seem to be displayable,
473and like @code{grave} otherwise.
474
475This option is useful on platforms that have problems with curved
476quotes. You can customize it freely according to your personal
477preference.
478@end defopt
479
431@node Describing Characters 480@node Describing Characters
432@section Describing Characters for Help Messages 481@section Describing Characters for Help Messages
433@cindex describe characters and events 482@cindex describe characters and events
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index 10385e05501..dd004927caf 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -826,20 +826,14 @@ to the produced string representations of the argument @var{objects}.
826@defun format-message string &rest objects 826@defun format-message string &rest objects
827@cindex curved quotes, in formatted messages 827@cindex curved quotes, in formatted messages
828@cindex curly quotes, in formatted messages 828@cindex curly quotes, in formatted messages
829@cindex @code{text-quoting-style}, and formatting messages
830This function acts like @code{format}, except it also converts any 829This function acts like @code{format}, except it also converts any
831grave accents (@t{`}) and apostrophes (@t{'}) in @var{string} as per the 830grave accents (@t{`}) and apostrophes (@t{'}) in @var{string} as per the
832value of @code{text-quoting-style}. 831value of @code{text-quoting-style}.
833 832
834A format that quotes with grave accents and apostrophes @t{`like 833Typically grave accent and apostrophe in the format translate to
835this'} typically generates curved quotes @t{‘like this’}. In 834matching curved quotes, e.g., @t{"Missing `%s'"} might result in
836contrast, a format that quotes with only apostrophes @t{'like this'} 835@t{"Missing ‘foo’"}. @xref{Text Quoting Style}, for how to influence
837typically generates two closing curved quotes @t{’like this’}, an 836or inhibit this translation.
838unusual style in English. One way around such problems is to bind
839@code{text-quoting-style} to the symbol @code{grave} around calls to
840@code{format-message}; this causes @acronym{ASCII} quoting characters
841to be output unchanged. @xref{Keys in Documentation}, for how the
842@code{text-quoting-style} variable affects generated quotes.
843@end defun 837@end defun
844 838
845@cindex @samp{%} in format 839@cindex @samp{%} in format
diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi
index e3ae53536f9..b37f2b22b82 100644
--- a/doc/lispref/syntax.texi
+++ b/doc/lispref/syntax.texi
@@ -751,7 +751,8 @@ position. This function does that conveniently.
751 751
752@defun syntax-ppss &optional pos 752@defun syntax-ppss &optional pos
753This function returns the parser state that the parser would reach at 753This function returns the parser state that the parser would reach at
754position @var{pos} starting from the beginning of the buffer. 754position @var{pos} starting from the beginning of the visible portion
755of the buffer.
755@iftex 756@iftex
756See the next section for 757See the next section for
757@end iftex 758@end iftex
@@ -762,11 +763,11 @@ for a description of the parser state.
762 763
763The return value is the same as if you call the low-level parsing 764The return value is the same as if you call the low-level parsing
764function @code{parse-partial-sexp} to parse from the beginning of the 765function @code{parse-partial-sexp} to parse from the beginning of the
765buffer to @var{pos} (@pxref{Low-Level Parsing}). However, 766visible portion of the buffer to @var{pos} (@pxref{Low-Level
766@code{syntax-ppss} uses a cache to speed up the computation. Due to 767Parsing}). However, @code{syntax-ppss} uses caches to speed up the
767this optimization, the second value (previous complete subexpression) 768computation. Due to this optimization, the second value (previous
768and sixth value (minimum parenthesis depth) in the returned parser 769complete subexpression) and sixth value (minimum parenthesis depth) in
769state are not meaningful. 770the returned parser state are not meaningful.
770 771
771This function has a side effect: it adds a buffer-local entry to 772This function has a side effect: it adds a buffer-local entry to
772@code{before-change-functions} (@pxref{Change Hooks}) for 773@code{before-change-functions} (@pxref{Change Hooks}) for