From 4d83719e58992237d185990644217f0647c838ca Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 26 Oct 2024 16:57:16 -0400 Subject: [PATCH] fix: doom-module-context: make error free --- lisp/doom-modules.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lisp/doom-modules.el b/lisp/doom-modules.el index 3f224c7e6..8c6307fcc 100644 --- a/lisp/doom-modules.el +++ b/lisp/doom-modules.el @@ -169,13 +169,11 @@ Never set this variable directly, use `with-doom-module'.") KEY can be a `doom-module-context', `doom-module', or a `doom-module-key' cons cell." (declare (side-effect-free t)) - (unless key - (error "Invalid module context: %S" key)) (or (pcase (type-of key) (`doom-module-context key) - (`doom-module (doom-module->context key)) + (`doom-module (ignore-errors (doom-module->context key))) (`cons (doom-module (car key) (cdr key)))) - (error "Invalid module context or key: %S" key))) + (make-doom-module-context :key (doom-module-key key)))) (defun doom-module<-context (context) "Return a `doom-module' plist from CONTEXT."