From 3ad9e3955940fd844f417a6711d395141c567608 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 30 Sep 2021 14:47:25 +0200 Subject: [PATCH] fix(lib): doom/reload-theme not reloading active theme Rather than reloading whatever `doom-theme` is set to, reload the currently active theme(s). Although `load-theme` is advised to change the value of `doom-theme`, not all theme switching commands use `load-theme` (e.g. `consult-theme`). Fix #5539 --- core/autoload/themes.el | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/core/autoload/themes.el b/core/autoload/themes.el index dd5abac85..c44be01fc 100644 --- a/core/autoload/themes.el +++ b/core/autoload/themes.el @@ -54,11 +54,20 @@ doom-themes' API without worry." ;;;###autoload (defun doom/reload-theme () - "Reload the current color theme." + "Reload the current Emacs theme." (interactive) + (unless doom-theme + (user-error "No theme is active")) (let ((themes (copy-sequence custom-enabled-themes))) - (load-theme doom-theme t) + (mapc #'disable-theme custom-enabled-themes) + (let (doom-load-theme-hook) + (mapc #'enable-theme (reverse themes))) + (doom-run-hooks 'doom-load-theme-hook) (doom/reload-font) (message "%s %s" - (propertize "Reloaded themes:" 'face 'bold) + (propertize + (format "Reloaded %d theme%s:" + (length themes) + (if (cdr themes) "s" "")) + 'face 'bold) (mapconcat #'prin1-to-string themes ", "))))