Rewrite doom/reload-theme to reload active themes

Now reloads all active themes, rather than just the primary one.
This commit is contained in:
Henrik Lissner 2021-05-01 14:34:31 -04:00
parent 71beafd723
commit 21b8af1ce1

View file

@ -47,13 +47,15 @@ doom-themes' API without worry."
(declare (indent defun)) (declare (indent defun))
`(custom-theme-set-faces! 'user ,@specs)) `(custom-theme-set-faces! 'user ,@specs))
(defvar doom--prefer-theme-elc)
;;;###autoload ;;;###autoload
(defun doom/reload-theme () (defun doom/reload-theme ()
"Reload the current color theme." "Reload the current color theme."
(interactive) (interactive)
(let ((theme (or (car-safe custom-enabled-themes) doom-theme))) (let ((themes (copy-sequence custom-enabled-themes)))
(when theme (mapc #'disable-theme custom-enabled-themes)
(mapc #'disable-theme custom-enabled-themes)) (dolist (theme themes)
(load-theme doom-theme 'noconfirm) (if (get theme 'theme-feature)
(load-theme theme t)
(enable-theme theme)))
(message "Reloaded themes: %s" (mapconcat #'prin1-to-string themes ", "))
(doom/reload-font))) (doom/reload-font)))