CC Mode attempts to use the standard faces for programming languages
in accordance with their intended purposes as far as possible. No extra
faces are currently provided, with the exception of a replacement face
c-invalid-face
for emacsen that don’t provide
font-lock-warning-face
.
font-lock-comment-face
.
font-lock-doc-face
(Emacs) or
font-lock-doc-string-face
(XEmacs) if those faces exist. If
they don’t then font-lock-comment-face
is used.
font-lock-string-face
.
font-lock-keyword-face
.
font-lock-function-name-face
is used for function names in
declarations and definitions, and classes in those contexts. It’s also
used for preprocessor defines with arguments.
font-lock-variable-name-face
. It’s also
used for preprocessor defines without arguments.
font-lock-constant-face
if it
exists, font-lock-reference-face
otherwise. As opposed to the
preceding two faces, this is used on the names in expressions, and it’s
not used in declarations, even if there happen to be a ‘const’ in
them somewhere.
font-lock-type-face
is put on types (both predefined and user
defined) and classes in type contexts.
font-lock-constant-face
if it exists,
font-lock-reference-face
otherwise.
font-lock-preprocessor-face
if it
exists (i.e. XEmacs). In Emacs they get font-lock-builtin-face
or font-lock-reference-face
, for lack of a closer equivalent.
font-lock-warning-face
in Emacs. In older XEmacs versions
there’s no corresponding standard face, so there a special
c-invalid-face
is used, which is defined to stand out sharply by
default.
Note that it’s not used for ‘#error’ or ‘#warning’ directives, since those aren’t syntactic errors in themselves.