summaryrefslogtreecommitdiff
path: root/devdocs/elisp/font-lock-mode.html
blob: c8a9bba40753b249a20efa6f84ba251d9171965b (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
 <h3 class="section">Font Lock Mode</h3>   <p><em>Font Lock mode</em> is a buffer-local minor mode that automatically attaches <code>face</code> properties to certain parts of the buffer based on their syntactic role. How it parses the buffer depends on the major mode; most major modes define syntactic criteria for which faces to use in which contexts. This section explains how to customize Font Lock for a particular major mode. </p> <p>Font Lock mode finds text to highlight in two ways: through syntactic parsing based on the syntax table, and through searching (usually for regular expressions). Syntactic fontification happens first; it finds comments and string constants and highlights them. Search-based fontification happens second. </p> <table class="menu" border="0" cellspacing="0"> <tr>
<td align="left" valign="top">• <a href="font-lock-basics" accesskey="1">Font Lock Basics</a>
</td>
<td> </td>
<td align="left" valign="top">Overview of customizing Font Lock. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="search_002dbased-fontification" accesskey="2">Search-based Fontification</a>
</td>
<td> </td>
<td align="left" valign="top">Fontification based on regexps. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="customizing-keywords" accesskey="3">Customizing Keywords</a>
</td>
<td> </td>
<td align="left" valign="top">Customizing search-based fontification. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="other-font-lock-variables" accesskey="4">Other Font Lock Variables</a>
</td>
<td> </td>
<td align="left" valign="top">Additional customization facilities. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="levels-of-font-lock" accesskey="5">Levels of Font Lock</a>
</td>
<td> </td>
<td align="left" valign="top">Each mode can define alternative levels so that the user can select more or less. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="precalculated-fontification" accesskey="6">Precalculated Fontification</a>
</td>
<td> </td>
<td align="left" valign="top">How Lisp programs that produce the buffer contents can also specify how to fontify it. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="faces-for-font-lock" accesskey="7">Faces for Font Lock</a>
</td>
<td> </td>
<td align="left" valign="top">Special faces specifically for Font Lock. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="syntactic-font-lock" accesskey="8">Syntactic Font Lock</a>
</td>
<td> </td>
<td align="left" valign="top">Fontification based on syntax tables. </td>
</tr> <tr>
<td align="left" valign="top">• <a href="multiline-font-lock" accesskey="9">Multiline Font Lock</a>
</td>
<td> </td>
<td align="left" valign="top">How to coerce Font Lock into properly highlighting multiline constructs. </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/Font-Lock-Mode.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Font-Lock-Mode.html</a>
  </p>
</div>