summaryrefslogtreecommitdiff
path: root/devdocs/elisp/text-quoting-style.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/text-quoting-style.html
new repository
Diffstat (limited to 'devdocs/elisp/text-quoting-style.html')
-rw-r--r--devdocs/elisp/text-quoting-style.html10
1 files changed, 10 insertions, 0 deletions
diff --git a/devdocs/elisp/text-quoting-style.html b/devdocs/elisp/text-quoting-style.html
new file mode 100644
index 00000000..4ddb2aac
--- /dev/null
+++ b/devdocs/elisp/text-quoting-style.html
@@ -0,0 +1,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)) ==&gt; (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)) ==&gt; (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 &copy; 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>