mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-21 13:53:38 -05:00
Soft-fail if doom-module-table can't find your private init.el
This commit is contained in:
@@ -465,16 +465,17 @@ added, if the file exists."
|
|||||||
:size (if modules (length modules) 100)
|
:size (if modules (length modules) 100)
|
||||||
:rehash-threshold 1.0)))
|
:rehash-threshold 1.0)))
|
||||||
(when (null modules)
|
(when (null modules)
|
||||||
(let ((init-file (expand-file-name "init.el" doom-private-dir)))
|
(let ((init-file (expand-file-name "init.el" doom-private-dir))
|
||||||
|
(short-init-file (abbreviate-file-name init-file)))
|
||||||
(if (not (file-exists-p init-file))
|
(if (not (file-exists-p init-file))
|
||||||
(error "%s doesn't exist" (abbreviate-file-name init-file))
|
(warn "%s doesn't exist" short-init-file)
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert-file-contents init-file)
|
(insert-file-contents init-file)
|
||||||
(when (re-search-forward "^\\s-*\\((doom! \\)" nil t)
|
(when (re-search-forward "^\\s-*\\((doom! \\)" nil t)
|
||||||
(goto-char (match-beginning 1))
|
(goto-char (match-beginning 1))
|
||||||
(setq modules (cdr (sexp-at-point))))))
|
(setq modules (cdr (sexp-at-point))))))
|
||||||
(unless modules
|
(unless (or modules noninteractive)
|
||||||
(error "Couldn't gather module list from %s" init-file))))
|
(warn "Couldn't gather module list from %s" short-init-file))))
|
||||||
(if (eq modules t) (setq modules nil))
|
(if (eq modules t) (setq modules nil))
|
||||||
(let (category)
|
(let (category)
|
||||||
(dolist (m modules)
|
(dolist (m modules)
|
||||||
|
Reference in New Issue
Block a user