Report missing module in require! macro

This commit is contained in:
Henrik Lissner 2017-11-16 16:48:11 +01:00
parent ff717e5c2f
commit 1140af7807
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -408,13 +408,17 @@ The module is only loaded once. If RELOAD-P is non-nil, load it again."
(when (or reload-p (not loaded-p)) (when (or reload-p (not loaded-p))
(unless loaded-p (unless loaded-p
(doom-module-enable module submodule flags)) (doom-module-enable module submodule flags))
`(condition-case-unless-debug ex (let ((module-path (doom-module-path module submodule)))
(load! config ,(doom-module-path module submodule) t) (if (file-directory-p module-path)
('error `(condition-case-unless-debug ex
(lwarn 'doom-modules :error (load! config ,module-path t)
"%s in '%s %s' -> %s" ('error
(car ex) ,module ',submodule (lwarn 'doom-modules :error
(error-message-string ex))))))) "%s in '%s %s' -> %s"
(car ex) ,module ',submodule
(error-message-string ex))))
(lwarn 'doom-modules :warning "Couldn't find module '%s %s'"
module submodule))))))
(defmacro featurep! (module &optional submodule flag) (defmacro featurep! (module &optional submodule flag)
"A convenience macro wrapper for `doom-module-loaded-p'. It is evaluated at "A convenience macro wrapper for `doom-module-loaded-p'. It is evaluated at