Variable: elisp-fontify-semantically

elisp-fontify-semantically is a customizable variable defined in elisp-mode.el.gz.

Value

nil

Documentation

Whether to highlight symbols according to their semantic meaning.

If this is non-nil, emacs-lisp-mode uses code analysis to determine the role of each symbol and highlight it accordingly. We call this kind of highlighting "semantic highlighting".

Semantic highlighting works best when you keep your code syntactically correct while editing it, for example by using electric-pair-mode(var)/electric-pair-mode(fun).

In trusted buffers (see trusted-content-p), the code analysis may expand some macro calls in your code to analyze the expanded forms. In untrusted buffers, for security reasons, macro-expansion is restricted to safe macros only (see elisp-scope-safe-macro-p). Hence in untrusted buffers the arguments of some macros might not be analyzed, and therefore will not be semantically highlighted.

See the function elisp-scope-analyze-form for more details about the code analysis.

This variable was added, or its default value changed, in Emacs 31.1.

View in manual

Probably introduced at or before Emacs version 31.1.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/elisp-mode.el.gz
(defcustom elisp-fontify-semantically nil
  "Whether to highlight symbols according to their semantic meaning.

If this is non-nil, `emacs-lisp-mode' uses code analysis to determine
the role of each symbol and highlight it accordingly.  We call this kind
of highlighting \"semantic highlighting\".

Semantic highlighting works best when you keep your code syntactically
correct while editing it, for example by using `electric-pair-mode'.

In trusted buffers (see `trusted-content-p'), the code analysis may
expand some macro calls in your code to analyze the expanded forms.  In
untrusted buffers, for security reasons, macro-expansion is restricted
to safe macros only (see `elisp-scope-safe-macro-p').  Hence in
untrusted buffers the arguments of some macros might not be analyzed,
and therefore will not be semantically highlighted.

See the function `elisp-scope-analyze-form' for more details about the
code analysis."
  :type 'boolean
  :version "31.1")