Closed stradicat closed 2 years ago
what if the logic of checking current time is executed whenever a new file is opened?
it has several benefits. First, you don't need to manually restart Emacs daemon. Second, I think it will avoid the conflict caused by the stored (ou dated) external state. Actually we don't need to store this state at all.
Instead we can store the last time the theme is switched due to day/night transition. So on opening of a new file, it promptly passes if the last switch is not long ago enough.
Or somehow establishing the corresponding theme at init time, and not letting desktop-read
manage the theme state.
not letting desktop-read manage the theme state
No, you should call desktop-read in the first place. If there's any config needs to be persistent, you should instead store them in your init file.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!
Description :octocat:
Theme colors, when using
geolocation-enable-automatic-theme-changer
, are only partially changed on automatic theme switch between Emacs exit and re-opening, afterdesktop-read
:If I exit Emacs after sunset with the dark theme on, and then open Emacs again the next morning after dawn executing
desktop-read
, the saved desktop state will try to bring up the dark theme but the light theme will be enforced by the time of day. This garbles the theme colours on both light and dark themes.This is a minor quirk/annoyance, but it's been present since the
0.100.x
days, and forces the user to hitSPC T n
twice to force-cycle between light and dark themes for correct display. I'm not fluent inelisp
, so I haven't been able to figure this out.Reproduction guide :beetle:
(geolocation :variables geolocation-enable-automatic-theme-changer t)
dotspacemacs-themes '(spacemacs-light spacemacs-dark)
(I'm usinggruvbox-light
anddoom-one
as light and dark themes respectively)desktop-read
.Alternatively:
desktop-read
.Observed behaviour: :eyes: :broken_heart: Theme colours are, for the most part, partially loaded after
desktop-read
, some background and text colours for UI elements belong to one theme whilst simultaneously other elements' colours belong to the opposite theme.Expected behaviour: :heart: :smile: Emacs opens with the corresponding theme correctly applied to every UI element.
System Info :computer: