Subject: bug#15219: Emacs Lisp mode and Lisp mode font-locking

From: Stefan Monnier <[email-masked]>
Date: Fri, 30 Aug 2013 08:45:15 -0400

> I've noticed something odd about the font-locking in Emacs Lisp mode and
> Lisp mode - keyword args are highlighted using the font-lock-builtin-face
> and constructs like &optional are highlighted using
> font-lock-type-face. I guess this was was done way back and hasn't been
> updated in a while, but I think it might a good idea to revise this. Pretty
> sure those font faces are intended for different usage. I think it would be
> great if all Emacs programming modes used the built-in font-lock faces
> consistently, so that the meaning of certain faces doesn't change from mode
> to mode. I guess that the two modes might also start using the
> font-lock-built-in face to highlight their core functions (like car, cdr,
> mapcar, mapc, etc) - as Clojure mode does. Personally I feel that uses of
> the keyword face for things that are not special forms (like the when macro)
> should be replaced with uses of the built-in face.

Which things are special forms and which things are macros is
somewhat arbitrary.  The important thing to know about them is that
they're not functions, so their arguments may not be evaluated in the
usual way.
Also macros are used to introduce new syntactic constructs: in normal
programming languages, something like `when' would be highlighted as
a `keyword', not as a `builtin'.

I'm not completely sure what the `builtin' is used for, usually.
What information is it meant to provide?  I mean, do you consider
`mapcar' "builtin" because it's fast?  Because it's implemented in C?
Because it's predefined (no need for any kind of autoloading/require)?
Is `car' builtin because "if you didn't have it, you'd have to invent
it" (IOW can't be implemented in Elisp)?

        Stefan