When I am typing in the scratch buffer, I type certain functions such as defun and while and they are recognized by the buffer and appear in purple. However, with other Lisp functions such as set or +, they do not appear in any color and I was wondering why that is.


1 Answer 1


defun and while are macros, and are highlighted as such.

set and + are functions, and are not highlighted like macros.

Old versions of Emacs seem to have a list of specific macros to highlight, but more recent (possibly unreleased?) versions simply highlight all known macros.

Here are the docs on functions and macros so you can tell them apart. I admit, in Lisp the difference between calling a function and a macro is difficult to distinguish. This is both one of its great features, and great stumbling blocks.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.