fix: add doom--current-module clause to modulep!

To fix an edge case where it fails to deduce the current module.
This commit is contained in:
Henrik Lissner 2022-09-12 22:57:25 +02:00
parent 0c918f3b2d
commit 7161f27bb3
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -564,6 +564,10 @@ CATEGORY and MODULE can be omitted When this macro is used from inside a module
(and (cond (flag (memq flag (doom-module-get category module :flags))) (and (cond (flag (memq flag (doom-module-get category module :flags)))
(module (doom-module-p category module)) (module (doom-module-p category module))
(doom--current-flags (memq category doom--current-flags)) (doom--current-flags (memq category doom--current-flags))
(doom--current-module
(memq category (doom-module-get (car doom--current-module)
(cdr doom--current-module)
:flags)))
((if-let (module (doom-module-from-path (macroexpand '(file!)))) ((if-let (module (doom-module-from-path (macroexpand '(file!))))
(memq category (doom-module-get (car module) (cdr module) :flags)) (memq category (doom-module-get (car module) (cdr module) :flags))
(error "(modulep! %s %s %s) couldn't figure out what module it was called from (in %s)" (error "(modulep! %s %s %s) couldn't figure out what module it was called from (in %s)"