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

From: Philip Kaludercic <[email-masked]>
Date: Fri, 14 Oct 2022 15:21:30 +0000

Mauro Aranda <[email-masked]> writes:

> Philip Kaludercic <[email-masked]> writes:
>
>> Mauro Aranda <[email-masked]> writes:
>
>>>>> Also, no documentation for these special properties for toggling
>      themes?
>>>>
>>>> Currently no.
>>>
>>> I hope there will be.
>>
>> I had to check the thread again, and the most that was said on the topic
>> was in <[email-masked]>.  So the idea would be to mention
>> :family, :kind and :background-mode and state that anything else is
>> undefined/shouldn't be used in case we decide to add another property in
>> the future?
>>
>> We should also specify what valid values are.  :family is just a symbol,
>> :background-mode is either 'light or 'dark, but what about :kind?
>
> I'm not really good at this, but something like:
>
> The following properties are supported:
> ':family': The value should be a symbol, the name of the family that the
> theme is part of.  [And insert here the explanation of family that Eli
> gave]
> ':kind': The value should be a symbol.  If a theme is enabled and this
> property has the value color-scheme, then the theme-choose-variant
> command will look for other available themes that belong to the same
> family in order to switch the themes.

Sounds good, I'll try to work this in.

> I didn't include background-mode because the code does nothing with that
> property, AFAICT.

True, but the long term idea is for Emacs to be able to use this
property when the system switches between dark and light mode.

>>>>>> +(defun theme-choose-variant (&optional no-confirm no-enable)
>>>>>> +  "Prompt to switch from the current theme to one of its a variants.
>>>>>
>>>>> I'd say: "Command to switch..."
>>>>
>>>> Do you think it is necessary to point out that it is a command?
>>>
>>> OK, maybe not.  But why start with "Prompt to"? It is likely that it
>>> will not prompt.  Why not get rid of it?
>>
>> Good point, so why not just
>>
>>      Switch from the current theme to one of its a variants.
>
> I think that's better, yes.  I think the "a" between "its" and
> "variants" is a typo.

Of course, thanks for catching that!