Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
eae7d8f8
Commit
eae7d8f8
authored
May 17, 2009
by
Richard M. Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modes.texi (Precalculated Fontification): Clarify text.
parent
b8766179
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
12 deletions
+19
-12
doc/lispref/ChangeLog
doc/lispref/ChangeLog
+4
-0
doc/lispref/modes.texi
doc/lispref/modes.texi
+15
-12
No files found.
doc/lispref/ChangeLog
View file @
eae7d8f8
2009-05-17 Richard M Stallman <rms@gnu.org>
* modes.texi (Precalculated Fontification): Clarify text.
2009-05-17 Martin Rudalics <rudalics@gmx.at>
* windows.texi (Selecting Windows): Clarify descriptions of
...
...
doc/lispref/modes.texi
View file @
eae7d8f8
...
...
@@ -2864,18 +2864,21 @@ wherever they appear.
@node Precalculated Fontification
@subsection Precalculated Fontification
In addition to using @code{font-lock-defaults} for search-based
fontification, you may use the special character property
@code{font-lock-face} (@pxref{Special Properties}). This property
acts just like the explicit @code{face} property, but its activation
is toggled when the user calls @kbd{M-x font-lock-mode}. Using
@code{font-lock-face} is especially convenient for special modes
which construct their text programmatically, such as
@code{list-buffers} and @code{occur}.
If your mode does not use any of the other machinery of Font Lock
(i.e. it only uses the @code{font-lock-face} property), it should not
set the variable @code{font-lock-defaults}.
Some major modes such as @code{list-buffers} and @code{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 @code{font-lock-face} (@pxref{Special
Properties}). When Font Lock mode is enabled, this property controls
the display, just like the @code{face} property. When Font Lock mode
is disabled, @code{font-lock-face} has no effect on the display.
It is ok for a mode to use @code{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
@code{font-lock-defaults}.
@node Faces for Font Lock
@subsection Faces for Font Lock
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment