Just to clarify... For example, in this doc:
A hook is a Lisp variable which holds a list of functions, to be called on some well-defined occasion. (This is called running the hook.) The individual functions in the list are called the hook functions of the hook. For example, the hook
kill-emacs-hook
runs just before exiting Emacs...
I think it's saying there is a variable (symbol) named kill-emacs-hook
that represents a list of a set of "hook functions" that will run when the kill-emacs-hook
is evaluated, thereby performing those functions. Correct? Then
(add-hook 'text-mode-hook 'auto-fill-mode)
is adding auto-fill-mode
to that list identified by text-mode-hook
in addition to what's already there. Good. Now this
(defcustom text-mode-hook nil
"Normal hook run when entering Text mode and many related modes."
:type 'hook
:options '(turn-on-auto-fill flyspell-mode)
:group 'wp)
where it seems we are either creating or altering the text-mode-hook
. I'm now confused as to the nature of hooks and their relationship with defcustom
. My logical choice is that this code is creating a variable text-mode-hook
which is of "type" (don't know what is meant by types in elisp) hook
. Is this, indeed, supposed to be the initial creation of the hook text-mode-hook
? If so, what's up with the "options?" Are those the supposed hook functions, or something else?