fix(lib): with-doom-module: nil -> empty doom-module-context

Would throw an "Invalid key: nil" error if KEY was `nil`.

Fix: #8176
Amend: 8cafbe4408
This commit is contained in:
Henrik Lissner
2024-11-24 19:27:39 -05:00
parent 169540ad3b
commit 97387b89fb

View File

@ -1261,7 +1261,9 @@ Never set this variable directly, use `with-doom-module'.")
(defmacro with-doom-module (key &rest body)
"Evaluate BODY with `doom-module-context' informed by KEY."
(declare (indent 1))
`(let ((doom-module-context (doom-module-context ,key)))
`(let ((doom-module-context
(or (doom-module-context ,key)
(make-doom-module-context))))
(doom-log ":context:module: =%s" doom-module-context)
,@body))