Is it possible to run code when setting an option defined by
For example, I would like
(setq my-package-option t) to install a hook.
defcustom has a
:set keyword, it's documented only to run in the user interface.
This is close to working, it has an error about a recursive function call.
(defcustom my-boolean-example nil "Docs." :set #'(lambda (var value) (if (set-default var value) (turn-thing-on) (turn-thing-off))) :initialize 'custom-initialize-changed :type 'boolean)