Skip to content

Commit

Permalink
tweak(core): be more intelligent when trying to load the theme
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Jan 1, 2024
1 parent 540ad79 commit 4e23071
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/me-lib.el
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,11 @@ This inhebits both the echo area and the `*Messages*' buffer."
(+log! "Loading user theme: %s" minemacs-theme)
;; Fallback to built-in `tsdh-light' when `minemacs-theme' is not available.
(unless (ignore-errors (load-theme minemacs-theme t))
(+error! "Cannot load theme \"%s\", falling back to \"tsdh-light\"." minemacs-theme)
(load-theme 'tsdh-light t)))
(let ((default-theme (+standard-value 'minemacs-theme)))
(+error! "Cannot load theme %S, trying to load the default theme %S" minemacs-theme default-theme)
(unless (ignore-errors (load-theme default-theme t))
(+error! "Cannot load default theme %S, falling back to the builtin tsdh-light theme" default-theme)
(load-theme 'tsdh-light t)))))
;; Run hooks
(run-hooks 'minemacs-after-load-theme-hook))

Expand Down Expand Up @@ -973,7 +976,6 @@ When MAIL-MODE-P is non-nil, treat INFILE as a mail."

;;; Github

;;;###autoload
(defun +github-latest-release (repo &optional fallback-release)
"Get the latest release of REPO. Strips the \"v\" at left.
Expand Down Expand Up @@ -2109,7 +2111,6 @@ scaling factor for the font in Emacs' `face-font-rescale-alist'. See the
(throw 'done spec))))))

;; Inspired by: github.com/seagle0128/.emacs.d/blob/master/custom-example.el
;;;###autoload
(defun +setup-fonts ()
"Setup fonts."
(interactive)
Expand Down

0 comments on commit 4e23071

Please sign in to comment.