guidoschmidt / circadian.el

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

hibernate system on weekend use wrong theme after system up #18

Closed tangxinfa closed 5 years ago

tangxinfa commented 5 years ago

My sunrise time is 6:11, sunset time is 18:25, the system is hibernated at 2018-09-15 21:44:23, and up at 2018-09-17 10:10:23.

In *Messages* we can see it switch themes one by one, and finally use the wrong theme tao-yin. When i reevaluate my circadian configurations the right theme tao-yang is used.

My circadian emacs configuration:

;; circadian
(use-package circadian
  :custom
  (circadian-themes (if t
                        ;;; colorless
                        '((:sunrise . tao-yang)
                          ("14:00" . base16-grayscale-dark)
                          (:sunset . tao-yin))
                      ;;; colorful
                      '((:sunrise . base16-summerfruit-light)
                        ("14:00" . base16-gruvbox-dark-medium)
                        (:sunset . base16-summerfruit-dark))))
  :config
  (cancel-function-timers #'circadian-enable-theme)
  (circadian-setup))

Message output:

[2018-09-15 21:44:23.396] Mark set
[2018-09-17 10:10:23.927] Preparing diary...
[2018-09-17 10:10:23.959] Preparing diary...done
[2018-09-17 10:10:25.450] Emacs color theme tao-yang
[2018-09-17 10:10:25.567] circadian.el — enabled tao-yang
[2018-09-17 10:10:26.267] Emacs color theme tao-yang
[2018-09-17 10:10:26.524] circadian.el — enabled tao-yang
[2018-09-17 10:10:28.238] Emacs color theme base16-grayscale-dark
[2018-09-17 10:10:28.268] circadian.el — enabled base16-grayscale-dark
[2018-09-17 10:10:29.286] Emacs color theme tao-yin
[2018-09-17 10:10:29.340] circadian.el — enabled tao-yin
guidoschmidt commented 5 years ago

Nice, thanks so much for the fix. As said in your PR: I'll try to merge as soon as I will get to it 🙂