summaryrefslogtreecommitdiff
path: root/devdocs/elisp/text-properties.html
blob: 8ef28fdbab0ac7ac4ee29505bd867d2f2c0e2d89 (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
 <h3 class="section">Text Properties</h3>    <p>Each character position in a buffer or a string can have a <em>text property list</em>, much like the property list of a symbol (see <a href="property-lists">Property Lists</a>). The properties belong to a particular character at a particular place, such as, the letter ‘<samp>T</samp>’ at the beginning of this sentence or the first ‘<samp>o</samp>’ in ‘<samp>foo</samp>’—if the same character occurs in two different places, the two occurrences in general have different properties. </p> <p>Each property has a name and a value. Both of these can be any Lisp object, but the name is normally a symbol. Typically each property name symbol is used for a particular purpose; for instance, the text property <code>face</code> specifies the faces for displaying the character (see <a href="special-properties">Special Properties</a>). The usual way to access the property list is to specify a name and ask what value corresponds to it. </p> <p>If a character has a <code>category</code> property, we call it the <em>property category</em> of the character. It should be a symbol. The properties of the symbol serve as defaults for the properties of the character. </p> <p>Copying text between strings and buffers preserves the properties along with the characters; this includes such diverse functions as <code>substring</code>, <code>insert</code>, and <code>buffer-substring</code>. </p> <table class="menu" border="0" cellspacing="0"> <tr>
<td align="left" valign="top">• <a href="examining-properties" accesskey="1">Examining Properties</a>
</td>
<td> </td>
<td align="left" valign="top">Looking at the properties of one character. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="changing-properties" accesskey="2">Changing Properties</a>
</td>
<td> </td>
<td align="left" valign="top">Setting the properties of a range of text. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="property-search" accesskey="3">Property Search</a>
</td>
<td> </td>
<td align="left" valign="top">Searching for where a property changes value. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="special-properties" accesskey="4">Special Properties</a>
</td>
<td> </td>
<td align="left" valign="top">Particular properties with special meanings. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="format-properties" accesskey="5">Format Properties</a>
</td>
<td> </td>
<td align="left" valign="top">Properties for representing formatting of text. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="sticky-properties" accesskey="6">Sticky Properties</a>
</td>
<td> </td>
<td align="left" valign="top">How inserted text gets properties from neighboring text. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="lazy-properties" accesskey="7">Lazy Properties</a>
</td>
<td> </td>
<td align="left" valign="top">Computing text properties in a lazy fashion only when text is examined. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="clickable-text" accesskey="8">Clickable Text</a>
</td>
<td> </td>
<td align="left" valign="top">Using text properties to make regions of text do something when you click on them. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="fields" accesskey="9">Fields</a>
</td>
<td> </td>
<td align="left" valign="top">The <code>field</code> property defines fields within the buffer. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="not-intervals">Not Intervals</a>
</td>
<td> </td>
<td align="left" valign="top">Why text properties do not use Lisp-visible text intervals. </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/Text-Properties.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Text-Properties.html</a>
  </p>
</div>