diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/precalculated-fontification.html | |
new repository
Diffstat (limited to 'devdocs/elisp/precalculated-fontification.html')
| -rw-r--r-- | devdocs/elisp/precalculated-fontification.html | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/devdocs/elisp/precalculated-fontification.html b/devdocs/elisp/precalculated-fontification.html new file mode 100644 index 00000000..65013d55 --- /dev/null +++ b/devdocs/elisp/precalculated-fontification.html @@ -0,0 +1,6 @@ + <h4 class="subsection">Precalculated Fontification</h4> <p>Some major modes such as <code>list-buffers</code> and <code>occur</code> construct the buffer text programmatically. The easiest way for them to support Font Lock mode is to specify the faces of text when they insert the text in the buffer. </p> <p>The way to do this is to specify the faces in the text with the special text property <code>font-lock-face</code> (see <a href="special-properties">Special Properties</a>). When Font Lock mode is enabled, this property controls the display, just like the <code>face</code> property. When Font Lock mode is disabled, <code>font-lock-face</code> has no effect on the display. </p> <p>It is ok for a mode to use <code>font-lock-face</code> for some text and also use the normal Font Lock machinery. But if the mode does not use the normal Font Lock machinery, it should not set the variable <code>font-lock-defaults</code>. In this case the <code>face</code> property will not be overridden, so using the <code>face</code> property could work too. However, using <code>font-lock-face</code> is generally preferable as it allows the user to control the fontification by toggling <code>font-lock-mode</code>, and lets the code work regardless of whether the mode uses Font Lock machinery or not. </p><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/Precalculated-Fontification.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Precalculated-Fontification.html</a> + </p> +</div> |
