[core] Warn if spacemacs|use-package-add-hook won't have any effect

spacemacs|use-package-add-hook is generating code which
is dependent on use-package-inject-hooks being non-nil.

If this happens now a big warning is written to the log
informing users of a potential issue or problem caused
by their user-config.
This commit is contained in:
Maximilian Wolff 2020-06-07 21:01:32 +02:00
parent 3b4f9ecd37
commit fbb8354c89
No known key found for this signature in database
GPG Key ID: 2DD07025BFDBD89A
1 changed files with 6 additions and 0 deletions

View File

@ -36,6 +36,12 @@ Usage:
In practice the most useful hook is the `:post-config' where you can
override lazy-loaded settings."
(declare (indent 1))
;; Make sure to yell when someone tries to call this without
;; `use-package-inject-hooks'.
(when (not use-package-inject-hooks)
(message (concat "!!!!!!WARNING!!!!!! Called use-package-add-hook without"
" "
"use-package-inject-hooks non-nil, this will most probably not work.")))
(let ((name-symbol (if (stringp name) (intern name) name))
(expanded-forms '()))
(dolist (keyword spacemacs--use-package-add-hook-keywords)