From fc451064dc7ed8237864ad186353f0eaaf1dd84e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 3 Oct 2022 18:34:34 +0200 Subject: Emacs: fix dark/light auto-switching --- user/emacs/init.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'user') diff --git a/user/emacs/init.el b/user/emacs/init.el index e43d1c2d..06a8c2d6 100644 --- a/user/emacs/init.el +++ b/user/emacs/init.el @@ -76,10 +76,11 @@ (dark-mode-theme 'spacemacs-dark)) (defun my/set-dark-or-light-theme () (let ((appearance (plist-get (mac-application-state) :appearance))) + (mapc #'disable-theme custom-enabled-themes) (cond ((equal appearance "NSAppearanceNameAqua") - (counsel-load-theme light-mode-theme t)) + (load-theme light-mode-theme t)) ((equal appearance "NSAppearanceNameDarkAqua") - (counsel-load-theme dark-mode-theme t))))) + (load-theme dark-mode-theme t))))) (add-hook 'mac-effective-appearance-change-hook #'my/set-dark-or-light-theme) (if (boundp 'mac-effective-appearance-change-hook) (my/set-dark-or-light-theme) @@ -253,7 +254,6 @@ _p_rev _u_pper _=_: upper/lower _r_esolve :config (setq amx-history-length 100)) (use-package counsel - :functions (counsel-load-theme) :commands (counsel-unicode-char) :general ("M-x" #'counsel-M-x)) -- cgit 1.4.1