From 84085e36a4765d2396c04da246b796a6f5fa7a49 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 17 Jun 2015 23:50:45 -0700 Subject: [PATCH] Document curved quotes a bit better * doc/emacs/basic.texi (Inserting Text): Mention C-x 8. Change example to use curved quote rather than infinity, as this lets us give more ways to do it. * doc/emacs/mule.texi (International Chars): Mention C-x 8 shortcuts and quotation marks. * doc/emacs/text.texi (Quotation Marks): * doc/lispref/tips.texi (Documentation Tips): Add "curly quotes" and "curved quotes" to the index. * doc/emacs/text.texi (Quotation Marks): Give the C-x 8 shorthands for curved quotes. Cross-reference to "Quotation Marks". --- doc/emacs/basic.texi | 39 ++++++++++++++++++++++++++++----------- doc/emacs/mule.texi | 7 +++++-- doc/emacs/text.texi | 5 ++++- doc/lispref/tips.texi | 12 ++++++++---- 4 files changed, 45 insertions(+), 18 deletions(-) diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi index cc9602e8c52..0a4391094b3 100644 --- a/doc/emacs/basic.texi +++ b/doc/emacs/basic.texi @@ -104,10 +104,22 @@ the letters @kbd{a} to @kbd{f} serve as part of a character code, just like digits. Case is ignored. @findex insert-char -@kindex C-x 8 RET +@kindex C-x 8 @cindex Unicode characters, inserting @cindex insert Unicode character @cindex characters, inserting by name or code-point +@cindex curly quotes +@cindex curved quotes + A few common Unicode characters can be inserted via a command +starting with @kbd{C-x 8}. For example, @kbd{C-x 8 [} inserts @t{‘} +which is Unicode code-point @code{U+2018} LEFT SINGLE QUOTATION MARK, +sometimes called a left single ``curved quote'' or ``curly quote''. +Similarly, @kbd{C-x 8 ]}, @kbd{C-x 8 @{} and @kbd{C-x 8 @}} insert the +curved quotes @t{’}, @t{“} and @t{”}, respectively. Also, a working +Alt key acts like @kbd{C-x 8}; e.g., @kbd{A-[} acts like @kbd{C-x 8 [} +and inserts @t{‘}. To see which characters have @kbd{C-x 8} +shorthands, type @kbd{C-x 8 C-h}. + Alternatively, you can use the command @kbd{C-x 8 @key{RET}} (@code{insert-char}). This prompts for the Unicode name or code-point of a character, using the minibuffer. If you enter a name, the @@ -116,16 +128,7 @@ code-point, it should be as a hexadecimal number (the convention for Unicode), or a number with a specified radix, e.g., @code{#o23072} (octal); @xref{Integer Basics,,, elisp, The Emacs Lisp Reference Manual}. The command then inserts the corresponding character into -the buffer. For example, both of the following insert the infinity -sign (Unicode code-point @code{U+221E}): - -@example -@kbd{C-x 8 @key{RET} infinity @key{RET}} -@kbd{C-x 8 @key{RET} 221e @key{RET}} -@end example - - A numeric argument to @kbd{C-q} or @kbd{C-x 8 @key{RET}} specifies -how many copies of the character to insert (@pxref{Arguments}). +the buffer. In some contexts, if you type a quotation using grave accent and apostrophe @t{`like this'}, it is converted to a form @t{‘like this’} @@ -133,6 +136,20 @@ using single quotation marks. Similarly, typing a quotation @t{``like this''} using double grave accent and apostrophe converts it to a form @t{“like this”} using double quotation marks. @xref{Quotation Marks}. + For example, the following all insert the same character: + +@example +@kbd{C-x 8 @key{RET} left single quotation mark @key{RET}} +@kbd{C-x 8 @key{RET} left sin @key{TAB} @key{RET}} +@kbd{C-x 8 @key{RET} 2018 @key{RET}} +@kbd{C-x 8 [} +@kbd{A-[} @r{(if the Alt key works)} +@kbd{`} @r{(in Electric Quote mode)} +@end example + + A numeric argument to @kbd{C-q} or @kbd{C-x 8 ...} specifies +how many copies of the character to insert (@pxref{Arguments}). + @node Moving Point @section Changing the Location of Point diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index 80b1384feb6..5a166d13124 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi @@ -136,8 +136,11 @@ displayed on your terminal, they appear as @samp{?} or as hollow boxes Keyboards, even in the countries where these character sets are used, generally don't have keys for all the characters in them. You can insert characters that your keyboard does not support, using -@kbd{C-q} (@code{quoted-insert}) or @kbd{C-x 8 @key{RET}} -(@code{insert-char}). @xref{Inserting Text}. Emacs also supports +@kbd{C-x 8 @key{RET}} (@code{insert-char}). @xref{Inserting Text}. +Shorthands are available for some common characters; for example, you +can insert a left single quotation mark @t{‘} by typing @kbd{C-x 8 +[}, or in Electric Quote mode often by simply typing @kbd{`}. +@xref{Quotation Marks}. Emacs also supports various @dfn{input methods}, typically one for each script or language, which make it easier to type characters in the script. @xref{Input Methods}. diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index d891cc16870..5a13f208876 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -410,6 +410,8 @@ beginning of a line. @cindex Quotation marks @cindex Electric Quote mode @cindex mode, Electric Quote +@cindex curly quotes +@cindex curved quotes @findex electric-quote-mode One common way to quote is the typewriter convention, which quotes using straight apostrophes @t{'like this'} or double-quotes @t{"like @@ -443,7 +445,8 @@ variables. @kbd{M-x electric-quote-local-mode}. To suppress it for a single use, type @kbd{C-q `} or @kbd{C-q '} instead of @kbd{`} or @kbd{'}. To insert a curved quote even when Electric Quote is disabled or -inactive, use @kbd{C-x 8 @key{RET}} (@code{insert-char}). +inactive, you can type @kbd{C-x 8 [} for @t{‘}, @kbd{C-x 8 ]} for +@t{’}, @kbd{C-x 8 @{} for @t{“}, and @kbd{C-x 8 @}} for @t{”}. @xref{Inserting Text}. @node Filling diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index 798b6700aac..9144497d5f1 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi @@ -657,15 +657,19 @@ starting double-quote is not part of the string! @anchor{Docstring hyperlinks} @item +@cindex curly quotes +@cindex curved quotes When a documentation string refers to a Lisp symbol, write it as it would be printed (which usually means in lower case), surrounding -it with curved single quotes (@samp{‘} and @samp{’}). There are +it with curved single quotes (@t{‘} and @t{’}). There are two exceptions: write @code{t} and @code{nil} without surrounding -punctuation. For example: @samp{CODE can be ‘lambda’, nil, or t.} +punctuation. For example: @samp{CODE can be ‘lambda’, nil, or t}. +@xref{Quotation Marks,,, emacs, The GNU Emacs Manual}, for how to +enter curved single quotes. Documentation strings can also use an older single-quoting convention, -which quotes symbols with grave accent @samp{`} and apostrophe -@samp{'}: @samp{`like-this'} rather than @samp{‘like-this’}. This +which quotes symbols with grave accent @t{`} and apostrophe +@t{'}: @t{`like-this'} rather than @t{‘like-this’}. This older convention was designed for now-obsolete displays in which grave accent and apostrophe were mirror images. Documentation in this older convention is converted to the standard convention when it is copied -- 2.39.2