summaryrefslogtreecommitdiff
path: root/devdocs/elisp/character-type.html
blob: 67cfb9898b0f4dec13e56a0f5e9f5d9cb0a33851 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 <h4 class="subsection">Character Type</h4>  <p>A <em>character</em> in Emacs Lisp is nothing more than an integer. In other words, characters are represented by their character codes. For example, the character <kbd>A</kbd> is represented as the integer 65. </p> <p>Individual characters are used occasionally in programs, but it is more common to work with <em>strings</em>, which are sequences composed of characters. See <a href="string-type">String Type</a>. </p> <p>Characters in strings and buffers are currently limited to the range of 0 to 4194303—twenty two bits (see <a href="character-codes">Character Codes</a>). Codes 0 through 127 are <acronym>ASCII</acronym> codes; the rest are non-<acronym>ASCII</acronym> (see <a href="non_002dascii-characters">Non-ASCII Characters</a>). Characters that represent keyboard input have a much wider range, to encode modifier keys such as Control, Meta and Shift. </p> <p>There are special functions for producing a human-readable textual description of a character for the sake of messages. See <a href="describing-characters">Describing Characters</a>. </p> <table class="menu" border="0" cellspacing="0"> <tr>
<td align="left" valign="top">• <a href="basic-char-syntax" accesskey="1">Basic Char Syntax</a>
</td>
<td> </td>
<td align="left" valign="top">Syntax for regular characters. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="general-escape-syntax" accesskey="2">General Escape Syntax</a>
</td>
<td> </td>
<td align="left" valign="top">How to specify characters by their codes. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="ctl_002dchar-syntax" accesskey="3">Ctl-Char Syntax</a>
</td>
<td> </td>
<td align="left" valign="top">Syntax for control characters. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="meta_002dchar-syntax" accesskey="4">Meta-Char Syntax</a>
</td>
<td> </td>
<td align="left" valign="top">Syntax for meta-characters. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="other-char-bits" accesskey="5">Other Char Bits</a>
</td>
<td> </td>
<td align="left" valign="top">Syntax for hyper-, super-, and alt-characters. </td>
</tr> </table><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/Character-Type.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Character-Type.html</a>
  </p>
</div>