1
2
3
4
5
6
7
8
9
10
|
<h3 class="section">Text Quoting Style</h3> <p>Typically, grave accents and apostrophes are treated specially in documentation strings and diagnostic messages, and translate to matching single quotation marks (also called “curved quotes”). For example, the documentation string <tt>"Alias for `foo'."</tt> and the function call <code>(message "Alias for `foo'.")</code> both translate to <tt>"Alias for ‘foo’."</tt>. Less commonly, Emacs displays grave accents and apostrophes as themselves, or as apostrophes only (e.g., <tt>"Alias for 'foo'."</tt>). Documentation strings and message formats should be written so that they display well with any of these styles. For example, the documentation string <tt>"Alias for 'foo'."</tt> is probably not what you want, as it can display as <tt>"Alias for ’foo’."</tt>, an unusual style in English. </p> <p>Sometimes you may need to display a grave accent or apostrophe without translation, regardless of text quoting style. In a documentation string, you can do this with escapes. For example, in the documentation string <tt>"\\=`(a ,(sin 0)) ==> (a 0.0)"</tt> the grave accent is intended to denote Lisp code, so it is escaped and displays as itself regardless of quoting style. In a call to <code>message</code> or <code>error</code>, you can avoid translation by using a format <tt>"%s"</tt> with an argument that is a call to <code>format</code>. For example, <code>(message "%s" (format "`(a ,(sin %S)) ==> (a %S)" x (sin x)))</code> displays a message that starts with grave accent regardless of text quoting style. </p> <dl> <dt id="text-quoting-style">User Option: <strong>text-quoting-style</strong>
</dt> <dd>
<p>The value of this user option is a symbol that specifies the style Emacs should use for single quotes in the wording of help and messages. If the option’s value is <code>curve</code>, the style is <tt>‘like this’</tt> with curved single quotes. If the value is <code>straight</code>, the style is <tt>'like this'</tt> with straight apostrophes. If the value is <code>grave</code>, quotes are not translated and the style is <tt>`like this'</tt> with grave accent and apostrophe, the standard style before Emacs version 25. The default value <code>nil</code> acts like <code>curve</code> if curved single quotes seem to be displayable, and like <code>grave</code> otherwise. </p> <p>This option is useful on platforms that have problems with curved quotes. You can customize it freely according to your personal preference. </p>
</dd>
</dl><div class="_attribution">
<p class="_attribution-p">
Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
<a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Quoting-Style.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Quoting-Style.html</a>
</p>
</div>
|