mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
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:
@ -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)"
|
||||
|
Reference in New Issue
Block a user