diff options
| author | Noam Postavsky | 2019-04-19 00:55:14 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2019-04-28 17:20:17 -0400 |
| commit | 140e7f890fa94f8b6381dfa3e0682cacfa92a593 (patch) | |
| tree | 3912ef04d7bc01108fa48c5193f8e2a9a24d7d53 | |
| parent | 7cb5364ef5334de0fb1bc2e470bea450e4567d24 (diff) | |
| download | emacs-140e7f890fa94f8b6381dfa3e0682cacfa92a593.tar.gz emacs-140e7f890fa94f8b6381dfa3e0682cacfa92a593.zip | |
Recommend using font-lock-face over face (Bug#35044)
* doc/lispref/modes.texi (Precalculated Fontification): Explain
advantages of using font-lock-face over face.
| -rw-r--r-- | doc/lispref/modes.texi | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 919816f3dee..0ff13d72e2f 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi | |||
| @@ -3201,7 +3201,12 @@ is disabled, @code{font-lock-face} has no effect on the display. | |||
| 3201 | It is ok for a mode to use @code{font-lock-face} for some text and | 3201 | It is ok for a mode to use @code{font-lock-face} for some text and |
| 3202 | also use the normal Font Lock machinery. But if the mode does not use | 3202 | also use the normal Font Lock machinery. But if the mode does not use |
| 3203 | the normal Font Lock machinery, it should not set the variable | 3203 | 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. | ||
| 3205 | 3210 | ||
| 3206 | @node Faces for Font Lock | 3211 | @node Faces for Font Lock |
| 3207 | @subsection Faces for Font Lock | 3212 | @subsection Faces for Font Lock |