branch: externals/modus-themes
commit ef3e0e5d4d9b06fe8f3144a807f7fabeda7a2db9
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>

    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.
---
 modus-themes.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modus-themes.el b/modus-themes.el
index d0f3305756..cf56223274 100644
--- a/modus-themes.el
+++ b/modus-themes.el
@@ -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)

Reply via email to