Skip to content

Commit 6b3b4cc

Browse files
committed
tweak(core): demote errors when loading modules unless in debug mode
Signed-off-by: Abdelhak Bougouffa <abougouffa@fedoraproject.org>
1 parent 00a1cb0 commit 6b3b4cc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/me-vars.el

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,16 @@ Each string is a regexp, matched against variable names to omit from
227227
(dolist (conf configs)
228228
(unless (memq conf minemacs-ignore-user-config)
229229
(let ((conf-path (format "%s%s.el" minemacs-config-dir conf)))
230-
(when (file-exists-p conf-path)
231-
(load conf-path nil (not minemacs-verbose-p)))))))
230+
(when (file-exists-p conf-path) (+load conf-path))))))
232231

233232
(defun +load (&rest filename-parts)
234233
"Load a file, the FILENAME-PARTS are concatenated to form the file name."
235234
(let ((filename (file-truename (apply #'concat filename-parts))))
236235
(if (file-exists-p filename)
237-
(load filename nil (not minemacs-verbose-p))
236+
(if minemacs-debug-p
237+
(load filename nil)
238+
(with-demoted-errors "[MinEmacs:LoadError] %s"
239+
(load filename nil (not minemacs-verbose-p))))
238240
(message "[MinEmacs:Error] Cannot load \"%s\", the file doesn't exists." filename))))
239241

240242

0 commit comments

Comments
 (0)