Subject: bug#51404: Support system dark mode on Windows 10

From: Eli Zaretskii <[email-masked]>
Date: Sat, 30 Oct 2021 20:39:17 +0300

> From: Vince Salvino <[email-masked]>
> CC: "[email-masked]" <[email-masked]>
> Date: Sat, 30 Oct 2021 17:13:13 +0000
> 
>  > define a variable exposed to Lisp using DEFVAR_BOOL; let's call it w32-follow-system-theme
> 
> My thought would be to give the user a bit more control. Rather than saying to follow system theme or not, perhaps they could choose from 3 values: follow theme, light, or dark, e.g.:
> 
> w32-system-theme:
> * nil: follow system theme (default)
> * light: force light mode (the old behavior)
> * dark: force dark mode

I'm not sure I understand why 'light' necessarily means the old
behavior: we didn't set any theme before this change, we just used the
Windows default.  So maybe there should be 4 values:

  nil: never follow the system theme (use Windows default)
  t: always follow the system theme
  light: force light theme (currently the same as nil)
  dark: force dark theme.

> Second, could you provide an existing value from early-init that I
> could follow as an example?

early-init is a file, called literally "early-init.el".  If you have
such a file in your ~/.emacs.d/ directory, Emacs will load it early on
during the startup.

> (I never knew early init was a thing, so I am going to research this - it will probably make my personal init customization a lot better too!)

The recommendation is to move to early-init.el only stuff that cannot
work in the normal init file.  That's because early-init is processed
when some of the infrastructure is not yet set up, so things could
fail there that will work correctly in the init file.