Skip to content

Commit 140e7f8

Browse files
committed
Recommend using font-lock-face over face (Bug#35044)
* doc/lispref/modes.texi (Precalculated Fontification): Explain advantages of using font-lock-face over face.
1 parent 7cb5364 commit 140e7f8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

doc/lispref/modes.texi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3201,7 +3201,12 @@ is disabled, @code{font-lock-face} has no effect on the display.
32013201
It is ok for a mode to use @code{font-lock-face} for some text and
32023202
also use the normal Font Lock machinery. But if the mode does not use
32033203
the normal Font Lock machinery, it should not set the variable
3204-
@code{font-lock-defaults}.
3204+
@code{font-lock-defaults}. In this case the @code{face} property will
3205+
not be overriden, so using the @code{face} property could work too.
3206+
However, using @code{font-lock-face} is generally preferable as it
3207+
allows the user to control the fontification by toggling
3208+
@code{font-lock-mode}, and lets the code work regardless of whether
3209+
the mode uses Font Lock machinery or not.
32053210

32063211
@node Faces for Font Lock
32073212
@subsection Faces for Font Lock

0 commit comments

Comments
 (0)