From 1de63a3969d98b47776f12b985d055caacb5a702 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 19 Jun 2022 16:35:08 +0200 Subject: [PATCH] Fix starting eshell with missing/invalid modules defined * lisp/eshell/esh-mode.el (eshell-mode): Warn instead of failing to start when 'eshell-modules-list' has invalid entries. (Bug#54976) --- lisp/eshell/esh-mode.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index c21484dc45f..db36909fb86 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -361,7 +361,11 @@ and the hook `eshell-exit-hook'." (unless module-shortname (error "Invalid Eshell module name: %s" module-fullname)) (unless (featurep (intern module-shortname)) - (load module-shortname)))) + (condition-case nil + (load module-shortname) + (error (lwarn 'eshell :error + "Unable to load module `%s' (defined in `eshell-modules-list')" + module-fullname)))))) (unless (file-exists-p eshell-directory-name) (eshell-make-private-directory eshell-directory-name t)) -- 2.39.2