]> git.eshelyaron.com Git - emacs.git/commitdiff
(Precalcuated Fontification): Note how to use `font-lock-core-only'.
authorColin Walters <walters@gnu.org>
Sun, 9 Jun 2002 00:43:09 +0000 (00:43 +0000)
committerColin Walters <walters@gnu.org>
Sun, 9 Jun 2002 00:43:09 +0000 (00:43 +0000)
lispref/modes.texi

index 987f0a4e7b7aae2b8df2aed0cb39dcef2fba3e7f..4c888448d669cf20966af2a6d99f1cd449877195 100644 (file)
@@ -2097,6 +2097,18 @@ is toggled when the user calls @kbd{M-x font-lock-mode}.  Using
 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), you can tell
+Emacs not to load all of font-lock.el (unless it's already loaded), by
+setting the variable @code{font-lock-core-only} to non-nil as part of
+the @code{font-lock-defaults} settings.  Here is the canonical way to
+do this:
+
+@example
+(set (make-local-variable 'font-lock-defaults)
+     '(nil t nil nil nil (font-lock-core-only . t)))
+@end example
+
 @node Faces for Font Lock
 @subsection Faces for Font Lock