refactor(lib): doom-load
This commit is contained in:
parent
8475d29f3c
commit
d6db88162e
1 changed files with 11 additions and 14 deletions
|
@ -151,20 +151,17 @@ If NOERROR, don't throw an error if PATH doesn't exist."
|
||||||
(signal (car e) (cdr e)))
|
(signal (car e) (cdr e)))
|
||||||
(error
|
(error
|
||||||
(setq path (locate-file path load-path (get-load-suffixes)))
|
(setq path (locate-file path load-path (get-load-suffixes)))
|
||||||
(signal (cond ((not (and path (featurep 'doom)))
|
(if (not (and path (featurep 'doom)))
|
||||||
'error)
|
(signal (car e) (cdr e))
|
||||||
((file-in-directory-p path (expand-file-name "cli" doom-core-dir))
|
(cl-loop for (err . dir)
|
||||||
'doom-cli-error)
|
in `((doom-cli-error . ,(expand-file-name "cli" doom-core-dir))
|
||||||
((file-in-directory-p path doom-core-dir)
|
(doom-core-error . ,doom-core-dir)
|
||||||
'doom-core-error)
|
(doom-user-error . ,doom-user-dir)
|
||||||
((file-in-directory-p path doom-user-dir)
|
(doom-profile-error . ,doom-profile-dir)
|
||||||
'doom-user-error)
|
(doom-module-error . ,doom-modules-dir))
|
||||||
((file-in-directory-p path doom-profile-dir)
|
if (file-in-directory-p path dir)
|
||||||
'doom-profile-error)
|
do (signal err (list (file-relative-name path (expand-file-name "../" dir))
|
||||||
((file-in-directory-p path doom-modules-dir)
|
e)))))))
|
||||||
'doom-module-error)
|
|
||||||
('doom-error))
|
|
||||||
(list path e)))))
|
|
||||||
|
|
||||||
(defun doom-require (feature &optional filename noerror)
|
(defun doom-require (feature &optional filename noerror)
|
||||||
"Like `require', but handles and enhances Doom errors.
|
"Like `require', but handles and enhances Doom errors.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue