This page is about library '''<tt>[[hl-defined.el]]</tt>''', which lets you highlight [[symbol]]s that are known to be defined functions and/or variables in an EmacsLisp buffer.  Or you can highlight symbols that are ''not'' known to be defined functions or variables.

(Library <tt>[[highlight-fns.el]]</tt> is a rudimentary version of this feature; it just highlights defined functions.  It is essentially made obsolete by library <tt>[[hl-defined.el]]</tt>.)

See also HighlightDynamicVariables, which you can use together with ##hl-defined.el##.  It highlights dynamically scoped variables.

== How to Use ==

'''`hdefd-highlight-mode'''' is a [[minor mode]] that highlights, in the
current buffer, all [[symbol]]s that are known to be defined as Emacs-Lisp
functions or variables or both.  Alternatively, it can highlight
symbols that are ''not'' known to be defined as functions or variables.
The current buffer should be in EmacsLisp mode.

Command '''`hdefd-highlight-mode'''' toggles highlighting on/off.  The highlighting respects [[user option]] `hdefd-highlight-type', which specifies whether to highlight functions and variables, only functions, only variables, or only undefined symbols.

Command '''`hdefd-cycle'''' cycles highlighting among these available
types and off (no such highlighting), as follows:

: functions & variables --> functions --> variables --> undefined --> off

It does this by changing the current
value of the option.

Highlighting uses these [[face]]s:

* `hdefd-functions' -- for defined functions
* `hdefd-variables' -- for defined variables
* `hdefd-undefined' -- for undefined symbols

To use the library, put this in your [[init file]]:

    (require 'hl-defined)

If you want to turn on this highlighting automatically for Emacs-Lisp mode, then put this in your init file after requiring the library:

    (add-hook 'emacs-lisp-mode-hook 'hdefd-highlight-mode 'APPEND)



----
CategoryDisplay
CategoryLisp
CategoryFaces
CategoryCode
