A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/alphapapa/highlight-function-calls below:

alphapapa/highlight-function-calls: Highlight function/macro calls in Emacs

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 + / -, < / >, error, 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))

…the 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 rainbow-delimiters and rainbow-identifiers:

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:

(require 'highlight-function-calls)

Run 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 emacs-lisp-mode-hook instead.

You can customize options and faces in the highlight-function-calls customization group.

Additions

First tagged release (after several years of no changes).

Bug reports, feature requests, pull requests, oh my!

GPLv3


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4