Use 'load' instead of 'load-theme' for the initial theme reification

This looks cleaner and saves us from the trouble of having to deal
with any hooks after load-theme at this early stage. I took the file
binding from the load-theme source.

Fundamentally, I want to have a theme symbol, like 'modus-operandi'
exist with all the relevant 'theme-properties' so that something like
'modus-themes-list-colors' can work with it even before
modus-operandi-theme.el is loaded.
This commit is contained in:
Protesilaos Stavrou 2025-11-02 17:36:14 +02:00
parent 6e1bdce593
commit ef3e0e5d4d
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA

View file

@ -3780,9 +3780,10 @@ Also see `modus-themes-get-themes'.")
;; side effect of adding the relevant `theme-properties' to it.
(unless (and (memq theme modus-themes--activated-themes)
(custom-theme-p theme))
(let ((enable-theme-functions nil)
(modus-themes-after-load-theme-hook nil))
(load-theme theme t t))
(let ((file (locate-file (concat (symbol-name theme) "-theme.el")
(custom-theme--load-path)
'("" "c"))))
(load file nil t))
(add-to-list 'modus-themes--activated-themes theme)))
(defun modus-themes--belongs-to-family-p (theme family)