blob: 6a34470c6d42fa6c1dd7d33cbcfa40c286b7e2f3 (
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
<h2 class="chapter">Variables</h2> <p>A <em>variable</em> is a name used in a program to stand for a value. In Lisp, each variable is represented by a Lisp symbol (see <a href="symbols">Symbols</a>). The variable name is simply the symbol’s name, and the variable’s value is stored in the symbol’s value cell<a id="DOCF9" href="#FOOT9"><sup>9</sup></a>. See <a href="symbol-components">Symbol Components</a>. In Emacs Lisp, the use of a symbol as a variable is independent of its use as a function name. </p> <p>As previously noted in this manual, a Lisp program is represented primarily by Lisp objects, and only secondarily as text. The textual form of a Lisp program is given by the read syntax of the Lisp objects that constitute the program. Hence, the textual form of a variable in a Lisp program is written using the read syntax for the symbol representing the variable. </p> <table class="menu" border="0" cellspacing="0"> <tr>
<td align="left" valign="top">• <a href="global-variables" accesskey="1">Global Variables</a>
</td>
<td> </td>
<td align="left" valign="top">Variable values that exist permanently, everywhere. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="constant-variables" accesskey="2">Constant Variables</a>
</td>
<td> </td>
<td align="left" valign="top">Variables that never change. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="local-variables" accesskey="3">Local Variables</a>
</td>
<td> </td>
<td align="left" valign="top">Variable values that exist only temporarily. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="void-variables" accesskey="4">Void Variables</a>
</td>
<td> </td>
<td align="left" valign="top">Symbols that lack values. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="defining-variables" accesskey="5">Defining Variables</a>
</td>
<td> </td>
<td align="left" valign="top">A definition says a symbol is used as a variable. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="tips-for-defining" accesskey="6">Tips for Defining</a>
</td>
<td> </td>
<td align="left" valign="top">Things you should think about when you define a variable. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="accessing-variables" accesskey="7">Accessing Variables</a>
</td>
<td> </td>
<td align="left" valign="top">Examining values of variables whose names are known only at run time. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="setting-variables" accesskey="8">Setting Variables</a>
</td>
<td> </td>
<td align="left" valign="top">Storing new values in variables. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="watching-variables" accesskey="9">Watching Variables</a>
</td>
<td> </td>
<td align="left" valign="top">Running a function when a variable is changed. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="variable-scoping">Variable Scoping</a>
</td>
<td> </td>
<td align="left" valign="top">How Lisp chooses among local and global values. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="buffer_002dlocal-variables">Buffer-Local Variables</a>
</td>
<td> </td>
<td align="left" valign="top">Variable values in effect only in one buffer. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="file-local-variables">File Local Variables</a>
</td>
<td> </td>
<td align="left" valign="top">Handling local variable lists in files. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="directory-local-variables">Directory Local Variables</a>
</td>
<td> </td>
<td align="left" valign="top">Local variables common to all files in a directory. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="connection-local-variables">Connection Local Variables</a>
</td>
<td> </td>
<td align="left" valign="top">Local variables common for remote connections. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="variable-aliases">Variable Aliases</a>
</td>
<td> </td>
<td align="left" valign="top">Variables that are aliases for other variables. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="variables-with-restricted-values">Variables with Restricted Values</a>
</td>
<td> </td>
<td align="left" valign="top">Non-constant variables whose value can <em>not</em> be an arbitrary Lisp object. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="generalized-variables">Generalized Variables</a>
</td>
<td> </td>
<td align="left" valign="top">Extending the concept of variables. </td>
</tr> </table><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/Variables.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Variables.html</a>
</p>
</div>
|