summaryrefslogtreecommitdiff
path: root/devdocs/elisp/general-escape-syntax.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/elisp/general-escape-syntax.html')
-rw-r--r--devdocs/elisp/general-escape-syntax.html10
1 files changed, 10 insertions, 0 deletions
diff --git a/devdocs/elisp/general-escape-syntax.html b/devdocs/elisp/general-escape-syntax.html
new file mode 100644
index 00000000..351a70ea
--- /dev/null
+++ b/devdocs/elisp/general-escape-syntax.html
@@ -0,0 +1,10 @@
+ <h4 class="subsubsection">General Escape Syntax</h4> <p>In addition to the specific escape sequences for special important control characters, Emacs provides several types of escape syntax that you can use to specify non-<acronym>ASCII</acronym> text characters. </p> <ol> <li> You can specify characters by their Unicode names, if any. <code>?\N{<var>NAME</var>}</code> represents the Unicode character named <var>NAME</var>. Thus, ‘<samp>?\N{LATIN SMALL LETTER A WITH GRAVE}</samp>’ is equivalent to <code>?à</code> and denotes the Unicode character U+00E0. To simplify entering multi-line strings, you can replace spaces in the names by non-empty sequences of whitespace (e.g., newlines). </li>
+<li> You can specify characters by their Unicode values. <code>?\N{U+<var>X</var>}</code> represents a character with Unicode code point <var>X</var>, where <var>X</var> is a hexadecimal number. Also, <code>?\u<var>xxxx</var></code> and <code>?\U<var>xxxxxxxx</var></code> represent code points <var>xxxx</var> and <var>xxxxxxxx</var>, respectively, where each <var>x</var> is a single hexadecimal digit. For example, <code>?\N{U+E0}</code>, <code>?\u00e0</code> and <code>?\U000000E0</code> are all equivalent to <code>?à</code> and to ‘<samp>?\N{LATIN SMALL LETTER A WITH GRAVE}</samp>’. The Unicode Standard defines code points only up to ‘<samp>U+<var>10ffff</var></samp>’, so if you specify a code point higher than that, Emacs signals an error. </li>
+<li> You can specify characters by their hexadecimal character codes. A hexadecimal escape sequence consists of a backslash, ‘<samp>x</samp>’, and the hexadecimal character code. Thus, ‘<samp>?\x41</samp>’ is the character <kbd>A</kbd>, ‘<samp>?\x1</samp>’ is the character <kbd>C-a</kbd>, and <code>?\xe0</code> is the character <kbd>à</kbd> (<kbd>a</kbd> with grave accent). You can use any number of hex digits, so you can represent any character code in this way. </li>
+<li> You can specify characters by their character code in octal. An octal escape sequence consists of a backslash followed by up to three octal digits; thus, ‘<samp>?\101</samp>’ for the character <kbd>A</kbd>, ‘<samp>?\001</samp>’ for the character <kbd>C-a</kbd>, and <code>?\002</code> for the character <kbd>C-b</kbd>. Only characters up to octal code 777 can be specified this way. </li>
+</ol> <p>These escape sequences may also be used in strings. See <a href="non_002dascii-in-strings">Non-ASCII in Strings</a>. </p><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/General-Escape-Syntax.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/General-Escape-Syntax.html</a>
+ </p>
+</div>