Subject: bug#57639: [PATCH] Add new command 'toggle-theme'

From: Lars Ingebrigtsen <[email-masked]>
Date: Sun, 11 Sep 2022 13:11:51 +0200

Philip Kaludercic <[email-masked]> writes:

> So we are thinking about something like a symbol property
> `theme-variants' that each theme symbol may have attached.  This symbol
> could point to a list representing a set of alternatives.  Let's say the
> set might contain the theme itself (for the sake of convenience), so it
> is remq'ed before we check if the set has more than one alternative.  If
> it does we use a modified `load-theme'-like prompt, otherwise we toggle.
> I think it would also make sense to silently remove non-existent themes
> automatically, in case a variant theme is not part of the same package.

I think that sounds correct, but I'm not 100% sure.  😀

>> And in addition, this tagging could be used for automatic dark/light OS
>> changes, so it's at least three birds with one stone.
>
> OK, but that is a long-term plan, or do the means already exist for
> detecting these kinds of changes?

Code exists for both Windows and Macos in the bug tracker somewhere, but
haven't been integrated yet because nobody has sat down to make a
consistent interface across all the platforms.

> Also, how to be distinguish between what is light and dark, and what do
> we do when a theme has multiple variants?

I'm not sure what you mean -- the proposal is to make the themes say
whether they consider themselves to be light or dark.  And I don't think
a theme would have multiple dark variants.