Skip to content

Commit

Permalink
tweak(core): demote errors when loading modules unless in debug mode
Browse files Browse the repository at this point in the history
Signed-off-by: Abdelhak Bougouffa <abougouffa@fedoraproject.org>
  • Loading branch information
abougouffa committed Dec 14, 2023
1 parent 00a1cb0 commit 6b3b4cc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions core/me-vars.el
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,16 @@ Each string is a regexp, matched against variable names to omit from
(dolist (conf configs)
(unless (memq conf minemacs-ignore-user-config)
(let ((conf-path (format "%s%s.el" minemacs-config-dir conf)))
(when (file-exists-p conf-path)
(load conf-path nil (not minemacs-verbose-p)))))))
(when (file-exists-p conf-path) (+load conf-path))))))

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


Expand Down

0 comments on commit 6b3b4cc

Please sign in to comment.