Next: Syntactic Font Lock, Previous: Precalculated Fontification, Up: Font Lock Mode [Contents][Index]
Font Lock mode can highlight using any face, but Emacs defines several faces specifically for Font Lock to use to highlight text. These Font Lock faces are listed below. They can also be used by major modes for syntactic highlighting outside of Font Lock mode (see Major Mode Conventions).
Each of these symbols is both a face name, and a variable whose
default value is the symbol itself. Thus, the default value of
font-lock-comment-face is font-lock-comment-face.
The faces are listed with descriptions of their typical usage, and in order of greater to lesser prominence. If a mode’s syntactic categories do not fit well with the usage descriptions, the faces can be assigned using the ordering as a guide.
font-lock-warning-facefor a construct that is peculiar, or that greatly changes the meaning of other text, like ‘;;;###autoload’ in Emacs Lisp and ‘#error’ in C.
font-lock-function-name-facefor the name of a function being defined or declared.
font-lock-variable-name-facefor the name of a variable being defined or declared.
font-lock-keyword-facefor a keyword with special syntactic significance, like ‘for’ and ‘if’ in C.
font-lock-comment-facefor comments.
font-lock-comment-delimiter-facefor comments delimiters, like ‘/*’ and ‘*/’ in C. On most
terminals, this inherits from font-lock-comment-face.
font-lock-type-facefor the names of user-defined data types.
font-lock-constant-facefor the names of constants, like ‘NULL’ in C.
font-lock-builtin-facefor the names of built-in functions.
font-lock-preprocessor-facefor preprocessor commands. This inherits, by default, from
font-lock-builtin-face.
font-lock-string-facefor string constants.
font-lock-doc-facefor documentation strings in the code. This inherits, by default, from
font-lock-string-face.
font-lock-negation-char-facefor easily-overlooked negation characters.
Next: Syntactic Font Lock, Previous: Precalculated Fontification, Up: Font Lock Mode [Contents][Index]