Allow expansion of stage-restricted forms
The package! family of macros will throw an error if used in the wrong files. This same check would prevent macroexpand from expanding them, or prevent them from being evaluated inline.
This commit is contained in:
parent
dd4c70fe93
commit
ebd53e5664
1 changed files with 5 additions and 1 deletions
|
@ -77,7 +77,11 @@ list is returned as-is."
|
|||
else collect (intern (format "%s-hook" (symbol-name hook)))))))
|
||||
|
||||
(defun doom--assert-stage-p (stage macro)
|
||||
(unless (bound-and-true-p byte-compile-current-file)
|
||||
(unless (or (bound-and-true-p byte-compile-current-file)
|
||||
;; Don't complain if we're being evaluated on-the-fly. Since forms
|
||||
;; are often evaluated (by `eval-region') or expanded (by
|
||||
;; macroexpand) in a temp buffer in `emacs-lisp-mode'...
|
||||
(eq major-mode 'emacs-lisp-mode))
|
||||
(cl-assert (eq stage doom--stage)
|
||||
nil
|
||||
"Found %s call in non-%s.el file (%s)"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue