GNU Info

Info Node: (elisp)Levels of Font Lock

(elisp)Levels of Font Lock


Next: Faces for Font Lock Prev: Other Font Lock Variables Up: Font Lock Mode
Enter node , (file) or (file)node

Levels of Font Lock
-------------------

   Many major modes offer three different levels of fontification.  You
can define multiple levels by using a list of symbols for KEYWORDS in
`font-lock-defaults'.  Each symbol specifies one level of
fontification; it is up to the user to choose one of these levels.  The
chosen level's symbol value is used to initialize `font-lock-keywords'.

   Here are the conventions for how to define the levels of
fontification:

   * Level 1: highlight function declarations, file directives (such as
     include or import directives), strings and comments.  The idea is
     speed, so only the most important and top-level components are
     fontified.

   * Level 2: in addition to level 1, highlight all language keywords,
     including type names that act like keywords, as well as named
     constant values.  The idea is that all keywords (either syntactic
     or semantic) should be fontified appropriately.

   * Level 3: in addition to level 2, highlight the symbols being
     defined in function and variable declarations, and all builtin
     function names, wherever they appear.


automatically generated by info2www version 1.2.2.9