guidoschmidt / circadian.el

Theme-switching for Emacs based on daytime
https://guidoschmidt.github.io/circadian.el
MIT License
175 stars 8 forks source link

Problems with switching themes #5

Closed berhoel closed 7 years ago

berhoel commented 7 years ago

I tried leuven and distinguished as themes switched by circadian. Switching from leuven (MELPA version) to distinguished left some settings from leuven in the new theme, i.E. in gnus groups buffer the topic header were not readable because leuven sets bold to bold/black and distinguished leaves it this way

guidoschmidt commented 7 years ago

Nice found! I saw your fork and appreciate the improvement with mapc 'disable-theme 👍. Will be in the next version 🙂

berhoel commented 7 years ago

That's great.

I thought a bit about my idea of keeping the minor themes. Maybe using advices is the better way:

(defun my:refine-themes (&rest args)
  "Load refining themes. Using dummy ARGS."
  (load-theme 'org-beautify t)
  (sml/setup))
(use-package circadian :ensure
  :config
  (setq circadian-themes '(("8:00" . leuven)
                           ("19:30" . distinguished)))
  (if after-init-time
      (circadian-setup)
    (add-hook 'after-init-hook 'circadian-setup t))
  (advice-add 'circadian-setup :after 'my:refine-themes)
  (advice-add 'circadian-enable-theme :after 'my:refine-themes))

The last advice of course relies on an implementation detail, so maybe an circadian-after-theme-load-hook would be the better idea?

stardiviner commented 7 years ago

Yes, I found this issue too, should use disable-theme before load the next color-theme.

guidoschmidt commented 7 years ago

The first quick-win was mapc over custom-enabled-themes before loading a new theme, as proposed by @berhoel. Just added that to v0.2.3. I actually used advice in one of the first commits 🤔 (https://github.com/guidoschmidt/circadian.el/commit/07e79b8dd375b3be0768c9eaa6ecae8e1c090577) ...must have been lost on the way 😦 I will think about adding that back in for the next bigger release, much thanks for reporting and your good input 👍

berhoel commented 7 years ago

I'm glad i could help.