I'm trying to make this little convenience function work:
(defun my-make-hook (when procedure) (let ((hook-symbol (intern (concat (substring (symbol-name when) 1) "-" (symbol-name procedure) "-hook")))) (unless (boundp hook-symbol) (set hook-symbol nil) (advice-add procedure when (lambda (&rest _) (run-hooks hook-symbol))) hook-symbol)))
But I'm getting an error that the interned symbol is void, and I believe I may actually be somehow setting the value of the symbol
hook-symbol itself, rather than the symbol that
hook-symbol evaluates to.
EDIT: I'm calling it with, e.g., (my-make-hook :after 'load-theme).