From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/elisp/precalculated-fontification.html | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 devdocs/elisp/precalculated-fontification.html (limited to 'devdocs/elisp/precalculated-fontification.html') 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 @@ +

Precalculated Fontification

Some major modes such as list-buffers and occur 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.

The way to do this is to specify the faces in the text with the special text property font-lock-face (see Special Properties). When Font Lock mode is enabled, this property controls the display, just like the face property. When Font Lock mode is disabled, font-lock-face has no effect on the display.

It is ok for a mode to use font-lock-face 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 font-lock-defaults. In this case the face property will not be overridden, so using the face property could work too. However, using font-lock-face is generally preferable as it allows the user to control the fontification by toggling font-lock-mode, and lets the code work regardless of whether the mode uses Font Lock machinery or not.

+

+ Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc.
Licensed under the GNU GPL license.
+ https://www.gnu.org/software/emacs/manual/html_node/elisp/Precalculated-Fontification.html +

+
-- cgit v1.2.3