This package highlights function symbols in function calls. This makes them stand out from other symbols, which makes it easy to see where calls to other functions are. It also helps to reduce typos, as when you’re typing a function name, it becomes underlined when typed correctly. Optionally, macros and special forms can be highlighted as well. Also, a list of symbols can be excluded from highlighting; by default, ones like
require, etc. are excluded. Finally, the
not function can be highlighted specially.
Since Elisp is a Lisp-2, a symbol can be a variable or a function, and regular expression-matching is not a perfect solution for determining which. So every matched symbol is run against a few checks, and this works correctly most of the time. However, in a situation like:
(defsubst internal--listify (elt) "Wrap ELT in a list if it is not one." (if (not (listp elt)) (list elt) elt))
elt in the argument list is highlighted as a function, even though it isn’t a function call, because it’s the first symbol in a list and the name of a function.
The default face just underlines the function name, but you can customize the face however you like.
Here’s a plain Emacs configuration:
Here’s one with some other highlighting modes, like
Install the package from MELPA and you’re all set!
If you want to install it manually, put
highlight-function-calls.el in your
load-path, then add this to your init file:
highlight-function-calls-mode to activate. Maybe you want to add it to your
emacs-lisp-mode-hook like this:
(use-package highlight-function-calls :config (add-hook 'emacs-lisp-mode-hook 'highlight-function-calls-mode))
Note: You should probably activate this mode last, after any other highlighting modes, such as
rainbow-identifiers-mode, otherwise the
highlight-function-calls faces may not be visible. You might need to use a custom function to activate modes like this in the right order, and add that function to your
You can customize options and faces in the
highlight-function-calls customization group.
Bug reports, feature requests, pull requests, oh my!