fix: "Invalid key: nil" errors in some eval contexts

Breaking `gr` (+eval:region) et co in files outside of Doom's
source (like in packages).

Fix: #8224
This commit is contained in:
Henrik Lissner
2024-12-07 19:05:58 -05:00
parent 881eea137f
commit b02564535e

View File

@ -1158,8 +1158,10 @@ Never set this variable directly, use `with-doom-module'.")
"Evaluate BODY with `doom-module-context' informed by KEY."
(declare (indent 1))
`(let ((doom-module-context
(or (doom-module-context ,key)
(make-doom-module-context))))
(let ((key ,key))
(if key
(doom-module-context key)
(make-doom-module-context)))))
(doom-log ":context:module: =%s" doom-module-context)
,@body))