From 97387b89fb5668755415af71f2998f8b50857798 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 24 Nov 2024 19:27:39 -0500 Subject: [PATCH] fix(lib): with-doom-module: nil -> empty doom-module-context Would throw an "Invalid key: nil" error if KEY was `nil`. Fix: #8176 Amend: 8cafbe4408e7 --- lisp/doom-lib.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/doom-lib.el b/lisp/doom-lib.el index 92a3bc7d4..0fb4dda00 100644 --- a/lisp/doom-lib.el +++ b/lisp/doom-lib.el @@ -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))