From 59f70c2a8721a403bd63632eef0f8f3e170244ac Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 25 May 2018 01:11:53 +0200 Subject: [PATCH] Soft-fail if doom-module-table can't find your private init.el --- core/core-packages.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/core-packages.el b/core/core-packages.el index 5f70d6396..7788a1051 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -465,16 +465,17 @@ added, if the file exists." :size (if modules (length modules) 100) :rehash-threshold 1.0))) (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)) - (error "%s doesn't exist" (abbreviate-file-name init-file)) + (warn "%s doesn't exist" short-init-file) (with-temp-buffer (insert-file-contents init-file) (when (re-search-forward "^\\s-*\\((doom! \\)" nil t) (goto-char (match-beginning 1)) (setq modules (cdr (sexp-at-point)))))) - (unless modules - (error "Couldn't gather module list from %s" init-file)))) + (unless (or modules noninteractive) + (warn "Couldn't gather module list from %s" short-init-file)))) (if (eq modules t) (setq modules nil)) (let (category) (dolist (m modules)