GNU bug report logs - #57639
[PATCH] Add new command 'toggle-theme'

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Philip Kaludercic <philipk@HIDDEN>; Keywords: patch; dated Wed, 7 Sep 2022 07:20:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 21 Sep 2022 11:46:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 21 07:46:20 2022
Received: from localhost ([127.0.0.1]:60955 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oayBI-0002mp-88
	for submit <at> debbugs.gnu.org; Wed, 21 Sep 2022 07:46:20 -0400
Received: from mout02.posteo.de ([185.67.36.66]:56783)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oayBG-0002md-E0
 for 57639 <at> debbugs.gnu.org; Wed, 21 Sep 2022 07:46:19 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id DFD6F240104
 for <57639 <at> debbugs.gnu.org>; Wed, 21 Sep 2022 13:46:12 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1663760772; bh=n3KvYLs/2FmlOJkGdHMfeJPDMlAJEwdBVhmEWvUg8RM=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=O5nLZxOanFasjaeSLU/xskK55ewBfPT2kmKfawTPSWhI43X89OdHmbfDG0WotPkrN
 5BV2egPN3M8kMieuy9H30ykmONo7vTus0lo3HpmIUijsyYbEDAHNmRrtU19Aoww4WZ
 dU4n3T07Ik3FtIOCGue93hD/FRSUtVzdB4z+aek6kVzudH1x+at4B9u2ycDMBQbCis
 7wKwqwc0LewaE3S+lAs11thItt7C8gNsQ3skWmXbYcOvKN6IkHyqsmKNbL8P1bAvNM
 04LoDIIy4e/itFgiMKHHHDKrs7V/0kpEFyLxmlyluDv7GTPW5NxCKj/j/WxuBH+uRR
 WWvSK0aBCRhmg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MXc7R6YCyz6tmK;
 Wed, 21 Sep 2022 13:46:11 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <871qs57yai.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Wed,
 21 Sep 2022 13:38:13 +0200")
References: <875yhzmz25.fsf@HIDDEN> <877d269kgv.fsf@HIDDEN>
 <87bkriyqci.fsf@HIDDEN> <874jxa6kyj.fsf@HIDDEN>
 <87o7vdg97w.fsf@HIDDEN> <831qs926np.fsf@HIDDEN>
 <871qs9fzz5.fsf@HIDDEN> <83h715yxz2.fsf@HIDDEN>
 <87h715dnut.fsf@HIDDEN> <87edw955ls.fsf@HIDDEN>
 <8735coewsk.fsf@HIDDEN> <871qs7ztgq.fsf@HIDDEN>
 <87o7vbg56k.fsf@HIDDEN> <874jx3ye41.fsf@HIDDEN>
 <87bkrbfz8l.fsf@HIDDEN> <871qs5lpo2.fsf@HIDDEN>
 <87mtatagzv.fsf@HIDDEN> <87edw5n2zm.fsf@HIDDEN>
 <87o7v97zy2.fsf@HIDDEN> <87bkr9newj.fsf@HIDDEN>
 <871qs57yai.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Wed, 21 Sep 2022 11:46:06 +0000
Message-ID: <87y1udlzlt.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: Eli Zaretskii <eliz@HIDDEN>, 57639 <at> debbugs.gnu.org,
 Protesilaos Stavrou <info@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>> Ok, that sounds good.  Here is the updated patch:
>
> [...]
>
>> This is actually done a few times by the modus themes and at least once
>> by `leuven-dark' (see `leuven-dark-scale-font', tough I don't see why,
>> and if the autoloads aren't being generated to begin with the cookie is
>> pointless anyway).
>> 
>> Should this be addressed before the patch is pushed?
>
> Hm...  are these themes also distributed via ELPA or something?  But in
> any case, I don't see why you'd have:

Modus-themes is distributed via GNU ELPA, and Leuven via MELPA.  I
didn't modify Modus-themes because I know it is sync'ed back regularly,
but now that I think about it I don't know if I ought to have changed
those either...

> ;;;###autoload
> (defun leuven-dark-scale-font (control default-height)
>
> If you've activated the theme, you've loaded the file, so autoloading a
> function like that doesn't seem helpful in any case.
>
> So I think that sounds like it's just a mistake, and the ;;;###autoload
> should be removed.  And the same with the commands autoloaded in modus
> themes?  But perhaps there's a reason; I've added Prot to the CCs.
> Perhaps he can clarify why those autoloads are in modus*.el.
>
> But this looks more problematic:
>
> ;;;###autoload
> (when (and (boundp 'custom-theme-load-path)
>            load-file-name)
>   ;; Add theme folder to `custom-theme-load-path' when installing over MELPA.
>   (add-to-list 'custom-theme-load-path
>                (file-name-as-directory (file-name-directory load-file-name))))
>
> We don't want that in the Emacs loaddefs file, so just adding etc/themes
> to our Makefile won't be the right thing to do, and we have to find a
> different way to fix this.
>
> Uhm...  Uhm...  I don't immediately see a good way to fix this...

There probably is not automatic way to resolve this issue, but perhaps
it might be enough to remind all the external theme maintainers to
remove these snippets before updating the files in emacs.git.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 21 Sep 2022 11:38:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 21 07:38:27 2022
Received: from localhost ([127.0.0.1]:60919 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oay3e-0000La-Qg
	for submit <at> debbugs.gnu.org; Wed, 21 Sep 2022 07:38:27 -0400
Received: from quimby.gnus.org ([95.216.78.240]:36476)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oay3d-0000LK-3A
 for 57639 <at> debbugs.gnu.org; Wed, 21 Sep 2022 07:38:25 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=uT8Pbi6m3gRUu3CfXErhpVSPw0dhTfp6P5Wkvc5WMVU=; b=R/y7QgA341yaqJAaS/uWOxyrSK
 91fLXLcuf2A+aJ/+IUBGKShTZBK3FA9jl9pb7bIIHcKsHV+f8n9zd4oZvyJ3d1YC/VQFzNP8rI7RO
 4ywwSyKasHhuz0s8wAoYoYXSYFWi22jv6yidKcA98M1Q6pkYkwf8lhXxXKbALzyx3pRY=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oay3T-0004UO-CN; Wed, 21 Sep 2022 13:38:17 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <87bkr9newj.fsf@HIDDEN> (Philip Kaludercic's message of "Wed, 
 21 Sep 2022 11:30:20 +0000")
References: <875yhzmz25.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN> <87o7vdg97w.fsf@HIDDEN>
 <831qs926np.fsf@HIDDEN> <871qs9fzz5.fsf@HIDDEN>
 <83h715yxz2.fsf@HIDDEN> <87h715dnut.fsf@HIDDEN>
 <87edw955ls.fsf@HIDDEN> <8735coewsk.fsf@HIDDEN>
 <871qs7ztgq.fsf@HIDDEN> <87o7vbg56k.fsf@HIDDEN>
 <874jx3ye41.fsf@HIDDEN> <87bkrbfz8l.fsf@HIDDEN>
 <871qs5lpo2.fsf@HIDDEN> <87mtatagzv.fsf@HIDDEN>
 <87edw5n2zm.fsf@HIDDEN> <87o7v97zy2.fsf@HIDDEN>
 <87bkr9newj.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEUFAwQtGxNVPRu8
 oC67QBj///9p7MsAAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+YJFQsUGrmHVi0AAAG0SURBVDjLdZSN
 lYMwCIAhtwBJHcBEFzhxgGtk/5kOSFqj16PvtZUvhH8BYheKBB8ES4mx6NedBuacmGuED+DBPAN8
 tNiQ8HZZA093lq9APReCDMl+BmB6Paq608RubSAaSKm0GII+N5AkyYxFb+u55Q5WOfYtbDO0yDB1
 wLscIjNvr2ropwElIs8gtYc1O1g6qYTNhbryq7igSCNnCmSZF1jFpfaqBKJWEpAulcaSbHmSg9nJ
 FdAj/wMWKR7wDRQ6Kk3qYJUy9DFshZb6rUCs83gFO6+H5BxTvlmoZ96m74zP0UcGHYb92FG7MVro
 gHyxym4R/QG7Akt7voJgFix5iAkwMAG+QOy1TbkUtLYtDnp6WJK12/0V7Ycm0gFqzwnBnmLU+so5
 o+6L/I+SE5SM7/CiFqsQYh+r8AKICjLkh9cE+wkfsSRV7RYNXvVwJqQGs8c9+yC+Nk+PTF4mX60Q
 c8IGeuNScmBXpaZZm0/e3svYnKD1j3DVuhzjUkVKYtNbdYjqoLc1mZRInJh/RqCZoU11TusxdArA
 Wjf5TK8y6sHmD3Xg63Q8LyB5JPqqSZdFvwn+Aim9Vvm0oiCCAAAAJXRFWHRkYXRlOmNyZWF0ZQAy
 MDIyLTA5LTIxVDExOjIwOjI2KzAwOjAwv9uAjAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wOS0y
 MVQxMToyMDoyNiswMDowMM6GODAAAAAASUVORK5CYII=
X-Now-Playing: Niki Mono's _Contradictions are a Luxury_: "Baby's On Fire
 (Instrumental)"
Date: Wed, 21 Sep 2022 13:38:13 +0200
Message-ID: <871qs57yai.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Philip Kaludercic <philipk@HIDDEN> writes: > Ok, that
 sounds good. Here is the updated patch: [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: Eli Zaretskii <eliz@HIDDEN>, 57639 <at> debbugs.gnu.org,
 Protesilaos Stavrou <info@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

> Ok, that sounds good.  Here is the updated patch:

[...]

> This is actually done a few times by the modus themes and at least once
> by `leuven-dark' (see `leuven-dark-scale-font', tough I don't see why,
> and if the autoloads aren't being generated to begin with the cookie is
> pointless anyway).
> 
> Should this be addressed before the patch is pushed?

Hm...  are these themes also distributed via ELPA or something?  But in
any case, I don't see why you'd have:

;;;###autoload
(defun leuven-dark-scale-font (control default-height)

If you've activated the theme, you've loaded the file, so autoloading a
function like that doesn't seem helpful in any case.

So I think that sounds like it's just a mistake, and the ;;;###autoload
should be removed.  And the same with the commands autoloaded in modus
themes?  But perhaps there's a reason; I've added Prot to the CCs.
Perhaps he can clarify why those autoloads are in modus*.el.

But this looks more problematic:

;;;###autoload
(when (and (boundp 'custom-theme-load-path)
           load-file-name)
  ;; Add theme folder to `custom-theme-load-path' when installing over MELPA.
  (add-to-list 'custom-theme-load-path
               (file-name-as-directory (file-name-directory load-file-name))))

We don't want that in the Emacs loaddefs file, so just adding etc/themes
to our Makefile won't be the right thing to do, and we have to find a
different way to fix this.

Uhm...  Uhm...  I don't immediately see a good way to fix this...




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 21 Sep 2022 11:30:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 21 07:30:35 2022
Received: from localhost ([127.0.0.1]:60889 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oaxw1-00082M-Vl
	for submit <at> debbugs.gnu.org; Wed, 21 Sep 2022 07:30:35 -0400
Received: from mout01.posteo.de ([185.67.36.65]:48339)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oaxvy-0007cs-VB
 for 57639 <at> debbugs.gnu.org; Wed, 21 Sep 2022 07:30:32 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id C8432240026
 for <57639 <at> debbugs.gnu.org>; Wed, 21 Sep 2022 13:30:23 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1663759824; bh=ro6VVXzEisEQzWAL95mtS5jQGmJqlZi5A7Kdf2cKnuc=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=oc/PPTgS7v+G6NJH4vnRPTqmpLycqo3ZVH54rLGRBgnmsJVI5vIJ6y21rYRQ4YmDK
 7/Iy5KRdNmpOfAhpcS4px4hNZoIazIQardmjImtOb1hMGOgGpELU9KXsBrOUOXAK96
 vsznAHweuRZU5+hj+8eMvkMU+8QCNGz0NyTIEl0g1/6RlVP5ntzk/gZZJZcC95DDhn
 Ved7q+vbM3opflRJB7kCWMeTz1cCV0HskP4et0tEA7MU/0mU27verVWCrRNkcuicFq
 NophtHF+7BPVrTdw7V1I1Wc3y+g3BhgdSiCQ5Y0HF6uNou1wk6O9gjx7KN3OOke6mL
 +EvlXchAYLFLQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MXbnC1lB7z9rxP;
 Wed, 21 Sep 2022 13:30:20 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <87o7v97zy2.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Wed,
 21 Sep 2022 13:02:29 +0200")
References: <875yhzmz25.fsf@HIDDEN> <8735cxpx2r.fsf@HIDDEN>
 <87k066yyn0.fsf@HIDDEN> <877d269kgv.fsf@HIDDEN>
 <87bkriyqci.fsf@HIDDEN> <874jxa6kyj.fsf@HIDDEN>
 <87o7vdg97w.fsf@HIDDEN> <831qs926np.fsf@HIDDEN>
 <871qs9fzz5.fsf@HIDDEN> <83h715yxz2.fsf@HIDDEN>
 <87h715dnut.fsf@HIDDEN> <87edw955ls.fsf@HIDDEN>
 <8735coewsk.fsf@HIDDEN> <871qs7ztgq.fsf@HIDDEN>
 <87o7vbg56k.fsf@HIDDEN> <874jx3ye41.fsf@HIDDEN>
 <87bkrbfz8l.fsf@HIDDEN> <871qs5lpo2.fsf@HIDDEN>
 <87mtatagzv.fsf@HIDDEN> <87edw5n2zm.fsf@HIDDEN>
 <87o7v97zy2.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Wed, 21 Sep 2022 11:30:20 +0000
Message-ID: <87bkr9newj.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: Eli Zaretskii <eliz@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>>> autoloads: $(lisp)/emacs-lisp/loaddefs-gen.elc gen-lisp
>>> 	$(AM_V_GEN)$(emacs) \
>>>             -l $(lisp)/emacs-lisp/loaddefs-gen.elc \
>>> 	    -f loaddefs-generate--emacs-batch ${SUBDIRS_ALMOST}
>>>
>>> We can add ../etc/themes there after ${SUBDIRS_ALMOST}, though.
>>
>> Would there be a disadvantage to doing so?
>
> There's no problems when doing
>
> ;;;###autoload(put ...)

Ok, that sounds good.  Here is the updated patch:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=0001-Tag-themes-with-properties.patch

From 6e6c5a9cf356b5f634ba388f8e2724a1de893297 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@HIDDEN>
Date: Sat, 17 Sep 2022 20:11:42 +0200
Subject: [PATCH] Tag themes with properties

* doc/emacs/custom.texi (Custom Themes): Document 'theme-choose-variant'.
* doc/lispref/customize.texi (Custom Themes): Document the new
optional argument to 'deftheme'.
* etc/themes/adwaita-theme.el (adwaita): Add properties.
* etc/themes/deeper-blue-theme.el (deeper-blue): Add properties.
* etc/themes/dichromacy-theme.el (dichromacy): Add properties.
* etc/themes/light-blue-theme.el (light-blue): Add properties.
* etc/themes/manoj-dark-theme.el (manoj-dark): Add properties.
* etc/themes/misterioso-theme.el (misterioso): Add properties.
* etc/themes/tango-dark-theme.el (tango-dark): Add properties.
* etc/themes/tango-theme.el (tango): Add properties.
* etc/themes/tsdh-dark-theme.el (tsdh-dark): Add properties.
* etc/themes/tsdh-light-theme.el (tsdh-light): Add properties.
* etc/themes/wheatgrass-theme.el (wheatgrass): Add properties.
* etc/themes/whiteboard-theme.el (whiteboard): Add properties.
* etc/themes/wombat-theme.el (wombat): Add properties.
* lisp/custom.el (deftheme): Allow for optional arguments to set the
property list.
(custom-declare-theme): Accept the same optional arguments as 'deftheme'.
(theme-list-variants): Add new function.
(theme-choose-variant): Add new command for switching between members
of a theme family.
(toggle-theme): Add an alias for 'theme-choose-variant'.  (Bug#57639)

This patch adds theme properties twice, once as part of the deftheme
declarations and once by explicitly manipulating the symbol plist.
Ideally only the first case would be necessary, but in that case the
theme properties only become visible after the theme has been loaded
which is (initially) unfortunate if you want to toggle between themes.
---
 doc/emacs/custom.texi           | 10 +++++
 doc/lispref/customize.texi      |  5 ++-
 etc/themes/adwaita-theme.el     |  6 ++-
 etc/themes/deeper-blue-theme.el |  6 ++-
 etc/themes/dichromacy-theme.el  |  6 ++-
 etc/themes/leuven-dark-theme.el |  9 ++++-
 etc/themes/leuven-theme.el      |  9 ++++-
 etc/themes/light-blue-theme.el  |  6 ++-
 etc/themes/manoj-dark-theme.el  |  6 ++-
 etc/themes/misterioso-theme.el  |  6 ++-
 etc/themes/tango-dark-theme.el  |  7 +++-
 etc/themes/tango-theme.el       |  7 +++-
 etc/themes/tsdh-dark-theme.el   |  7 +++-
 etc/themes/tsdh-light-theme.el  |  7 +++-
 etc/themes/wheatgrass-theme.el  |  6 ++-
 etc/themes/whiteboard-theme.el  |  6 ++-
 etc/themes/wombat-theme.el      |  6 ++-
 lisp/custom.el                  | 70 ++++++++++++++++++++++++++++++---
 18 files changed, 160 insertions(+), 25 deletions(-)

diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index ff7ab83190..f98527bf9a 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -667,6 +667,16 @@ Custom Themes
 the @file{*Custom Themes*} buffer; or type @kbd{M-x describe-theme}
 anywhere in Emacs and enter the theme name.
 
+@findex theme-choose-variant
+Some themes have variants (most often just two: light and dark).  You
+can switch to another variant using @kbd{M-x theme-choose-variant}.
+If the currently active theme has only one other variant, it will be
+selected; if there are more variants, the command will prompt you
+which one to switch to.
+
+Note that @code{theme-choose-variant} only works if a single theme
+is active.
+
 @node Creating Custom Themes
 @subsection Creating Custom Themes
 @cindex custom themes, creating
diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi
index 6ba35cffff..911b6c4d75 100644
--- a/doc/lispref/customize.texi
+++ b/doc/lispref/customize.texi
@@ -1428,12 +1428,13 @@ Custom Themes
 be a call to @code{deftheme}, and the last form should be a call to
 @code{provide-theme}.
 
-@defmac deftheme theme &optional doc
+@defmac deftheme theme &optional doc &rest properties
 This macro declares @var{theme} (a symbol) as the name of a Custom
 theme.  The optional argument @var{doc} should be a string describing
 the theme; this is the description shown when the user invokes the
 @code{describe-theme} command or types @kbd{?} in the @samp{*Custom
-Themes*} buffer.
+Themes*} buffer.  The remaining arguments @var{properties} are used
+pass a property list with theme attributes.
 
 Two special theme names are disallowed (using them causes an error):
 @code{user} is a dummy theme that stores the user's direct
diff --git a/etc/themes/adwaita-theme.el b/etc/themes/adwaita-theme.el
index ba83a0578c..c1d694f5dc 100644
--- a/etc/themes/adwaita-theme.el
+++ b/etc/themes/adwaita-theme.el
@@ -24,7 +24,11 @@
 (deftheme adwaita
   "Face colors similar to the default theme of Gnome 3 (Adwaita).
 The colors are chosen to match Adwaita window decorations and the
-default look of the Gnome 3 desktop.")
+default look of the Gnome 3 desktop."
+  :background-mode 'light
+  :kind 'color-scheme)
+
+;;;###autoload (put 'adwaita 'theme-properties '(:background-mode light :kind color-scheme))
 
 (let ((class '((class color) (min-colors 89))))
   (custom-theme-set-faces
diff --git a/etc/themes/deeper-blue-theme.el b/etc/themes/deeper-blue-theme.el
index 8f19147f91..13abbe0672 100644
--- a/etc/themes/deeper-blue-theme.el
+++ b/etc/themes/deeper-blue-theme.el
@@ -22,7 +22,11 @@
 ;;; Code:
 
 (deftheme deeper-blue
-  "Face colors using a deep blue background.")
+  "Face colors using a deep blue background."
+  :background-mode 'dark
+  :kind 'color-scheme)
+
+;;;###autoload (put 'deeper-blue 'theme-properties '(:background-mode dark :kind color-scheme))
 
 (let ((class '((class color) (min-colors 89))))
   (custom-theme-set-faces
diff --git a/etc/themes/dichromacy-theme.el b/etc/themes/dichromacy-theme.el
index d53c075d92..a25d2c310f 100644
--- a/etc/themes/dichromacy-theme.el
+++ b/etc/themes/dichromacy-theme.el
@@ -28,7 +28,11 @@ dichromacy
 differentiated by individuals with protanopia or deuteranopia.
 
 Basic, Font Lock, Isearch, Gnus, Message, Flyspell, and
-Ansi-Color faces are included.")
+Ansi-Color faces are included."
+  :background-mode 'light
+  :kind 'color-scheme)
+
+;;;###autoload (put 'dichromacy 'theme-properties '(:background-mode light :kind color-scheme))
 
 (let ((class '((class color) (min-colors 89)))
       (orange "#e69f00")
diff --git a/etc/themes/leuven-dark-theme.el b/etc/themes/leuven-dark-theme.el
index 0e162c8bab..0d3e1970ac 100644
--- a/etc/themes/leuven-dark-theme.el
+++ b/etc/themes/leuven-dark-theme.el
@@ -5,7 +5,7 @@
 ;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")>
 ;; Contributor: Thibault Polge <(concat "thibault" at-sign "thb.lt")>
 ;; URL: https://github.com/fniessen/emacs-leuven-dark-theme
-;; Version: 20220202.1126
+;; Version: 20220921.1327
 ;; Keywords: color theme
 
 ;; This file is part of GNU Emacs.
@@ -97,7 +97,12 @@ leuven-dark
   "Face colors with a light background.
 Basic, Font Lock, Isearch, Gnus, Message, Org mode, Diff, Ediff,
 Flyspell, Semantic, and Ansi-Color faces are included -- and much
-more...")
+more..."
+  :background-mode 'dark
+  :family 'leuven
+  :kind 'color-scheme)
+
+;;;###autoload (put 'leuven-dark 'theme-properties '(:background-mode dark :family leuven :kind color-scheme))
 
 (let ((class '((class color) (min-colors 89)))
 
diff --git a/etc/themes/leuven-theme.el b/etc/themes/leuven-theme.el
index d9a8d5391a..0bbc69aa05 100644
--- a/etc/themes/leuven-theme.el
+++ b/etc/themes/leuven-theme.el
@@ -4,7 +4,7 @@
 
 ;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")>
 ;; URL: https://github.com/fniessen/emacs-leuven-theme
-;; Version: 20200513.1928
+;; Version: 20220921.1328
 ;; Keywords: color theme
 
 ;; This file is part of GNU Emacs.
@@ -78,7 +78,12 @@ leuven
   "Face colors with a light background.
 Basic, Font Lock, Isearch, Gnus, Message, Org mode, Diff, Ediff,
 Flyspell, Semantic, and Ansi-Color faces are included -- and much
-more...")
+more..."
+  :background-mode 'light
+  :kind 'color-scheme
+  :family 'leuven)
+
+;;;###autoload (put 'leuven 'theme-properties '(:background-mode light :family leuven :kind color-scheme))
 
 (let ((class '((class color) (min-colors 89)))
 
diff --git a/etc/themes/light-blue-theme.el b/etc/themes/light-blue-theme.el
index eeca46210c..ff1fde85a9 100644
--- a/etc/themes/light-blue-theme.el
+++ b/etc/themes/light-blue-theme.el
@@ -27,7 +27,11 @@
 ;;; Code:
 
 (deftheme light-blue
-  "Face colors utilizing a light blue background.")
+  "Face colors utilizing a light blue background."
+  :background-mode 'light
+  :kind 'color-scheme)
+
+;;;###autoload (put 'light-blue 'theme-properties '(:background-mode light :kind color-scheme))
 
 (make-obsolete 'light-blue nil "29.1")
 
diff --git a/etc/themes/manoj-dark-theme.el b/etc/themes/manoj-dark-theme.el
index af5576386c..791ad2f353 100644
--- a/etc/themes/manoj-dark-theme.el
+++ b/etc/themes/manoj-dark-theme.el
@@ -67,7 +67,11 @@
 (deftheme manoj-dark
   "Very high contrast faces with a black background.
 This theme avoids subtle color variations, while avoiding the
-jarring angry fruit salad look to reduce eye fatigue.")
+jarring angry fruit salad look to reduce eye fatigue."
+  :background-mode 'dark
+  :kind 'color-scheme)
+
+;;;###autoload (put 'manoj-dark 'theme-properties '(:background-mode dark :kind color-scheme))
 
 (custom-theme-set-faces
  'manoj-dark
diff --git a/etc/themes/misterioso-theme.el b/etc/themes/misterioso-theme.el
index 55186384ad..e7e5dac3dc 100644
--- a/etc/themes/misterioso-theme.el
+++ b/etc/themes/misterioso-theme.el
@@ -22,7 +22,11 @@
 ;;; Code:
 
 (deftheme misterioso
-  "Predominantly blue/cyan faces on a dark cyan background.")
+  "Predominantly blue/cyan faces on a dark cyan background."
+  :background-mode 'dark
+  :kind 'color-scheme)
+
+;;;###autoload (put 'misterioso 'theme-properties '(:background-mode dark :kind color-scheme))
 
 (let ((class '((class color) (min-colors 89))))
 
diff --git a/etc/themes/tango-dark-theme.el b/etc/themes/tango-dark-theme.el
index ef00d2ac49..f7d13c5bd5 100644
--- a/etc/themes/tango-dark-theme.el
+++ b/etc/themes/tango-dark-theme.el
@@ -30,7 +30,12 @@
 (deftheme tango-dark
   "Face colors using the Tango palette (dark background).
 Basic, Font Lock, Isearch, Gnus, Message, Ediff, Flyspell,
-Semantic, and Ansi-Color faces are included.")
+Semantic, and Ansi-Color faces are included."
+  :background-mode 'dark
+  :kind 'color-scheme
+  :family 'tango)
+
+;;;###autoload (put 'tango-dark 'theme-properties '(:background-mode dark :kind color-scheme :family tango))
 
 (let ((class '((class color) (min-colors 89)))
       ;; Tango palette colors.
diff --git a/etc/themes/tango-theme.el b/etc/themes/tango-theme.el
index ecbbf03753..8df3f50ded 100644
--- a/etc/themes/tango-theme.el
+++ b/etc/themes/tango-theme.el
@@ -30,7 +30,12 @@
 (deftheme tango
   "Face colors using the Tango palette (light background).
 Basic, Font Lock, Isearch, Gnus, Message, Ediff, Flyspell,
-Semantic, and Ansi-Color faces are included.")
+Semantic, and Ansi-Color faces are included."
+  :background-mode 'light
+  :kind 'color-scheme
+  :family 'tango)
+
+;;;###autoload (put 'tango 'theme-properties '(:background-mode light :kind color-scheme :family tango))
 
 (let ((class '((class color) (min-colors 89)))
       ;; Tango palette colors.
diff --git a/etc/themes/tsdh-dark-theme.el b/etc/themes/tsdh-dark-theme.el
index a88ad75520..afb915dcce 100644
--- a/etc/themes/tsdh-dark-theme.el
+++ b/etc/themes/tsdh-dark-theme.el
@@ -20,7 +20,12 @@
 ;;; Code:
 
 (deftheme tsdh-dark
-  "A dark theme used and created by Tassilo Horn.")
+  "A dark theme used and created by Tassilo Horn."
+  :background-mode 'dark
+  :kind 'color-scheme
+  :family 'tsdh)
+
+;;;###autoload (put 'tsdh-dark 'theme-properties '(:background-mode dark :kind color-scheme :family tsdh))
 
 (custom-theme-set-faces
  'tsdh-dark
diff --git a/etc/themes/tsdh-light-theme.el b/etc/themes/tsdh-light-theme.el
index d9d09b702b..7fad6c337a 100644
--- a/etc/themes/tsdh-light-theme.el
+++ b/etc/themes/tsdh-light-theme.el
@@ -21,7 +21,12 @@
 
 (deftheme tsdh-light
   "A light Emacs theme.
-Used and created by Tassilo Horn.")
+Used and created by Tassilo Horn."
+  :background-mode 'light
+  :kind 'color-scheme
+  :family 'tsdh)
+
+;;;###autoload (put 'tsdh-light 'theme-properties '(:background-mode light :kind color-scheme :family tsdh))
 
 (custom-theme-set-faces
  'tsdh-light
diff --git a/etc/themes/wheatgrass-theme.el b/etc/themes/wheatgrass-theme.el
index c56c8a2d8a..81aa68cb34 100644
--- a/etc/themes/wheatgrass-theme.el
+++ b/etc/themes/wheatgrass-theme.el
@@ -23,7 +23,11 @@ wheatgrass
   "High-contrast green/blue/brown faces on a black background.
 Basic, Font Lock, Isearch, Gnus, and Message faces are included.
 The default face foreground is wheat, with other faces in shades
-of green, brown, and blue.")
+of green, brown, and blue."
+  :background-mode 'dark
+  :kind 'color-scheme)
+
+;;;###autoload (put 'wheatgrass 'theme-properties '(:background-mode dark :kind color-scheme))
 
 (let ((class '((class color) (min-colors 89))))
   (custom-theme-set-faces
diff --git a/etc/themes/whiteboard-theme.el b/etc/themes/whiteboard-theme.el
index f21b18b421..7b92510049 100644
--- a/etc/themes/whiteboard-theme.el
+++ b/etc/themes/whiteboard-theme.el
@@ -22,7 +22,11 @@
 ;;; Code:
 
 (deftheme whiteboard
-  "Face colors similar to markers on a whiteboard.")
+  "Face colors similar to markers on a whiteboard."
+  :background-mode 'light
+  :kind 'color-scheme)
+
+;;;###autoload (put 'whiteboard 'theme-properties '(:background-mode light :kind color-scheme))
 
 (let ((class '((class color) (min-colors 89))))
   (custom-theme-set-faces
diff --git a/etc/themes/wombat-theme.el b/etc/themes/wombat-theme.el
index d9fab8ac78..2d0669f632 100644
--- a/etc/themes/wombat-theme.el
+++ b/etc/themes/wombat-theme.el
@@ -25,7 +25,11 @@ wombat
   "Medium-contrast faces with a dark gray background.
 Adapted, with permission, from a Vim color scheme by Lars H. Nielsen.
 Basic, Font Lock, Isearch, Gnus, Message, and Ansi-Color faces
-are included.")
+are included."
+  :background-mode 'dark
+  :kind 'color-scheme)
+
+;;;###autoload (put 'wombat 'theme-properties '(:background-mode dark :kind color-scheme))
 
 (let ((class '((class color) (min-colors 89))))
   (custom-theme-set-faces
diff --git a/lisp/custom.el b/lisp/custom.el
index 352b5b0e16..93ea80ef43 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -1152,9 +1152,11 @@ custom--sort-vars-1
 ;;   (provide-theme 'THEME)
 
 
-(defmacro deftheme (theme &optional doc)
+(defmacro deftheme (theme &optional doc &rest properties)
   "Declare THEME to be a Custom theme.
 The optional argument DOC is a doc string describing the theme.
+PROPERTIES are interpreted as a property list that will be stored
+in the `theme-properties' property for THEME.
 
 Any theme `foo' should be defined in a file called `foo-theme.el';
 see `custom-make-theme-feature' for more information."
@@ -1164,18 +1166,25 @@ deftheme
     ;; It is better not to use backquote in this file,
     ;; because that makes a bootstrapping problem
     ;; if you need to recompile all the Lisp files using interpreted code.
-    (list 'custom-declare-theme (list 'quote theme) (list 'quote feature) doc)))
+    (list 'custom-declare-theme (list 'quote theme) (list 'quote feature) doc
+          (cons 'list properties))))
 
-(defun custom-declare-theme (theme feature &optional doc)
+(defun custom-declare-theme (theme feature &optional doc properties)
   "Like `deftheme', but THEME is evaluated as a normal argument.
-FEATURE is the feature this theme provides.  Normally, this is a symbol
-created from THEME by `custom-make-theme-feature'."
+FEATURE is the feature this theme provides.  Normally, this is a
+symbol created from THEME by `custom-make-theme-feature'.  The
+optional argument DOC may contain the documentation for THEME.
+The optional argument PROPERTIES may contain a property list of
+attributes associated with THEME."
   (unless (custom-theme-name-valid-p theme)
     (error "Custom theme cannot be named %S" theme))
   (unless (memq theme custom-known-themes)
     (push theme custom-known-themes))
   (put theme 'theme-feature feature)
-  (when doc (put theme 'theme-documentation doc)))
+  (when doc
+    (put theme 'theme-documentation doc))
+  (when properties
+    (put theme 'theme-properties properties)))
 
 (defun custom-make-theme-feature (theme)
   "Given a symbol THEME, create a new symbol by appending \"-theme\".
@@ -1372,6 +1381,55 @@ load-theme
     (enable-theme theme))
   t)
 
+(defun theme-list-variants (theme)
+  "Return a list of theme variants for THEME."
+  (let* ((properties (get theme 'theme-properties))
+         (family (plist-get properties :family)))
+    (when family
+      (seq-filter
+       (lambda (variant)
+         (and (eq (plist-get (get variant 'theme-properties) :family)
+                  family)
+              (not (eq variant theme))))
+       (custom-available-themes)))))
+
+(defun theme-choose-variant (&optional no-confirm no-enable)
+  "Prompt to switch from the current theme to one of its a variants.
+The current theme will be disabled before variant is enabled.  If
+the current theme has only one variant, switch to that variant
+without prompting, otherwise prompt for the variant to select.
+See `load-theme' for the meaning of NO-CONFIRM and NO-ENABLE."
+  (interactive)
+  (let ((active-color-schemes
+         (seq-filter
+          (lambda (theme)
+            ;; FIXME: As most themes currently do not have a `:kind'
+            ;; tag, it is assumed that a theme is a color scheme by
+            ;; default.  This should be reconsidered in the future.
+            (memq (plist-get (get theme 'theme-properties) :kind)
+                  '(color-scheme nil)))
+          custom-enabled-themes)))
+    (cond
+     ((length= active-color-schemes 0)
+      (user-error "No theme is active, cannot toggle"))
+     ((length> active-color-schemes 1)
+      (user-error "More than one theme active, cannot unambiguously toggle")))
+    (let* ((theme (car active-color-schemes))
+           (family (plist-get (get theme 'theme-properties) :family)))
+      (unless family
+        (error "Theme `%s' does not have any known variants" theme))
+      (let* ((variants (theme-list-variants theme))
+             (choice (cond
+                      ((null variants)
+                       (error "`%s' has no variants" theme))
+                      ((length= variants 1)
+                       (car variants))
+                      ((intern (completing-read "Load custom theme: " variants))))))
+        (disable-theme theme)
+        (load-theme choice no-confirm no-enable)))))
+
+(defalias 'toggle-theme #'theme-choose-variant)
+
 (defun custom-theme-load-confirm (hash)
   "Query the user about loading a Custom theme that may not be safe.
 The theme should be in the current buffer.  If the user agrees,
-- 
2.37.3


--=-=-=
Content-Type: text/plain


> because those are entered into the loaddefs.el file literally.  There
> may be some confusion if people start putting
>
> ;;;###autoload
> (defun ...)
>
> into the theme files, because the etc/themes directory is not in
> `load-path' (so those autoloads will fail).
>
> So it has a slightly inconsistent effect, but I don't think there'll be
> a problem in practice, because people don't put functions into the theme
> files.  *knocks on wood*

This is actually done a few times by the modus themes and at least once
by `leuven-dark' (see `leuven-dark-scale-font', tough I don't see why,
and if the autoloads aren't being generated to begin with the cookie is
pointless anyway).

Should this be addressed before the patch is pushed?

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 21 Sep 2022 11:02:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 21 07:02:43 2022
Received: from localhost ([127.0.0.1]:60833 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oaxV5-0005e5-53
	for submit <at> debbugs.gnu.org; Wed, 21 Sep 2022 07:02:43 -0400
Received: from quimby.gnus.org ([95.216.78.240]:35398)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oaxV3-0005dr-LO
 for 57639 <at> debbugs.gnu.org; Wed, 21 Sep 2022 07:02:42 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=ZSEABncjuGdOWlhoKSj/sFaNCkuWUCuvqzaskidQaC8=; b=U7fx03vpUMlAjH9TmMIMISNIDx
 xCbP4rYRJ3WGeA5uoU3SMQLPjbM/Z6PdCUBSSa9QXXXyKfnFOnqQWMbWbZoa1c4DIwvXFq7/no4ai
 WwDFa7rHiZVi2aaSLSpWQgfwZYnwpy3xorGSoUADBLbLjQ0LAdY+QkQ+cVLAuQivKVLM=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oaxUu-00045D-6G; Wed, 21 Sep 2022 13:02:34 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <87edw5n2zm.fsf@HIDDEN> (Philip Kaludercic's message of "Tue, 
 20 Sep 2022 21:35:25 +0000")
References: <875yhzmz25.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN> <87o7vdg97w.fsf@HIDDEN>
 <831qs926np.fsf@HIDDEN> <871qs9fzz5.fsf@HIDDEN>
 <83h715yxz2.fsf@HIDDEN> <87h715dnut.fsf@HIDDEN>
 <87edw955ls.fsf@HIDDEN> <8735coewsk.fsf@HIDDEN>
 <871qs7ztgq.fsf@HIDDEN> <87o7vbg56k.fsf@HIDDEN>
 <874jx3ye41.fsf@HIDDEN> <87bkrbfz8l.fsf@HIDDEN>
 <871qs5lpo2.fsf@HIDDEN> <87mtatagzv.fsf@HIDDEN>
 <87edw5n2zm.fsf@HIDDEN>
X-Now-Playing: Espen Reinertsen's _Forgaflingspop_: "Forgaflingspop"
Date: Wed, 21 Sep 2022 13:02:29 +0200
Message-ID: <87o7v97zy2.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Philip Kaludercic <philipk@HIDDEN> writes: >> autoloads:
 $(lisp)/emacs-lisp/loaddefs-gen.elc gen-lisp >> $(AM_V_GEN)$(emacs) \ >>
 -l $(lisp)/emacs-lisp/loaddefs-gen.elc \ >> -f loaddefs-generate--emacs-batch
 ${SUBDIRS_ALMOST} >> >> We can add [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: Eli Zaretskii <eliz@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

>> autoloads: $(lisp)/emacs-lisp/loaddefs-gen.elc gen-lisp
>> 	$(AM_V_GEN)$(emacs) \
>>             -l $(lisp)/emacs-lisp/loaddefs-gen.elc \
>> 	    -f loaddefs-generate--emacs-batch ${SUBDIRS_ALMOST}
>>
>> We can add ../etc/themes there after ${SUBDIRS_ALMOST}, though.
>
> Would there be a disadvantage to doing so?

There's no problems when doing

;;;###autoload(put ...)

because those are entered into the loaddefs.el file literally.  There
may be some confusion if people start putting

;;;###autoload
(defun ...)

into the theme files, because the etc/themes directory is not in
`load-path' (so those autoloads will fail).

So it has a slightly inconsistent effect, but I don't think there'll be
a problem in practice, because people don't put functions into the theme
files.  *knocks on wood*





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 21 Sep 2022 09:22:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 21 05:22:33 2022
Received: from localhost ([127.0.0.1]:60682 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oavw8-0006w9-NJ
	for submit <at> debbugs.gnu.org; Wed, 21 Sep 2022 05:22:32 -0400
Received: from mail-wr1-f51.google.com ([209.85.221.51]:40656)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rpluim@HIDDEN>) id 1oavw5-0006vs-0R
 for 57639 <at> debbugs.gnu.org; Wed, 21 Sep 2022 05:22:30 -0400
Received: by mail-wr1-f51.google.com with SMTP id x18so2797477wrm.7
 for <57639 <at> debbugs.gnu.org>; Wed, 21 Sep 2022 02:22:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:from:to:cc:subject:date;
 bh=VtBB7KXd20NV2pBarDaXkUGpqNXKMJDyMP6dil5YkUE=;
 b=julo8iRwUNSTLDlxNkPST8/JHmf1TdfLaZphYEweBxG5T8T1+PIQUx8O6iLdxck0Cx
 pkaa1Oh6AXNnQ8uYUYu/F57XK+OJcB6aB29liHnlh2ctaTusiJ6MCTU4LB++HEPj4vwu
 tqwok6KxEtt7ggiLLlMujmEWB40Xuv2MDN5Wcnw1JzeJMhpi79igJC0E26rhRpemSGeX
 OBhI6k+pnbpzP+eRehw6zbj+oO3Y6W8ev5sUBE784ciUnEkg2q6Cq0FvGZuxAvtpUTDh
 SkWswHLd7QmY5bKfEQO5t/HFlwMBFlnnrBuhaO7gfMs7YQHA/bhUUO3wuJV+nCm91opM
 doaw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date;
 bh=VtBB7KXd20NV2pBarDaXkUGpqNXKMJDyMP6dil5YkUE=;
 b=W2xh8HzBrGdg1J79Dq/8XlB1v2HU+8ZdlLCUp6GtVhBofQB1sTtT/q1nXvQmVto9hf
 vzmHwlABQUjaydMO5aIHymZfmVVOFXPsgRImVljlA18+qtzStG9bd1r/D6Cp3loUkcz4
 8GBkfmMMciujMj/KM6MvOypPGKl8ktb1Bj8BGDpEhNxHK9a6SP/z7rbOl6aQ8LOGE/L2
 be2Zcw4B64+dubgOtCqjT31f9BSlt2XFWzhjCmJkwIDPssOCZBsj2S2Ut8dOmsRL/eSJ
 08uMdYZ9etMK94qakZs70BnsrpOzufc3Wbao5LUf0892g2vmYVBIfuDpJ6LXPGiEMPUX
 dENA==
X-Gm-Message-State: ACrzQf1LrwcJsFbrGJcy54RqXvJgBIf9cXtqPUVuqVwiZR94Amd8WTt8
 OPCFHBfbLhSl5kyMkmUdAYDR1yGqUehCGA==
X-Google-Smtp-Source: AMsMyM68izVOm5OI8RMkYTJIEH07j8dlzZoAN0YTP9QTRyuUeAApeEkaBMiGHt+tt/esJK5uf23C8A==
X-Received: by 2002:a5d:6dad:0:b0:22a:ec41:309c with SMTP id
 u13-20020a5d6dad000000b0022aec41309cmr12175762wrs.127.1663752142407; 
 Wed, 21 Sep 2022 02:22:22 -0700 (PDT)
Received: from rltb ([2a01:e0a:3f3:fb50:16a0:9848:d23c:7dcb])
 by smtp.gmail.com with ESMTPSA id
 s6-20020adfdb06000000b0022ae4f8395dsm1939641wri.96.2022.09.21.02.22.20
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 21 Sep 2022 02:22:21 -0700 (PDT)
From: Robert Pluim <rpluim@HIDDEN>
To: Richard Stallman <rms@HIDDEN>
Subject: Re: bug#57639: Toggling, in general
In-Reply-To: <E1oaplm-0003tB-9P@HIDDEN> (Richard Stallman's message
 of "Tue, 20 Sep 2022 22:47:26 -0400")
References: <875yhzmz25.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN> <87o7vdg97w.fsf@HIDDEN>
 <831qs926np.fsf@HIDDEN> <871qs9fzz5.fsf@HIDDEN>
 <83h715yxz2.fsf@HIDDEN> <87h715dnut.fsf@HIDDEN>
 <83a66wzvxw.fsf@HIDDEN> <87illk4z9d.fsf@HIDDEN>
 <E1oaU7d-00046H-De@HIDDEN> <87o7vacvvf.fsf@HIDDEN>
 <E1oaplm-0003tB-9P@HIDDEN>
Date: Wed, 21 Sep 2022 11:22:20 +0200
Message-ID: <87h711ccab.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 57639
Cc: larsi@HIDDEN, Philip Kaludercic <philipk@HIDDEN>, eliz@HIDDEN,
 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>>>>> On Tue, 20 Sep 2022 22:47:26 -0400, Richard Stallman <rms@HIDDEN> sa=
id:

    Richard> Another is the current input method.  ISTR there is an ad-hoc =
command to
    Richard> reselect the previous input method.  This is another thing tha=
t a general
    Richard> toggle could handle, and avoid the ad-hoc additional command.

I don=CA=BCt think `toggle-input-method' counts as ad-hoc. The first time
you use it, it follows `default-input-method' if set, otherwise it
prompts for an input method. Subsequent uses turn that input method on
and off (modulo the prefix arg). It *is* the command for selecting an
input-method, not a separate toggling command.

Robert
--=20




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 21 Sep 2022 02:47:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 20 22:47:45 2022
Received: from localhost ([127.0.0.1]:60163 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oapm4-0002ZS-LY
	for submit <at> debbugs.gnu.org; Tue, 20 Sep 2022 22:47:45 -0400
Received: from eggs.gnu.org ([209.51.188.92]:58970)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rms@HIDDEN>) id 1oapm1-0002YZ-LQ
 for 57639 <at> debbugs.gnu.org; Tue, 20 Sep 2022 22:47:43 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:50268)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <rms@HIDDEN>)
 id 1oaplv-0002ry-Vo; Tue, 20 Sep 2022 22:47:35 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From:
 mime-version; bh=sOhRItZm2nvB04qfOVeilZd4ixe3lUqBrajo1ThBnJ8=; b=aZMz5aB5r12L
 S3j6D9jBDQ0Kt5qCrT9MPeqEOAYv2spvIBq2BPNJUUmPnxMNv3vJZtC+wnUA66eTZODn2OfvChXJZ
 j2O9+YTEOvO2V6E+J9H5+bnTTPUaQp2jUk4emW71D2ylAAGt3ZO0RMw+U2c8O5Fxu9cvfJVhW8lqt
 oau/t7I4saK6UOywL2OhbFJVxC3nU7+kXtBp0TUSgFSqiUtSJfAY+X8x39EtKFpv7GBdhJCMBzoDs
 WCHI1EPMpwceqdVArRIrcLcN0umD1fWb0IkwogwaRhe1f4WOwnV1SOyG3R6ZBBd9bLUkOzfSYW0Sx
 5O+edBHmEKOIBgelyQZIww==;
Received: from rms by fencepost.gnu.org with local (Exim 4.90_1)
 (envelope-from <rms@HIDDEN>)
 id 1oaplm-0003tB-9P; Tue, 20 Sep 2022 22:47:26 -0400
Content-Type: text/plain; charset=Utf-8
From: Richard Stallman <rms@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
In-Reply-To: <87o7vacvvf.fsf@HIDDEN> (message from Philip Kaludercic on
 Tue, 20 Sep 2022 08:07:00 +0000)
Subject: Re: bug#57639: Toggling, in general
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN> <87o7vdg97w.fsf@HIDDEN>
 <831qs926np.fsf@HIDDEN> <871qs9fzz5.fsf@HIDDEN>
 <83h715yxz2.fsf@HIDDEN> <87h715dnut.fsf@HIDDEN>
 <83a66wzvxw.fsf@HIDDEN> <87illk4z9d.fsf@HIDDEN>
 <E1oaU7d-00046H-De@HIDDEN> <87o7vacvvf.fsf@HIDDEN>
Message-Id: <E1oaplm-0003tB-9P@HIDDEN>
Date: Tue, 20 Sep 2022 22:47:26 -0400
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: eliz@HIDDEN, larsi@HIDDEN, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: rms@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > What kind of things are you thinking about?  Things like the menu bar,
  > tool bar, etc. are already toggled using minor modes.

What I have in mind is settings that have many possible values,
and there's a way to select a new setting.  It could be useful
to have a general way to toggle between the last two values
of the setting.

One such thing is the selected buffer.  Right now you toggle that with
C-x b RET, which may be the shortest sequence of keys we can get, but you
see what I mean.

Another is the current input method.  ISTR there is an ad-hoc command to
reselect the previous input method.  This is another thing that a general
toggle could handle, and avoid the ad-hoc additional command.


-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 20 Sep 2022 21:35:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 20 17:35:39 2022
Received: from localhost ([127.0.0.1]:59875 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oaku2-0003FP-Mo
	for submit <at> debbugs.gnu.org; Tue, 20 Sep 2022 17:35:39 -0400
Received: from mout01.posteo.de ([185.67.36.65]:56415)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oaktx-0003F8-SQ
 for 57639 <at> debbugs.gnu.org; Tue, 20 Sep 2022 17:35:37 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id EFB2A240028
 for <57639 <at> debbugs.gnu.org>; Tue, 20 Sep 2022 23:35:26 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1663709728; bh=/I7K7VCo80k+/vARFhF+t8+AK/nQzVVX/Fy+Bc7STqo=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=BM7UtC8ID7ZFRsZAfAYI5/WCvd3CSdMpPl1zRT4JH7ylAx4PHy3txQ2K6tJ62swtp
 UgPJjXiysFO1eJZNAIgmgBxKuVC4zQ0g449b2ccgQ4CP57rFDjE7EJyL/+v+4miB6u
 uDZOGUMiVMvCHaxefLFAPGogWLERYrQPy85YycvxtzMUzpa18ETrQrBEraghRxrCz6
 7a/lR93m3Yq6n0B+x/yw2HtmPg2AUvOTpeCqvyKpTERhGPabHVqtdlmDP9XVvkVE24
 gw1BdaTnF513s+jhhnN/frjuEurm5QSumDnX74L4Jqym7x2+YnkppbmbwS/YEKRJnS
 9ba665GJ55zgg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MXFFp2k78z9rxH;
 Tue, 20 Sep 2022 23:35:26 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <87mtatagzv.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Tue,
 20 Sep 2022 23:11:16 +0200")
References: <875yhzmz25.fsf@HIDDEN> <87a676jfx2.fsf@HIDDEN>
 <87bkrmdt46.fsf@HIDDEN> <8735cxpx2r.fsf@HIDDEN>
 <87k066yyn0.fsf@HIDDEN> <877d269kgv.fsf@HIDDEN>
 <87bkriyqci.fsf@HIDDEN> <874jxa6kyj.fsf@HIDDEN>
 <87o7vdg97w.fsf@HIDDEN> <831qs926np.fsf@HIDDEN>
 <871qs9fzz5.fsf@HIDDEN> <83h715yxz2.fsf@HIDDEN>
 <87h715dnut.fsf@HIDDEN> <87edw955ls.fsf@HIDDEN>
 <8735coewsk.fsf@HIDDEN> <871qs7ztgq.fsf@HIDDEN>
 <87o7vbg56k.fsf@HIDDEN> <874jx3ye41.fsf@HIDDEN>
 <87bkrbfz8l.fsf@HIDDEN> <871qs5lpo2.fsf@HIDDEN>
 <87mtatagzv.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Tue, 20 Sep 2022 21:35:25 +0000
Message-ID: <87edw5n2zm.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: Eli Zaretskii <eliz@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>> I've just tried this out but it appears that despite re-building Emacs
>> the autoloaded calls are not registered.  Is this because of some
>> special handling of themes?
>
> Oh -- the themes are in etc/themes, and I don't think they're
> included...  Let's see...
>
> Yup:
>
> autoloads: $(lisp)/emacs-lisp/loaddefs-gen.elc gen-lisp
> 	$(AM_V_GEN)$(emacs) \
>             -l $(lisp)/emacs-lisp/loaddefs-gen.elc \
> 	    -f loaddefs-generate--emacs-batch ${SUBDIRS_ALMOST}
>
> We can add ../etc/themes there after ${SUBDIRS_ALMOST}, though.

Would there be a disadvantage to doing so?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 20 Sep 2022 21:11:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 20 17:11:29 2022
Received: from localhost ([127.0.0.1]:59865 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oakWf-0002cr-47
	for submit <at> debbugs.gnu.org; Tue, 20 Sep 2022 17:11:29 -0400
Received: from quimby.gnus.org ([95.216.78.240]:51402)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oakWc-0002cc-76
 for 57639 <at> debbugs.gnu.org; Tue, 20 Sep 2022 17:11:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=yGP+OEISKvGa864utc9P7li0uy05og5D+gix9n3BRW0=; b=gjuVgCP5sgN1lngE5/UkCsZYBv
 G//KVZRZhnReKZ18godz5ZbDheqgxKRuFg5Tu2zRV+F4LHCqBTYyVbJdzfu7vk1DrAo23Z6Ev+v7k
 VuXxHnwTA8yw1jstX/bu0Op+ALgBNxYyrOleLmMIy1BHh93yQNcdBD3GDokEXzxJKp5A=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oakWT-0005xU-0c; Tue, 20 Sep 2022 23:11:19 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <871qs5lpo2.fsf@HIDDEN> (Philip Kaludercic's message of "Tue, 
 20 Sep 2022 21:08:29 +0000")
References: <875yhzmz25.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN> <87o7vdg97w.fsf@HIDDEN>
 <831qs926np.fsf@HIDDEN> <871qs9fzz5.fsf@HIDDEN>
 <83h715yxz2.fsf@HIDDEN> <87h715dnut.fsf@HIDDEN>
 <87edw955ls.fsf@HIDDEN> <8735coewsk.fsf@HIDDEN>
 <871qs7ztgq.fsf@HIDDEN> <87o7vbg56k.fsf@HIDDEN>
 <874jx3ye41.fsf@HIDDEN> <87bkrbfz8l.fsf@HIDDEN>
 <871qs5lpo2.fsf@HIDDEN>
X-Now-Playing: Leslie Winer's _When I Hit You, You'll Feel It_: "N1 Ear"
Date: Tue, 20 Sep 2022 23:11:16 +0200
Message-ID: <87mtatagzv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Philip Kaludercic <philipk@HIDDEN> writes: > I've just
 tried this out but it appears that despite re-building Emacs > the autoloaded
 calls are not registered. Is this because of some > special handling of
 themes? Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: Eli Zaretskii <eliz@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

> I've just tried this out but it appears that despite re-building Emacs
> the autoloaded calls are not registered.  Is this because of some
> special handling of themes?

Oh -- the themes are in etc/themes, and I don't think they're
included...  Let's see...

Yup:

autoloads: $(lisp)/emacs-lisp/loaddefs-gen.elc gen-lisp
	$(AM_V_GEN)$(emacs) \
            -l $(lisp)/emacs-lisp/loaddefs-gen.elc \
	    -f loaddefs-generate--emacs-batch ${SUBDIRS_ALMOST}

We can add ../etc/themes there after ${SUBDIRS_ALMOST}, though.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 20 Sep 2022 21:08:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 20 17:08:45 2022
Received: from localhost ([127.0.0.1]:59860 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oakU1-0002YM-K9
	for submit <at> debbugs.gnu.org; Tue, 20 Sep 2022 17:08:45 -0400
Received: from mout01.posteo.de ([185.67.36.65]:43875)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oakTw-0002Y4-CF
 for 57639 <at> debbugs.gnu.org; Tue, 20 Sep 2022 17:08:44 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id D8351240026
 for <57639 <at> debbugs.gnu.org>; Tue, 20 Sep 2022 23:08:32 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1663708114; bh=J4DE/dQocp4QjtgPOBHim3bAHQktRbOGXz1LZ5d+0PQ=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=Uh6dMsgyW0xZ5T+qRSuumqKeamKlYwBC/B0MVHNASXdftjAO4yZWu4coRwAZHbmgP
 27U1pACWfcwT0yzm1RMH2xrM3B3GvFx7Ws1YKIBspFOY4Hos5/0hC/TOe2bjQX+ETQ
 VKqzIAqEokdEplBERjKLRNV4p27nhVH/VWrfV8T148qUce8nWXD3gwDPWkL9kMtb8a
 VqUplvelCY9DVytNTyHjy5sjG16kxUx6mS2xkCvjhKz/mtrnSMuOQjAD/vE8ldyPWJ
 6JxaKA0VS2I4J8/9MVXr3Sp+qTtQ8uh6Ca511J0feAH37Qm75g+mKdUyHUyv9I1KYA
 k98mnFToxmQyQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MXDfl3FPhz9rxP;
 Tue, 20 Sep 2022 23:08:30 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <87bkrbfz8l.fsf@HIDDEN> (Philip Kaludercic's message of "Mon, 
 19 Sep 2022 12:13:46 +0200")
References: <875yhzmz25.fsf@HIDDEN> <871qsil3jm.fsf@HIDDEN>
 <87fsgygo7c.fsf@HIDDEN> <87a676jfx2.fsf@HIDDEN>
 <87bkrmdt46.fsf@HIDDEN> <8735cxpx2r.fsf@HIDDEN>
 <87k066yyn0.fsf@HIDDEN> <877d269kgv.fsf@HIDDEN>
 <87bkriyqci.fsf@HIDDEN> <874jxa6kyj.fsf@HIDDEN>
 <87o7vdg97w.fsf@HIDDEN> <831qs926np.fsf@HIDDEN>
 <871qs9fzz5.fsf@HIDDEN> <83h715yxz2.fsf@HIDDEN>
 <87h715dnut.fsf@HIDDEN> <87edw955ls.fsf@HIDDEN>
 <8735coewsk.fsf@HIDDEN> <871qs7ztgq.fsf@HIDDEN>
 <87o7vbg56k.fsf@HIDDEN> <874jx3ye41.fsf@HIDDEN>
 <87bkrbfz8l.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Tue, 20 Sep 2022 21:08:29 +0000
Message-ID: <871qs5lpo2.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: Eli Zaretskii <eliz@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

> Lars Ingebrigtsen <larsi@HIDDEN> writes:
>
>> Philip Kaludercic <philipk@HIDDEN> writes:
>>
>>> I don't think so, but if a theme were concerned about this, all they
>>> need to do is
>>>
>>> (put 'theme-name 'theme-properties '(:background-mode light :kind color-scheme))
>>>
>>> As that is all the macro does.
>>
>> Ah, then that's fine -- feel free to push when you're ready.
>>
>>> As I said, we could do this too and add
>>> a autoload-cookie before it to solve the visibility issue, but it
>>> doesn't look that nice...  Can (deftheme)s be autoloaded?
>>
>> Hm...  well, anything can be put into the loaddefs.el file, really, so
>> yes, but I'm not sure we want to...
>
> I think I'll modify the patch for now and pull out the properties via
> `put' calls, and maybe someone will think of a better solution later on.

I've just tried this out but it appears that despite re-building Emacs
the autoloaded calls are not registered.  Is this because of some
special handling of themes?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 20 Sep 2022 12:20:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 20 08:20:44 2022
Received: from localhost ([127.0.0.1]:56466 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oacF1-0008Mu-Ur
	for submit <at> debbugs.gnu.org; Tue, 20 Sep 2022 08:20:44 -0400
Received: from mail-pj1-f68.google.com ([209.85.216.68]:44639)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <visuweshm@HIDDEN>) id 1oacEw-0008Md-0C
 for 57639 <at> debbugs.gnu.org; Tue, 20 Sep 2022 08:20:42 -0400
Received: by mail-pj1-f68.google.com with SMTP id
 i15-20020a17090a4b8f00b0020073b4ac27so2272707pjh.3
 for <57639 <at> debbugs.gnu.org>; Tue, 20 Sep 2022 05:20:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date;
 bh=mYo33MGrJRMJAsfkA9Na8qk70IyEc2ah5xgrQP1+/00=;
 b=HrtneCaR5MmnmdMJ5WGGbLuuIIO6a9dexm8PCkjYK14cdiN+AfD6S4o1C2zufD5jOM
 bAl16Vp/2f7HroBKkMTCqm7BqvnFAMpry1Btht/yI8gWh6xG2CbM/flLR+0GR/Ox+NYy
 LnrC+rltHHKYwvGl5prszYNU+7NahWZjAax8vWUQnNemAnWzKj0Y1kXYNxMXaTPDWvrT
 qpoxUwRvjv45U5KBFAJ/6p2cf4JPOCjaFZgFWl9eSFyoSyoxQ0iQ8MUgSmBGQeq11UPr
 hBbtCjbiipSpHVosjl27pMBIRYEW+vd/IVLvksvYQOsLTUEp+2/eTs17HIhSAGO7TvBg
 L5sg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=content-transfer-encoding:mime-version:user-agent:message-id:date
 :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from
 :to:cc:subject:date;
 bh=mYo33MGrJRMJAsfkA9Na8qk70IyEc2ah5xgrQP1+/00=;
 b=K/GOb5NFtumAJo1u+GtXTJAgcFbVsAlba+v5/5acEn2PU2GYC8+1sLkRO2OHb6ADEP
 gL9EcLoOYxp7yd/tYX0+D00PFZkh7SEH6IvC190GOpCQEugF3ozyR3evTZ6fpj6xtqR3
 uthCeY8xkeV6fcizv0gNQVurHhw5oILWDKc+M0giPnK5qFRDu0VH34+lsbXas3pgqsHM
 MM7+ZVOo3j/jZEAlrgiXDJMJAud5MasQ2Q9BjWGLF3iy99iaU/KeSbOrk9z0B3KHSb9h
 GPZWPU1ZBpcqicVoaLlnIEH0eT97sNSGISQuXdN9UXaFcBVp+5ha6AIQMSI1ggV7dRp0
 Pr+g==
X-Gm-Message-State: ACrzQf29dM5iEjgm0FNnkv6Mip6AHPGU69tPVOf+h12A8IPd6HYN6Z53
 wRpJ5em3Zvpa7OJ2urIa80Q=
X-Google-Smtp-Source: AMsMyM75eAZnyyYxMC/LTSw10Dn+KCCuMMcnU+DgXonX3cOJO+qZHTEXabpBclU/ZqSu5b2xjnWxaQ==
X-Received: by 2002:a17:902:dad2:b0:178:401c:f66d with SMTP id
 q18-20020a170902dad200b00178401cf66dmr4569014plx.157.1663676431948; 
 Tue, 20 Sep 2022 05:20:31 -0700 (PDT)
Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id
 r19-20020a63ce53000000b00434d9ba7817sm1472800pgi.30.2022.09.20.05.20.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 20 Sep 2022 05:20:31 -0700 (PDT)
From: Visuwesh <visuweshm@HIDDEN>
To: Richard Stallman <rms@HIDDEN>
Subject: Re: bug#57639: Toggling, in general
In-Reply-To: <E1oaU7d-00046H-De@HIDDEN> (Richard Stallman's message
 of "Mon, 19 Sep 2022 23:40:33 -0400")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN> <87o7vdg97w.fsf@HIDDEN>
 <831qs926np.fsf@HIDDEN> <871qs9fzz5.fsf@HIDDEN>
 <83h715yxz2.fsf@HIDDEN> <87h715dnut.fsf@HIDDEN>
 <83a66wzvxw.fsf@HIDDEN> <87illk4z9d.fsf@HIDDEN>
 <E1oaU7d-00046H-De@HIDDEN>
Date: Tue, 20 Sep 2022 17:50:24 +0530
Message-ID: <87y1ueme47.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 57639
Cc: larsi@HIDDEN, Philip Kaludercic <philipk@HIDDEN>, eliz@HIDDEN,
 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

[=E0=AE=A4=E0=AE=BF=E0=AE=99=E0=AF=8D=E0=AE=95=E0=AE=B3=E0=AF=8D =E0=AE=9A=
=E0=AF=86=E0=AE=AA=E0=AF=8D=E0=AE=9F=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0=
=AF=8D 19, 2022] Richard Stallman wrote:

> Is anyone investigating the idea of a more general UI facility
> for toggling various kinds of settings?

Custom themes are a perfect candidate for this general facility.  You
can turn on major and minor modes, set variables as a part of a custom
theme.  So these "presets" could be different custom themes and we can
have a command to toggle between said themes.
[ You need not have to worry about custom file getting mangled since
  user options set by a custom theme are not saved [1].  ]

> This oculd be a prefix key.

Though, I'm lost here.  If we are talking about, say, send-mail as the
command to be run, you're saying this prefix key would change the From
address, Signature, etc. right?  Then I think having such a command
would be welcome.

> Or we might be able to do this more deeply, and implement toggling
> various kinds of settings with one Liep command.

See above, if we use custom themes, this should be trivial.

1. Only those from the special 'user' custom theme are saved.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 20 Sep 2022 08:07:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 20 04:07:11 2022
Received: from localhost ([127.0.0.1]:56025 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oaYHe-00017V-Pr
	for submit <at> debbugs.gnu.org; Tue, 20 Sep 2022 04:07:11 -0400
Received: from mout01.posteo.de ([185.67.36.65]:41137)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oaYHc-00017G-HD
 for 57639 <at> debbugs.gnu.org; Tue, 20 Sep 2022 04:07:09 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id C481E240028
 for <57639 <at> debbugs.gnu.org>; Tue, 20 Sep 2022 10:07:02 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1663661222; bh=Z8xBA0d+mdh9E6qL0FouHvc7BpP9N+wy1hbLVqTnQKE=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=XyVao7TLAHPHaoWVmTcYUK8DzZoGzerbZ6lPv4f72saCT9uZAt9D2uhyiKExUwA9l
 b4PzMwbJul/h7MKyBFUZ9aG7zieKz6n+3kVvAK2BfH74IKnfAi34/gqNTyUdohLGNq
 djZKP1deFTNmT/qb7zb+26qaWZg/csyxpX+ayxpCIZTffiGgONsLTJxPeD6TrCj7H8
 Rdp2BI6MNqVi+zBleqWV+MMmTRNiFPnRMObYnJJ8oZyWU13O+Txnjmoyj1Y0dWAH44
 3ieFPAMZ87hvinma1waWrOcj9IZO5EDq4EIJJZSIjvAQiTa5BTKe7T8Wte5rc6dm0P
 /mFqb7A5csUZg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MWvK06lk5z6tnD;
 Tue, 20 Sep 2022 10:07:00 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Richard Stallman <rms@HIDDEN>
Subject: Re: Toggling, in general
In-Reply-To: <E1oaU7d-00046H-De@HIDDEN> (Richard Stallman's message
 of "Mon, 19 Sep 2022 23:40:33 -0400")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN> <87o7vdg97w.fsf@HIDDEN>
 <831qs926np.fsf@HIDDEN> <871qs9fzz5.fsf@HIDDEN>
 <83h715yxz2.fsf@HIDDEN> <87h715dnut.fsf@HIDDEN>
 <83a66wzvxw.fsf@HIDDEN> <87illk4z9d.fsf@HIDDEN>
 <E1oaU7d-00046H-De@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Tue, 20 Sep 2022 08:07:00 +0000
Message-ID: <87o7vacvvf.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: eliz@HIDDEN, larsi@HIDDEN, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Richard Stallman <rms@HIDDEN> writes:

> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
> Is anyone investigating the idea of a more general UI facility
> for toggling various kinds of settings?
>
> This oculd be a prefix key.  Or we might be able to do this more
> deeply, and implement toggling various kinds of settings with one Liep
> command.
>
> Either way, it would do many jobs and not require users to remember
> may different commands.

What kind of things are you thinking about?  Things like the menu bar,
tool bar, etc. are already toggled using minor modes.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 20 Sep 2022 03:40:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 19 23:40:47 2022
Received: from localhost ([127.0.0.1]:55735 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oaU7q-0006db-NK
	for submit <at> debbugs.gnu.org; Mon, 19 Sep 2022 23:40:46 -0400
Received: from eggs.gnu.org ([209.51.188.92]:56306)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rms@HIDDEN>) id 1oaU7o-0006dO-Qu
 for 57639 <at> debbugs.gnu.org; Mon, 19 Sep 2022 23:40:45 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:47866)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <rms@HIDDEN>)
 id 1oaU7i-0007U7-In; Mon, 19 Sep 2022 23:40:39 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From:
 mime-version; bh=htiptx6J1A2OaR9h4b1TP+4dIyS46OC3hTRAJWYLcIE=; b=IR90nPbtQg4O
 L3ul7CBm3+TMDeZF0bbbzZsVGtzeio+1w8AEAnQ3IkUlsTR+ndmDD6tHdfdGMV3KZytQci+aFyHdN
 HxpqFtEDUHwgOspRhY6CwlFvKuP/c4X9dfD+preHJQB5eJlQFJoNpFyo3Qirt2IafNC++Hyk7xqq2
 erUEY9rwW4wXIBAUlI5ReG6ZMOWmDYMHa4E1fWxumXEFFJ27+HrnvpG9KUQfRzymZXxcje10Co99j
 yhoc7jhoKkEG8HAYBxuryT2gAclnCTZWal+HWCzzAOe9QxmQyIaXBEUC9X0glwzgz/FAnwvO01rtN
 H0vthiHPI0xhUbu2HuSY3w==;
Received: from rms by fencepost.gnu.org with local (Exim 4.90_1)
 (envelope-from <rms@HIDDEN>)
 id 1oaU7d-00046H-De; Mon, 19 Sep 2022 23:40:33 -0400
Content-Type: text/plain; charset=Utf-8
From: Richard Stallman <rms@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
In-Reply-To: <87illk4z9d.fsf@HIDDEN> (message from Philip Kaludercic on
 Sun, 18 Sep 2022 12:56:30 +0000)
Subject: Toggling, in general
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN> <87o7vdg97w.fsf@HIDDEN>
 <831qs926np.fsf@HIDDEN> <871qs9fzz5.fsf@HIDDEN>
 <83h715yxz2.fsf@HIDDEN> <87h715dnut.fsf@HIDDEN>
 <83a66wzvxw.fsf@HIDDEN> <87illk4z9d.fsf@HIDDEN>
Message-Id: <E1oaU7d-00046H-De@HIDDEN>
Date: Mon, 19 Sep 2022 23:40:33 -0400
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: eliz@HIDDEN, larsi@HIDDEN, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: rms@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

Is anyone investigating the idea of a more general UI facility
for toggling various kinds of settings?

This oculd be a prefix key.  Or we might be able to do this more
deeply, and implement toggling various kinds of settings with one Liep
command.

Either way, it would do many jobs and not require users to remember
may different commands.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 19 Sep 2022 10:13:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 19 06:13:58 2022
Received: from localhost ([127.0.0.1]:52490 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oaDmo-0007Uj-0E
	for submit <at> debbugs.gnu.org; Mon, 19 Sep 2022 06:13:58 -0400
Received: from mout02.posteo.de ([185.67.36.66]:39795)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oaDmj-0007US-7f
 for 57639 <at> debbugs.gnu.org; Mon, 19 Sep 2022 06:13:56 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id B4594240104
 for <57639 <at> debbugs.gnu.org>; Mon, 19 Sep 2022 12:13:47 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1663582427; bh=R1XSn58h92RSp80KVvdwkgtt+3YQsTAy9hks2Kzbrnc=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=r64zxhfe54qW9io3pAU+VHdoV1/zLQ1ENGclUbPT6CMuFAP3uvIddp2LkWfNbnCW2
 6WMyod3Y25jLd2wqA5wV4tZfg00LP/M1GGy52A6ZlEqsaVLl4uYn8QIlg6JhsglWvG
 MkAWAteswr1XTxXb4g+uG2+8zqvFZ5XsN3KXkViFeUiGnzBQeZcis1iPTGEWArDBBj
 r3AOmqQ4DNvROLSBsDKggayqX5bZNBR564Epms63h+UcJOf5wRd/L1Q2Uk55OsE9fb
 CAJ0zRD6FXjwj+n4sambmElrvM/yOnajdI25UKHdb/dcTzMpoDlm28SDFsZnmWFYLk
 jeRS5bkCdXPQg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MWL9k6dF7z9rxV;
 Mon, 19 Sep 2022 12:13:46 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <874jx3ye41.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Mon,
 19 Sep 2022 10:15:10 +0200")
References: <875yhzmz25.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN> <87o7vdg97w.fsf@HIDDEN>
 <831qs926np.fsf@HIDDEN> <871qs9fzz5.fsf@HIDDEN>
 <83h715yxz2.fsf@HIDDEN> <87h715dnut.fsf@HIDDEN>
 <87edw955ls.fsf@HIDDEN> <8735coewsk.fsf@HIDDEN>
 <871qs7ztgq.fsf@HIDDEN> <87o7vbg56k.fsf@HIDDEN>
 <874jx3ye41.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Mon, 19 Sep 2022 10:13:46 +0000
Message-ID: <87bkrbfz8l.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: Eli Zaretskii <eliz@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>> I don't think so, but if a theme were concerned about this, all they
>> need to do is
>>
>> (put 'theme-name 'theme-properties '(:background-mode light :kind color-scheme))
>>
>> As that is all the macro does.
>
> Ah, then that's fine -- feel free to push when you're ready.
>
>> As I said, we could do this too and add
>> a autoload-cookie before it to solve the visibility issue, but it
>> doesn't look that nice...  Can (deftheme)s be autoloaded?
>
> Hm...  well, anything can be put into the loaddefs.el file, really, so
> yes, but I'm not sure we want to...

I think I'll modify the patch for now and pull out the properties via
`put' calls, and maybe someone will think of a better solution later on.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 19 Sep 2022 08:15:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 19 04:15:23 2022
Received: from localhost ([127.0.0.1]:52269 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oaBw2-00087a-MF
	for submit <at> debbugs.gnu.org; Mon, 19 Sep 2022 04:15:22 -0400
Received: from quimby.gnus.org ([95.216.78.240]:47746)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oaBw0-00087L-Rk
 for 57639 <at> debbugs.gnu.org; Mon, 19 Sep 2022 04:15:21 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=eUHuNFIWOdw4FeF5LQ09nbzr4mqkK61g/FJ36dwebY8=; b=ol5VTbTvZKVZBobBGmWzMBaRYa
 9IEaR+bYf98e0QipTF1cdaLPEVuMAWdPmcPKmi34BUZ6x/Uh3I9hUD4S2oSk28nvbOZoo1cp2KL0r
 etSmKuB/EANenTOFGR1+n70fro29+3StNhembpQRucJ9HG9LzMf6N7Vzoyay0/cmC/VU=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oaBvs-00076R-Ba; Mon, 19 Sep 2022 10:15:14 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <87o7vbg56k.fsf@HIDDEN> (Philip Kaludercic's message of "Mon, 
 19 Sep 2022 08:05:23 +0000")
References: <875yhzmz25.fsf@HIDDEN> <875yhzl3a1.fsf@HIDDEN>
 <87fsh25bso.fsf@HIDDEN> <871qsil3jm.fsf@HIDDEN>
 <87fsgygo7c.fsf@HIDDEN> <87a676jfx2.fsf@HIDDEN>
 <87bkrmdt46.fsf@HIDDEN> <8735cxpx2r.fsf@HIDDEN>
 <87k066yyn0.fsf@HIDDEN> <877d269kgv.fsf@HIDDEN>
 <87bkriyqci.fsf@HIDDEN> <874jxa6kyj.fsf@HIDDEN>
 <87o7vdg97w.fsf@HIDDEN> <831qs926np.fsf@HIDDEN>
 <871qs9fzz5.fsf@HIDDEN> <83h715yxz2.fsf@HIDDEN>
 <87h715dnut.fsf@HIDDEN> <87edw955ls.fsf@HIDDEN>
 <8735coewsk.fsf@HIDDEN> <871qs7ztgq.fsf@HIDDEN>
 <87o7vbg56k.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAALVBMVEXu7u3Y0NfGoK/P
 NkTdV2e3rsuZeYdLOkUTBw9kV14nEhlLJio2IiosGiP////Zf5E1AAAAAWJLR0QOb70wTwAAAAd0
 SU1FB+YJEwcsIERlldwAAAGOSURBVDjLrdK9TsJQFAfwYuJOE0kMkcHi4iq+AKUvwEA0xBV4Az4S
 WeV4oaNCBRcXLhe7Yk2ZhVSZ+xH6LrYF1J7WxMH/eH+959xzeznuKzz330nyPJ8Mr2Rzu5xtlxKC
 kD+RxKzkJ3cuSTvYE0VRkIRsTioUQju2OZB2yf/xPIlU9ZjfJAz7NbgpBSkiOJ0+xUPfaFXiIKUs
 G9/wY/pU8aESX6o0qsSXKtUqA9tbr96F4aLfrw5pS2nDbRjKzKR2GwAIgittDJN5DJTpmKrUA1zq
 EkyHAIlC2V3QWDj6WPt1SBRc1weg0R0r73tCZQwZdwlkOKXgIDhULZnN3y2QEaQpdHVdN2J6LLtz
 XVcdhnuoBmGMMAtDmvjDgRPZkWZTzYOXXhTWj8DgTXUjwEYe2E0jCg2v1HNzjU/F4BpkCosOBkJW
 /t3OiMmF3lWGBceFWdPGpZh35xQmA9wcZOIPYtcioAalVKWDwSLBr62bGOgGXhuoOQSPCmCi/ALd
 ezygBsw3gqGnseBhkTrHfQIpVOojvKi+iAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wOS0xOVQw
 Nzo0NDozMiswMDowMHsDNFgAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDktMTlUMDc6NDQ6MzIr
 MDA6MDAKXozkAAAAAElFTkSuQmCC
X-Now-Playing: Anne Clark's _Hopeless Cases_: "Leaving"
Date: Mon, 19 Sep 2022 10:15:10 +0200
Message-ID: <874jx3ye41.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Philip Kaludercic <philipk@HIDDEN> writes: > I don't
 think
 so, but if a theme were concerned about this, all they > need to do is >
 > (put 'theme-name 'theme-properties '(:background-mode light :kind
 color-scheme)) > > As that is all the macro [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: Eli Zaretskii <eliz@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

> I don't think so, but if a theme were concerned about this, all they
> need to do is
>
> (put 'theme-name 'theme-properties '(:background-mode light :kind color-scheme))
>
> As that is all the macro does.

Ah, then that's fine -- feel free to push when you're ready.

> As I said, we could do this too and add
> a autoload-cookie before it to solve the visibility issue, but it
> doesn't look that nice...  Can (deftheme)s be autoloaded?

Hm...  well, anything can be put into the loaddefs.el file, really, so
yes, but I'm not sure we want to...




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 19 Sep 2022 08:05:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 19 04:05:32 2022
Received: from localhost ([127.0.0.1]:52241 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oaBmV-0007rE-Te
	for submit <at> debbugs.gnu.org; Mon, 19 Sep 2022 04:05:32 -0400
Received: from mout01.posteo.de ([185.67.36.65]:44297)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oaBmU-0007r0-AE
 for 57639 <at> debbugs.gnu.org; Mon, 19 Sep 2022 04:05:30 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id C828E240028
 for <57639 <at> debbugs.gnu.org>; Mon, 19 Sep 2022 10:05:24 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1663574724; bh=/zHbwRDV6ndLvJcSJF/lM2fh38wLR9xF8AyHlNhLIkk=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=dfJRREhJxIlaojbSqV11YeGvva6TEUD/98qdNL89xp9JxEx1+M+B/jN5l7B4Tc5K+
 CnnrfHhY2kPlBEwSqNrlLc3J6iGgHzNDVPguy1XP75kQ27V7af9jE/kENP+hZscAX6
 uZ9cON4VHW0yQURcRBDxGDjTDCX5uxjx5K8ry8U/6bYlgOrKazGNeUYJmqdUVObl92
 q+e1ELdZB2cCsCcPva/qdDiRHtIy8Aw83v/39PgKDKFDu2vxq/HgksUCllsc9WE8uE
 Ru12PRvneImfZ+bPkXK2FN0hKYJtbIT+ea6TXzZeNtXUASa6lMYz2sd0avDGcQadIW
 LQRpPoNxMENsA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MWHKc1q2sz9rxT;
 Mon, 19 Sep 2022 10:05:24 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <871qs7ztgq.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Mon,
 19 Sep 2022 09:58:13 +0200")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN> <87o7vdg97w.fsf@HIDDEN>
 <831qs926np.fsf@HIDDEN> <871qs9fzz5.fsf@HIDDEN>
 <83h715yxz2.fsf@HIDDEN> <87h715dnut.fsf@HIDDEN>
 <87edw955ls.fsf@HIDDEN> <8735coewsk.fsf@HIDDEN>
 <871qs7ztgq.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Mon, 19 Sep 2022 08:05:23 +0000
Message-ID: <87o7vbg56k.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: Eli Zaretskii <eliz@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>> One last additional, I've added a property to all the themes indicating
>> that they are colour schemes.  This would make it easier to toggle
>> between dark and light modes if multiple themes are enabled of which
>> only one is a colour theme:
>
> Makes sense.  One thing that occurred to me now that I didn't think of
> before is:
>
>>  (deftheme adwaita
>>    "Face colors similar to the default theme of Gnome 3 (Adwaita).
>>  The colors are chosen to match Adwaita window decorations and the
>> -default look of the Gnome 3 desktop.")
>> +default look of the Gnome 3 desktop."
>> +  :background-mode 'light
>> +  :kind 'color-scheme)
>
> Is this backwards compatible, and is that something we need to care
> about?  I know that some (many?) themes are also distributed outside of
> Emacs, and should work under a range of Emacs versions.  I don't think
> extending `deftheme' in this way would be backwards compatible, though,
> even if it makes sense from a language design point of view.

I don't think so, but if a theme were concerned about this, all they
need to do is

(put 'theme-name 'theme-properties '(:background-mode light :kind color-scheme))

As that is all the macro does.  As I said, we could do this too and add
a autoload-cookie before it to solve the visibility issue, but it
doesn't look that nice...  Can (deftheme)s be autoloaded?





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 19 Sep 2022 07:58:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 19 03:58:27 2022
Received: from localhost ([127.0.0.1]:52214 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oaBff-0007eN-GG
	for submit <at> debbugs.gnu.org; Mon, 19 Sep 2022 03:58:27 -0400
Received: from quimby.gnus.org ([95.216.78.240]:47354)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oaBfd-0007eA-L8
 for 57639 <at> debbugs.gnu.org; Mon, 19 Sep 2022 03:58:26 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=ZXAKqE/RPGaUVfCdzkaoVFOLOMHXt/gUaoKr8BkDkx0=; b=UioqkDfenrLraFtUDXkzDjJI8p
 vUfoI9EZFvC8k55wkkYCcuADInZqoeq/Hk7/KwGw9oPkplC0q+4+yJA59bGYBbvVmWQnJfIKbjZny
 o4tfmtXjYUlMPQb9Bz7xFjIabjNdNCK0Rxy98PG0bDj33OjS2rrM+F3adFMXrElgk5+Q=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oaBfU-0006va-FO; Mon, 19 Sep 2022 09:58:18 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <8735coewsk.fsf@HIDDEN> (Philip Kaludercic's message of "Sun, 
 18 Sep 2022 11:39:39 +0000")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN> <87o7vdg97w.fsf@HIDDEN>
 <831qs926np.fsf@HIDDEN> <871qs9fzz5.fsf@HIDDEN>
 <83h715yxz2.fsf@HIDDEN> <87h715dnut.fsf@HIDDEN>
 <87edw955ls.fsf@HIDDEN> <8735coewsk.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAALVBMVEXu7u3Y0NfGoK/P
 NkTdV2e3rsuZeYdLOkUTBw9kV14nEhlLJio2IiosGiP////Zf5E1AAAAAWJLR0QOb70wTwAAAAd0
 SU1FB+YJEwcsIERlldwAAAGOSURBVDjLrdK9TsJQFAfwYuJOE0kMkcHi4iq+AKUvwEA0xBV4Az4S
 WeV4oaNCBRcXLhe7Yk2ZhVSZ+xH6LrYF1J7WxMH/eH+959xzeznuKzz330nyPJ8Mr2Rzu5xtlxKC
 kD+RxKzkJ3cuSTvYE0VRkIRsTioUQju2OZB2yf/xPIlU9ZjfJAz7NbgpBSkiOJ0+xUPfaFXiIKUs
 G9/wY/pU8aESX6o0qsSXKtUqA9tbr96F4aLfrw5pS2nDbRjKzKR2GwAIgittDJN5DJTpmKrUA1zq
 EkyHAIlC2V3QWDj6WPt1SBRc1weg0R0r73tCZQwZdwlkOKXgIDhULZnN3y2QEaQpdHVdN2J6LLtz
 XVcdhnuoBmGMMAtDmvjDgRPZkWZTzYOXXhTWj8DgTXUjwEYe2E0jCg2v1HNzjU/F4BpkCosOBkJW
 /t3OiMmF3lWGBceFWdPGpZh35xQmA9wcZOIPYtcioAalVKWDwSLBr62bGOgGXhuoOQSPCmCi/ALd
 ezygBsw3gqGnseBhkTrHfQIpVOojvKi+iAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wOS0xOVQw
 Nzo0NDozMiswMDowMHsDNFgAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDktMTlUMDc6NDQ6MzIr
 MDA6MDAKXozkAAAAAElFTkSuQmCC
X-Now-Playing: Anne Clark's _Hopeless Cases_: "Cane Hill"
Date: Mon, 19 Sep 2022 09:58:13 +0200
Message-ID: <871qs7ztgq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Philip Kaludercic <philipk@HIDDEN> writes: > One last
 additional, I've added a property to all the themes indicating > that they
 are colour schemes. This would make it easier to toggle > between dark and
 light modes if multiple themes are enab [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: Eli Zaretskii <eliz@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

> One last additional, I've added a property to all the themes indicating
> that they are colour schemes.  This would make it easier to toggle
> between dark and light modes if multiple themes are enabled of which
> only one is a colour theme:

Makes sense.  One thing that occurred to me now that I didn't think of
before is:

>  (deftheme adwaita
>    "Face colors similar to the default theme of Gnome 3 (Adwaita).
>  The colors are chosen to match Adwaita window decorations and the
> -default look of the Gnome 3 desktop.")
> +default look of the Gnome 3 desktop."
> +  :background-mode 'light
> +  :kind 'color-scheme)

Is this backwards compatible, and is that something we need to care
about?  I know that some (many?) themes are also distributed outside of
Emacs, and should work under a range of Emacs versions.  I don't think
extending `deftheme' in this way would be backwards compatible, though,
even if it makes sense from a language design point of view.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 18 Sep 2022 12:56:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 18 08:56:40 2022
Received: from localhost ([127.0.0.1]:48329 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oZtqi-0000hH-9o
	for submit <at> debbugs.gnu.org; Sun, 18 Sep 2022 08:56:40 -0400
Received: from mout01.posteo.de ([185.67.36.65]:42305)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oZtqg-0000h3-Qp
 for 57639 <at> debbugs.gnu.org; Sun, 18 Sep 2022 08:56:39 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 1B694240026
 for <57639 <at> debbugs.gnu.org>; Sun, 18 Sep 2022 14:56:32 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1663505793; bh=bRT4H+VdldrUQzDjBD02nP+FLAQUdwQ/RLlhV9dmles=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=mpNFbWWdDAbRVYnIyHKI093EOSimAV0k+TiOhKJJ3nykr1s4staVA0kZYiEj7h4S1
 JARoUBVPyK+EaXAECC3adGnQ1inmhCbUhVr51o1a1lQz9GF96MZBXNgHwe7RZbo2qN
 fcMD2zRM7ms9Mxmj8bf5FGKp+Sajhq2qpbDPExOdkDWG6aPb/IvTqM1Tocq823o6z0
 9S6+uR1L3tjQEeH1otU3h0SEXNjB1LXo+L69Z/3W1QfaIIXZHxiV1C4o3P2d1S6sj2
 TYZXxQ35ZNgKDVXoBx+CbQYf9r43aVNvhrgU6xZFVZH81xa4ChsBE2RFrRWAsA8yMJ
 45k+yEeeFXqcA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MVnr017hpz9rxH;
 Sun, 18 Sep 2022 14:56:31 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <83a66wzvxw.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 18 Sep
 2022 15:52:27 +0300")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN> <87o7vdg97w.fsf@HIDDEN>
 <831qs926np.fsf@HIDDEN> <871qs9fzz5.fsf@HIDDEN>
 <83h715yxz2.fsf@HIDDEN> <87h715dnut.fsf@HIDDEN>
 <83a66wzvxw.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Sun, 18 Sep 2022 12:56:30 +0000
Message-ID: <87illk4z9d.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: larsi@HIDDEN, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Philip Kaludercic <philipk@HIDDEN>
>> Cc: larsi@HIDDEN,  57639 <at> debbugs.gnu.org
>> Date: Sun, 18 Sep 2022 09:38:02 +0000
>> 
>> >> >> +  (let* ((theme (car custom-enabled-themes))
>> >> >> +         (family (plist-get (get theme 'theme-properties) :family)))
>> >> >> +    (unless family
>> >> >> +      (error "`%s' is not part of a family" theme))
>> >> >
>> >> > "Family"? this terminology was never mentioned in the manual or the
>> >> > doc string.  How about
>> >> >
>> >> >   Theme `%s' does not have any variants
>> >> >
>> >> > instead?
>> >> 
>> >> Strictly speaking that error message would be wrong at this point,
>> >> because we cannot say if a theme has no variants if it is not part of a
>> >> family.  This is because variants of a theme are all those that are part
>> >> of the same family.  I think it would be better to clarify this in the
>> >> documentation.
>> >
>> > But the documentation doesn't explain what it means for a theme to be
>> > part of a family.  Specifically, how does one tell, by looking at a
>> > theme, whether it is or isn't part of a family?
>> >
>> > An alternative for what I suggested above is to say
>> >
>> >   Theme `%s' does not have any known variants
>> 
>> I get what you mean... how about
>> 
>>     (error "Theme `%s' is not part of a family of variants" theme)
>> 
>> ?
>
>   Theme `%s' is not part of a family of theme variants
>
>> >> +Themes only have variants if they are part of a family of themes.
>> >
>> > This should explain what it means to be part of a family, otherwise
>> > this sentence is not helpful.
>> 
>> My intention was for this to be an explanation.  The issue is that
>> variants and family are mutually recursive concepts:
>> 
>> - A variant of a theme are those which are part of the same family
>> - A family of themes is the set of all variants of a theme.
>> 
>> Perhaps it is just easier to collapse both concepts into either variant
>> of family and just "expose" by documenting it.  I've tried doing so
>> below.
>
> Here's an attempt to explain what is a "family", in case it can still
> be of interest:
>
>   A @dfn{family} of themes is a set of similar themes that differ by
>   minor aspects, such as face colors that are meant for the light vs
>   dark background of the frame.

I personally think it is better to omit this for now.  Perhaps this can
be mentioned if or when the theme tags are formalised.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 18 Sep 2022 12:52:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 18 08:52:38 2022
Received: from localhost ([127.0.0.1]:48311 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oZtmo-0000ZZ-2f
	for submit <at> debbugs.gnu.org; Sun, 18 Sep 2022 08:52:38 -0400
Received: from eggs.gnu.org ([209.51.188.92]:50256)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oZtmk-0000ZG-7H
 for 57639 <at> debbugs.gnu.org; Sun, 18 Sep 2022 08:52:36 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:39588)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oZtme-0003U5-Ti; Sun, 18 Sep 2022 08:52:28 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=9VDhEXmX0QJxmagumbiKQcJkhGtEII4DTp+Tz0COfGc=; b=KF+H+nqmUOT0
 YiTWWy97aRoWnFjNEcYBSmrpehCUgLCO+SscnC1Rle3pey/dIzr/xcVgPOiFciYSs2M7bloSPWC24
 zLgY0DWwCeVGGX4prfWkhDyEt9jew0PrvFQh/hng8+dxUgJeh3muQXQXTjj5djucavgqME9hKCsP5
 rhvSrs0ebm3TK/1v+ZmbHN4OImdqoHPC6zBxilOksTCGWomqiW+wHJdbjg+j86bclSz4wsj1bpRNX
 Kf9ETGeBESdf/samLRlp1GT6EBTmVckL/Jdbe7oEYu8mpQbkLZSg3yh65tWGYLItFvtoyqHkt4wp7
 Cg3MuydX8lCUSLV4tZdVRQ==;
Received: from [87.69.77.57] (port=1986 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oZtme-0001ig-Cd; Sun, 18 Sep 2022 08:52:28 -0400
Date: Sun, 18 Sep 2022 15:52:27 +0300
Message-Id: <83a66wzvxw.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
In-Reply-To: <87h715dnut.fsf@HIDDEN> (message from Philip Kaludercic on
 Sun, 18 Sep 2022 09:38:02 +0000)
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN> <87o7vdg97w.fsf@HIDDEN>
 <831qs926np.fsf@HIDDEN> <871qs9fzz5.fsf@HIDDEN>
 <83h715yxz2.fsf@HIDDEN> <87h715dnut.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: larsi@HIDDEN, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Philip Kaludercic <philipk@HIDDEN>
> Cc: larsi@HIDDEN,  57639 <at> debbugs.gnu.org
> Date: Sun, 18 Sep 2022 09:38:02 +0000
> 
> >> >> +  (let* ((theme (car custom-enabled-themes))
> >> >> +         (family (plist-get (get theme 'theme-properties) :family)))
> >> >> +    (unless family
> >> >> +      (error "`%s' is not part of a family" theme))
> >> >
> >> > "Family"? this terminology was never mentioned in the manual or the
> >> > doc string.  How about
> >> >
> >> >   Theme `%s' does not have any variants
> >> >
> >> > instead?
> >> 
> >> Strictly speaking that error message would be wrong at this point,
> >> because we cannot say if a theme has no variants if it is not part of a
> >> family.  This is because variants of a theme are all those that are part
> >> of the same family.  I think it would be better to clarify this in the
> >> documentation.
> >
> > But the documentation doesn't explain what it means for a theme to be
> > part of a family.  Specifically, how does one tell, by looking at a
> > theme, whether it is or isn't part of a family?
> >
> > An alternative for what I suggested above is to say
> >
> >   Theme `%s' does not have any known variants
> 
> I get what you mean... how about
> 
>     (error "Theme `%s' is not part of a family of variants" theme)
> 
> ?

  Theme `%s' is not part of a family of theme variants

> >> +Themes only have variants if they are part of a family of themes.
> >
> > This should explain what it means to be part of a family, otherwise
> > this sentence is not helpful.
> 
> My intention was for this to be an explanation.  The issue is that
> variants and family are mutually recursive concepts:
> 
> - A variant of a theme are those which are part of the same family
> - A family of themes is the set of all variants of a theme.
> 
> Perhaps it is just easier to collapse both concepts into either variant
> of family and just "expose" by documenting it.  I've tried doing so
> below.

Here's an attempt to explain what is a "family", in case it can still
be of interest:

  A @dfn{family} of themes is a set of similar themes that differ by
  minor aspects, such as face colors that are meant for the light vs
  dark background of the frame.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 18 Sep 2022 11:39:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 18 07:39:52 2022
Received: from localhost ([127.0.0.1]:48130 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oZseN-0006j0-NC
	for submit <at> debbugs.gnu.org; Sun, 18 Sep 2022 07:39:52 -0400
Received: from mout02.posteo.de ([185.67.36.66]:54479)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oZseK-0006ik-2x
 for 57639 <at> debbugs.gnu.org; Sun, 18 Sep 2022 07:39:49 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 8F619240101
 for <57639 <at> debbugs.gnu.org>; Sun, 18 Sep 2022 13:39:41 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1663501182; bh=V8tRqqwSjV0lhtx2h4M0jDceu/YA2yglUcI1Lygwx0c=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=op4EOtIBmAJ5JYfaXn73rrcyBe8B0YxQhm4qf6UUIbvuhRuH6W/5qvLdkg2Bl1cug
 VLnzf0+Up5jIVWcsB718HZNNe7rxQtKqcN7SVkB2pVVraSSeV0tzO515ZgFXlZwGnK
 I2gwA+mkuqNznULxr0AANTj9Qgiu4yQ/e97KtWdwAXZLG9Au/exBZ8T3TFlfazvjKe
 J5OrAk26hjhhxRbeMivnHMmKQwqq/IX//Qhy0vxqGmHBJzzR+7QCcBhEhfHbNMu4d9
 a/dGk6Uie+Xa+I8NF8+yXQfcHRCcfauMPIr/9/pKEePErr4byUxmG6roUWzUGnu4sS
 Y70l/duLRN1mw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MVm7J5ytFz9rxF;
 Sun, 18 Sep 2022 13:39:40 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <87edw955ls.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sun,
 18 Sep 2022 12:39:27 +0200")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN> <87o7vdg97w.fsf@HIDDEN>
 <831qs926np.fsf@HIDDEN> <871qs9fzz5.fsf@HIDDEN>
 <83h715yxz2.fsf@HIDDEN> <87h715dnut.fsf@HIDDEN>
 <87edw955ls.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Sun, 18 Sep 2022 11:39:39 +0000
Message-ID: <8735coewsk.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: Eli Zaretskii <eliz@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>> Subject: [PATCH] Tag themes with properties
>
> Thanks; looks good to me.

One last additional, I've added a property to all the themes indicating
that they are colour schemes.  This would make it easier to toggle
between dark and light modes if multiple themes are enabled of which
only one is a colour theme:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=0001-Tag-themes-with-properties.patch

From 62c55cc27024348e43ae4591c3d239d705f8ad1b Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@HIDDEN>
Date: Sat, 17 Sep 2022 20:11:42 +0200
Subject: [PATCH] Tag themes with properties

* doc/emacs/custom.texi (Custom Themes): Document 'theme-choose-variant'.
* doc/lispref/customize.texi (Custom Themes): Document the new
optional argument to 'deftheme'.
* etc/themes/adwaita-theme.el (adwaita): Add properties.
* etc/themes/deeper-blue-theme.el (deeper-blue): Add properties.
* etc/themes/dichromacy-theme.el (dichromacy): Add properties.
* etc/themes/light-blue-theme.el (light-blue): Add properties.
* etc/themes/manoj-dark-theme.el (manoj-dark): Add properties.
* etc/themes/misterioso-theme.el (misterioso): Add properties.
* etc/themes/tango-dark-theme.el (tango-dark): Add properties.
* etc/themes/tango-theme.el (tango): Add properties.
* etc/themes/tsdh-dark-theme.el (tsdh-dark): Add properties.
* etc/themes/tsdh-light-theme.el (tsdh-light): Add properties.
* etc/themes/wheatgrass-theme.el (wheatgrass): Add properties.
* etc/themes/whiteboard-theme.el (whiteboard): Add properties.
* etc/themes/wombat-theme.el (wombat): Add properties.
* lisp/custom.el (deftheme): Allow for optional arguments to set the
property list.
(custom-declare-theme): Accept the same optional arguments as 'deftheme'.
(theme-list-variants): Add new function.
(theme-choose-variant): Add new command for switching between members
of a theme family.
(toggle-theme): Add an alias for 'theme-choose-variant'.  (Bug#57639)
---
 doc/emacs/custom.texi           | 10 +++++
 doc/lispref/customize.texi      |  5 ++-
 etc/themes/adwaita-theme.el     |  4 +-
 etc/themes/deeper-blue-theme.el |  4 +-
 etc/themes/dichromacy-theme.el  |  4 +-
 etc/themes/leuven-dark-theme.el |  6 ++-
 etc/themes/leuven-theme.el      |  6 ++-
 etc/themes/light-blue-theme.el  |  4 +-
 etc/themes/manoj-dark-theme.el  |  4 +-
 etc/themes/misterioso-theme.el  |  4 +-
 etc/themes/tango-dark-theme.el  |  5 ++-
 etc/themes/tango-theme.el       |  5 ++-
 etc/themes/tsdh-dark-theme.el   |  5 ++-
 etc/themes/tsdh-light-theme.el  |  5 ++-
 etc/themes/wheatgrass-theme.el  |  4 +-
 etc/themes/whiteboard-theme.el  |  4 +-
 etc/themes/wombat-theme.el      |  4 +-
 lisp/custom.el                  | 70 ++++++++++++++++++++++++++++++---
 18 files changed, 128 insertions(+), 25 deletions(-)

diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index ff7ab83190..f98527bf9a 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -667,6 +667,16 @@ Custom Themes
 the @file{*Custom Themes*} buffer; or type @kbd{M-x describe-theme}
 anywhere in Emacs and enter the theme name.
 
+@findex theme-choose-variant
+Some themes have variants (most often just two: light and dark).  You
+can switch to another variant using @kbd{M-x theme-choose-variant}.
+If the currently active theme has only one other variant, it will be
+selected; if there are more variants, the command will prompt you
+which one to switch to.
+
+Note that @code{theme-choose-variant} only works if a single theme
+is active.
+
 @node Creating Custom Themes
 @subsection Creating Custom Themes
 @cindex custom themes, creating
diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi
index 6ba35cffff..911b6c4d75 100644
--- a/doc/lispref/customize.texi
+++ b/doc/lispref/customize.texi
@@ -1428,12 +1428,13 @@ Custom Themes
 be a call to @code{deftheme}, and the last form should be a call to
 @code{provide-theme}.
 
-@defmac deftheme theme &optional doc
+@defmac deftheme theme &optional doc &rest properties
 This macro declares @var{theme} (a symbol) as the name of a Custom
 theme.  The optional argument @var{doc} should be a string describing
 the theme; this is the description shown when the user invokes the
 @code{describe-theme} command or types @kbd{?} in the @samp{*Custom
-Themes*} buffer.
+Themes*} buffer.  The remaining arguments @var{properties} are used
+pass a property list with theme attributes.
 
 Two special theme names are disallowed (using them causes an error):
 @code{user} is a dummy theme that stores the user's direct
diff --git a/etc/themes/adwaita-theme.el b/etc/themes/adwaita-theme.el
index ba83a0578c..6ac7d8f316 100644
--- a/etc/themes/adwaita-theme.el
+++ b/etc/themes/adwaita-theme.el
@@ -24,7 +24,9 @@
 (deftheme adwaita
   "Face colors similar to the default theme of Gnome 3 (Adwaita).
 The colors are chosen to match Adwaita window decorations and the
-default look of the Gnome 3 desktop.")
+default look of the Gnome 3 desktop."
+  :background-mode 'light
+  :kind 'color-scheme)
 
 (let ((class '((class color) (min-colors 89))))
   (custom-theme-set-faces
diff --git a/etc/themes/deeper-blue-theme.el b/etc/themes/deeper-blue-theme.el
index 8f19147f91..db3b9b5b60 100644
--- a/etc/themes/deeper-blue-theme.el
+++ b/etc/themes/deeper-blue-theme.el
@@ -22,7 +22,9 @@
 ;;; Code:
 
 (deftheme deeper-blue
-  "Face colors using a deep blue background.")
+  "Face colors using a deep blue background."
+  :background-mode 'dark
+  :kind 'color-scheme)
 
 (let ((class '((class color) (min-colors 89))))
   (custom-theme-set-faces
diff --git a/etc/themes/dichromacy-theme.el b/etc/themes/dichromacy-theme.el
index d53c075d92..d2c5983862 100644
--- a/etc/themes/dichromacy-theme.el
+++ b/etc/themes/dichromacy-theme.el
@@ -28,7 +28,9 @@ dichromacy
 differentiated by individuals with protanopia or deuteranopia.
 
 Basic, Font Lock, Isearch, Gnus, Message, Flyspell, and
-Ansi-Color faces are included.")
+Ansi-Color faces are included."
+  :background-mode 'light
+  :kind 'color-scheme)
 
 (let ((class '((class color) (min-colors 89)))
       (orange "#e69f00")
diff --git a/etc/themes/leuven-dark-theme.el b/etc/themes/leuven-dark-theme.el
index 0e162c8bab..42ebd7b2d6 100644
--- a/etc/themes/leuven-dark-theme.el
+++ b/etc/themes/leuven-dark-theme.el
@@ -5,7 +5,7 @@
 ;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")>
 ;; Contributor: Thibault Polge <(concat "thibault" at-sign "thb.lt")>
 ;; URL: https://github.com/fniessen/emacs-leuven-dark-theme
-;; Version: 20220202.1126
+;; Version: 20220917.2332
 ;; Keywords: color theme
 
 ;; This file is part of GNU Emacs.
@@ -97,7 +97,9 @@ leuven-dark
   "Face colors with a light background.
 Basic, Font Lock, Isearch, Gnus, Message, Org mode, Diff, Ediff,
 Flyspell, Semantic, and Ansi-Color faces are included -- and much
-more...")
+more..."
+  :background-mode 'dark
+  :family 'leuven)
 
 (let ((class '((class color) (min-colors 89)))
 
diff --git a/etc/themes/leuven-theme.el b/etc/themes/leuven-theme.el
index d9a8d5391a..07c34e944c 100644
--- a/etc/themes/leuven-theme.el
+++ b/etc/themes/leuven-theme.el
@@ -4,7 +4,7 @@
 
 ;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")>
 ;; URL: https://github.com/fniessen/emacs-leuven-theme
-;; Version: 20200513.1928
+;; Version: 20220917.2332
 ;; Keywords: color theme
 
 ;; This file is part of GNU Emacs.
@@ -78,7 +78,9 @@ leuven
   "Face colors with a light background.
 Basic, Font Lock, Isearch, Gnus, Message, Org mode, Diff, Ediff,
 Flyspell, Semantic, and Ansi-Color faces are included -- and much
-more...")
+more..."
+  :background-mode 'light
+  :family 'leuven)
 
 (let ((class '((class color) (min-colors 89)))
 
diff --git a/etc/themes/light-blue-theme.el b/etc/themes/light-blue-theme.el
index eeca46210c..449600d01d 100644
--- a/etc/themes/light-blue-theme.el
+++ b/etc/themes/light-blue-theme.el
@@ -27,7 +27,9 @@
 ;;; Code:
 
 (deftheme light-blue
-  "Face colors utilizing a light blue background.")
+  "Face colors utilizing a light blue background."
+  :background-mode 'light
+  :kind 'color-scheme)
 
 (make-obsolete 'light-blue nil "29.1")
 
diff --git a/etc/themes/manoj-dark-theme.el b/etc/themes/manoj-dark-theme.el
index af5576386c..402aafe49d 100644
--- a/etc/themes/manoj-dark-theme.el
+++ b/etc/themes/manoj-dark-theme.el
@@ -67,7 +67,9 @@
 (deftheme manoj-dark
   "Very high contrast faces with a black background.
 This theme avoids subtle color variations, while avoiding the
-jarring angry fruit salad look to reduce eye fatigue.")
+jarring angry fruit salad look to reduce eye fatigue."
+  :background-mode 'dark
+  :kind 'color-scheme)
 
 (custom-theme-set-faces
  'manoj-dark
diff --git a/etc/themes/misterioso-theme.el b/etc/themes/misterioso-theme.el
index 55186384ad..7e3f0289f1 100644
--- a/etc/themes/misterioso-theme.el
+++ b/etc/themes/misterioso-theme.el
@@ -22,7 +22,9 @@
 ;;; Code:
 
 (deftheme misterioso
-  "Predominantly blue/cyan faces on a dark cyan background.")
+  "Predominantly blue/cyan faces on a dark cyan background."
+  :background-mode 'dark
+  :kind 'color-scheme)
 
 (let ((class '((class color) (min-colors 89))))
 
diff --git a/etc/themes/tango-dark-theme.el b/etc/themes/tango-dark-theme.el
index ef00d2ac49..73a928e445 100644
--- a/etc/themes/tango-dark-theme.el
+++ b/etc/themes/tango-dark-theme.el
@@ -30,7 +30,10 @@
 (deftheme tango-dark
   "Face colors using the Tango palette (dark background).
 Basic, Font Lock, Isearch, Gnus, Message, Ediff, Flyspell,
-Semantic, and Ansi-Color faces are included.")
+Semantic, and Ansi-Color faces are included."
+  :background-mode 'dark
+  :kind 'color-scheme
+  :family 'tango)
 
 (let ((class '((class color) (min-colors 89)))
       ;; Tango palette colors.
diff --git a/etc/themes/tango-theme.el b/etc/themes/tango-theme.el
index ecbbf03753..8b8011bd1f 100644
--- a/etc/themes/tango-theme.el
+++ b/etc/themes/tango-theme.el
@@ -30,7 +30,10 @@
 (deftheme tango
   "Face colors using the Tango palette (light background).
 Basic, Font Lock, Isearch, Gnus, Message, Ediff, Flyspell,
-Semantic, and Ansi-Color faces are included.")
+Semantic, and Ansi-Color faces are included."
+  :background-mode 'light
+  :kind 'color-scheme
+  :family 'tango)
 
 (let ((class '((class color) (min-colors 89)))
       ;; Tango palette colors.
diff --git a/etc/themes/tsdh-dark-theme.el b/etc/themes/tsdh-dark-theme.el
index a88ad75520..2a2507f147 100644
--- a/etc/themes/tsdh-dark-theme.el
+++ b/etc/themes/tsdh-dark-theme.el
@@ -20,7 +20,10 @@
 ;;; Code:
 
 (deftheme tsdh-dark
-  "A dark theme used and created by Tassilo Horn.")
+  "A dark theme used and created by Tassilo Horn."
+  :background-mode 'dark
+  :kind 'color-scheme
+  :family 'tsdh)
 
 (custom-theme-set-faces
  'tsdh-dark
diff --git a/etc/themes/tsdh-light-theme.el b/etc/themes/tsdh-light-theme.el
index d9d09b702b..130b2a33d4 100644
--- a/etc/themes/tsdh-light-theme.el
+++ b/etc/themes/tsdh-light-theme.el
@@ -21,7 +21,10 @@
 
 (deftheme tsdh-light
   "A light Emacs theme.
-Used and created by Tassilo Horn.")
+Used and created by Tassilo Horn."
+  :background-mode 'light
+  :kind 'color-scheme
+  :family 'tsdh)
 
 (custom-theme-set-faces
  'tsdh-light
diff --git a/etc/themes/wheatgrass-theme.el b/etc/themes/wheatgrass-theme.el
index c56c8a2d8a..5b4370351f 100644
--- a/etc/themes/wheatgrass-theme.el
+++ b/etc/themes/wheatgrass-theme.el
@@ -23,7 +23,9 @@ wheatgrass
   "High-contrast green/blue/brown faces on a black background.
 Basic, Font Lock, Isearch, Gnus, and Message faces are included.
 The default face foreground is wheat, with other faces in shades
-of green, brown, and blue.")
+of green, brown, and blue."
+  :background-mode 'dark
+  :kind 'color-scheme)
 
 (let ((class '((class color) (min-colors 89))))
   (custom-theme-set-faces
diff --git a/etc/themes/whiteboard-theme.el b/etc/themes/whiteboard-theme.el
index f21b18b421..676e0e0f70 100644
--- a/etc/themes/whiteboard-theme.el
+++ b/etc/themes/whiteboard-theme.el
@@ -22,7 +22,9 @@
 ;;; Code:
 
 (deftheme whiteboard
-  "Face colors similar to markers on a whiteboard.")
+  "Face colors similar to markers on a whiteboard."
+  :background-mode 'light
+  :kind 'color-scheme)
 
 (let ((class '((class color) (min-colors 89))))
   (custom-theme-set-faces
diff --git a/etc/themes/wombat-theme.el b/etc/themes/wombat-theme.el
index d9fab8ac78..4eef29841b 100644
--- a/etc/themes/wombat-theme.el
+++ b/etc/themes/wombat-theme.el
@@ -25,7 +25,9 @@ wombat
   "Medium-contrast faces with a dark gray background.
 Adapted, with permission, from a Vim color scheme by Lars H. Nielsen.
 Basic, Font Lock, Isearch, Gnus, Message, and Ansi-Color faces
-are included.")
+are included."
+  :background-mode 'dark
+  :kind 'color-scheme)
 
 (let ((class '((class color) (min-colors 89))))
   (custom-theme-set-faces
diff --git a/lisp/custom.el b/lisp/custom.el
index 352b5b0e16..3b36544d9d 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -1152,9 +1152,11 @@ custom--sort-vars-1
 ;;   (provide-theme 'THEME)
 
 
-(defmacro deftheme (theme &optional doc)
+(defmacro deftheme (theme &optional doc &rest properties)
   "Declare THEME to be a Custom theme.
 The optional argument DOC is a doc string describing the theme.
+PROPERTIES are interpreted as a property list that will be stored
+in the `theme-properties' property for THEME.
 
 Any theme `foo' should be defined in a file called `foo-theme.el';
 see `custom-make-theme-feature' for more information."
@@ -1164,18 +1166,25 @@ deftheme
     ;; It is better not to use backquote in this file,
     ;; because that makes a bootstrapping problem
     ;; if you need to recompile all the Lisp files using interpreted code.
-    (list 'custom-declare-theme (list 'quote theme) (list 'quote feature) doc)))
+    (list 'custom-declare-theme (list 'quote theme) (list 'quote feature) doc
+          (cons 'list properties))))
 
-(defun custom-declare-theme (theme feature &optional doc)
+(defun custom-declare-theme (theme feature &optional doc properties)
   "Like `deftheme', but THEME is evaluated as a normal argument.
-FEATURE is the feature this theme provides.  Normally, this is a symbol
-created from THEME by `custom-make-theme-feature'."
+FEATURE is the feature this theme provides.  Normally, this is a
+symbol created from THEME by `custom-make-theme-feature'.  The
+optional argument DOC may contain the documentation for THEME.
+The optional argument PROPERTIES may contain a property list of
+attributes associated with THEME."
   (unless (custom-theme-name-valid-p theme)
     (error "Custom theme cannot be named %S" theme))
   (unless (memq theme custom-known-themes)
     (push theme custom-known-themes))
   (put theme 'theme-feature feature)
-  (when doc (put theme 'theme-documentation doc)))
+  (when doc
+    (put theme 'theme-documentation doc))
+  (when properties
+    (put theme 'theme-properties properties)))
 
 (defun custom-make-theme-feature (theme)
   "Given a symbol THEME, create a new symbol by appending \"-theme\".
@@ -1372,6 +1381,55 @@ load-theme
     (enable-theme theme))
   t)
 
+(defun theme-list-variants (theme &rest list)
+  "Return a list of theme variants for THEME.
+If the optional argument LIST is not given, "
+  (let* ((properties (get theme 'theme-properties))
+         (family (plist-get properties :family)))
+    (seq-filter
+     (lambda (variant)
+       (and (eq (plist-get (get variant 'theme-properties) :family)
+                family)
+            (not (eq variant theme))))
+     (or list (custom-available-themes)))))
+
+(defun theme-choose-variant (&optional no-confirm no-enable)
+  "Prompt to switch from the current theme to one of its a variants.
+The current theme will be disabled before variant is enabled.  If
+the current theme has only one variant, switch to that variant
+without prompting, otherwise prompt for the variant to select.
+See `load-theme' for the meaning of NO-CONFIRM and NO-ENABLE."
+  (interactive)
+  (let ((active-color-schemes
+         (seq-filter
+          (lambda (theme)
+            ;; FIXME: As most themes currently do not have a `:kind'
+            ;; tag, it is assumed that a theme is a color scheme by
+            ;; default.  This should be reconsidered in the future.
+            (memq (plist-get (get theme 'theme-properties) :kind)
+                  '(color-scheme nil)))
+          custom-enabled-themes)))
+    (cond
+     ((length= active-color-schemes 0)
+      (user-error "No theme is active, cannot toggle"))
+     ((length> active-color-schemes 1)
+      (user-error "More than one theme active, cannot unambiguously toggle")))
+    (let* ((theme (car active-color-schemes))
+           (family (plist-get (get theme 'theme-properties) :family)))
+      (unless family
+        (error "Theme `%s' does not have any known variants" theme))
+      (let* ((variants (theme-list-variants theme))
+             (choice (cond
+                      ((null variants)
+                       (error "`%s' has no variants" theme))
+                      ((length= variants 1)
+                       (car variants))
+                      ((intern (completing-read "Load custom theme: " variants))))))
+        (disable-theme theme)
+        (load-theme choice no-confirm no-enable)))))
+
+(defalias 'toggle-theme #'theme-choose-variant)
+
 (defun custom-theme-load-confirm (hash)
   "Query the user about loading a Custom theme that may not be safe.
 The theme should be in the current buffer.  If the user agrees,
-- 
2.37.3


--=-=-=
Content-Type: text/plain



Also, the issue I mentioned previously remains.  The properties are only
noticed if the theme file is loaded.  So if you enabled `leuven-dark',
you won't be able to toggle before `leuven' is loaded at least once.

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 18 Sep 2022 10:39:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 18 06:39:38 2022
Received: from localhost ([127.0.0.1]:47896 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oZri6-0004ac-GF
	for submit <at> debbugs.gnu.org; Sun, 18 Sep 2022 06:39:38 -0400
Received: from quimby.gnus.org ([95.216.78.240]:37506)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oZri4-0004aP-M7
 for 57639 <at> debbugs.gnu.org; Sun, 18 Sep 2022 06:39:37 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=6mrr7w1UFOLJemg5hU9Xds8mNI0RzB+I1mVCrnx8Emg=; b=bFqMlURC8bbsQ8AAiJbHUsUjXj
 iQ0xwlTLuhBuxLAJsbw9TmbGyJOl4bqM9oryQ32V4Yb84heawcjJkGV3X+avFtUk8d5+JyJAU/20q
 GGKZNafVvX3+q/QSy7t/KtI4qevz3UDaCBSdbYOT/WAjj0/xgBNwIN1MIuk/DD6cVnc8=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oZrhv-0006ox-Gf; Sun, 18 Sep 2022 12:39:29 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <87h715dnut.fsf@HIDDEN> (Philip Kaludercic's message of "Sun, 
 18 Sep 2022 09:38:02 +0000")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN> <87o7vdg97w.fsf@HIDDEN>
 <831qs926np.fsf@HIDDEN> <871qs9fzz5.fsf@HIDDEN>
 <83h715yxz2.fsf@HIDDEN> <87h715dnut.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEUpJykfHB1+gIG0
 ydGuubtOTVL///+yPxuZAAAAAWJLR0QGYWa4fQAAAAd0SU1FB+YJEgoJFD1GRbgAAAGpSURBVDjL
 bZNhkoMgDIVJd/kPzngBZC8gnAA4AGvN/a+yIQTFzjotVr6+9wJEpf67YIvK8q/6nL/Bh8C+ozJP
 AiwAAtbM84ZdLVvZKcIqbKMAq4YIdOV5C5mBHTEaVX9eQwemW8HBd3peBgAzAZiAWCGK9Cvs3ZNC
 KWfFUd0mCtJoZeAgBcVDvQF5aTA/BEiL7gYcUJXmm3M1xwm0RXAByWMIfUvMtPX6VZLPYdpELd+z
 7KUBGKD2YXU+MaATgOalRaaTc11hJyu6XgRymIFcL+dcaIBLMmPbK5zkxOASYK0EFIGNwVVt21oa
 HGc3q94ZCmlS6Z/DcXa3MsD2DR8NSEY7QF4aCRQ+gORgO44jXVZXk+BBmjM5H2n+AZBBaU6lZ1xr
 qXg6zxGiGCuvuDkfwhU+Wp5A8SXnu1y4GotOr82H1K2gH5fG185ORcAoTNeDQMxU2N273FuoYzPi
 E+T/g7FiJiDuo0WlWZYOSpQMIwf8+9651lsxXoWcAlc7XrUB1uyoVPrkW2Fbf63ZM7iqsrJjS/Qc
 8QSEFlpfblYfAL5T39tPYLcb/AENp3EfHoqI2QAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wOS0x
 OFQxMDowOToyMCswMDowMCsFq2IAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDktMThUMTA6MDk6
 MjArMDA6MDBaWBPeAAAAAElFTkSuQmCC
X-Now-Playing: Stephan Mathieu's _Radiance (12): Pacific_: "Pacific"
Date: Sun, 18 Sep 2022 12:39:27 +0200
Message-ID: <87edw955ls.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Philip Kaludercic <philipk@HIDDEN> writes: > Subject:
 [PATCH] Tag themes with properties Thanks; looks good to me. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: Eli Zaretskii <eliz@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

> Subject: [PATCH] Tag themes with properties

Thanks; looks good to me.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 18 Sep 2022 09:38:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 18 05:38:16 2022
Received: from localhost ([127.0.0.1]:47790 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oZqkh-0002p4-Jr
	for submit <at> debbugs.gnu.org; Sun, 18 Sep 2022 05:38:16 -0400
Received: from mout01.posteo.de ([185.67.36.65]:32931)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oZqke-0002on-7Z
 for 57639 <at> debbugs.gnu.org; Sun, 18 Sep 2022 05:38:13 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 0FDFE240026
 for <57639 <at> debbugs.gnu.org>; Sun, 18 Sep 2022 11:38:05 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1663493886; bh=Y5T2e7oo1+IVfkBjU9DOnkwIng89S63nt5+lX2wiXoA=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=myTxPUdl9DW2g0dts81ZA4RPkSNXQr4XOylSl+X/Ej1e94U0GN3RjrFddwVBuoSQg
 1XmsnIWSYkpc/uivNWJ4DaGOjmzKelcoZaD3KqUkEkU94YG2mD3eOFpuU1lGxDBG0x
 lS9tVHb2RV4cdFkjnUVSEbl501kdJPhldTG+HwjpL+lp0x9xCUqrNzCjWLO/AYMaNK
 qKYFiLtVaQwdr9o3+AB4W9yS5WqxZebgRkOeTY7d1uueQ/P1l3QFvEiyLzXaxczIy3
 9ho9+lzH//6wtajgMMiw1UNqb6jtpcJdZuDHDzKhFOQhSqz8e8rIZKP85LopjjQPQj
 W3hUw2HX2gEWw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MVjQz5yQbz9rxH;
 Sun, 18 Sep 2022 11:38:02 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <83h715yxz2.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 18 Sep
 2022 09:53:53 +0300")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN> <87o7vdg97w.fsf@HIDDEN>
 <831qs926np.fsf@HIDDEN> <871qs9fzz5.fsf@HIDDEN>
 <83h715yxz2.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Sun, 18 Sep 2022 09:38:02 +0000
Message-ID: <87h715dnut.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: larsi@HIDDEN, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Philip Kaludercic <philipk@HIDDEN>
>> Cc: larsi@HIDDEN,  57639 <at> debbugs.gnu.org
>> Date: Sat, 17 Sep 2022 21:33:18 +0000
>> 
>> >> +  (let* ((theme (car custom-enabled-themes))
>> >> +         (family (plist-get (get theme 'theme-properties) :family)))
>> >> +    (unless family
>> >> +      (error "`%s' is not part of a family" theme))
>> >
>> > "Family"? this terminology was never mentioned in the manual or the
>> > doc string.  How about
>> >
>> >   Theme `%s' does not have any variants
>> >
>> > instead?
>> 
>> Strictly speaking that error message would be wrong at this point,
>> because we cannot say if a theme has no variants if it is not part of a
>> family.  This is because variants of a theme are all those that are part
>> of the same family.  I think it would be better to clarify this in the
>> documentation.
>
> But the documentation doesn't explain what it means for a theme to be
> part of a family.  Specifically, how does one tell, by looking at a
> theme, whether it is or isn't part of a family?
>
> An alternative for what I suggested above is to say
>
>   Theme `%s' does not have any known variants

I get what you mean... how about

    (error "Theme `%s' is not part of a family of variants" theme)

?

>> +(defun theme-choose-variant (&optional no-confirm no-enable)
>> +  "Prompt to switch from the current theme to a variant.
>                                               ^^^^^^^^^^^^
> "to one of its variants" is more clear.

Done.

>> +Themes only have variants if they are part of a family of themes.
>
> This should explain what it means to be part of a family, otherwise
> this sentence is not helpful.

My intention was for this to be an explanation.  The issue is that
variants and family are mutually recursive concepts:

- A variant of a theme are those which are part of the same family
- A family of themes is the set of all variants of a theme.

Perhaps it is just easier to collapse both concepts into either variant
of family and just "expose" by documenting it.  I've tried doing so
below.

>> +The current theme will be immediately disabled before variant is
>> +enabled.
>
> The "immediately" part should probably be removed, as it doesn't seem
> to convey anything of importance, does it?  Come to think of it, what
> exactly does this sentence try to say? isn't it obvious that the
> current theme will be disabled and then the variant will be enabled?

I guess it isn't necessary, the point was just to emphasise that nothing
happens between disabling the previous theme and enabling the variant.
There was something I had in mind when writing this initially, but I
cannot recall it anymore.

So I've removed it for now.

>>          In case the current theme has only one variant, it will
>> +be toggled without prompting.
>
> "toggled" is wrong here.  I suggest
>
>   If the current theme has only one variant, switch to that variant
>   without prompting, otherwise prompt for the variant to select.

Done.

>>                                 For NO-CONFIRM and NO-ENABLE, see
>> +`load-theme'."
>
> I suggest to say this the other way around:
>
>    See `load-theme' for the meaning of NO-CONFIRM and NO-ENABLE.

Done.

> Thanks.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=0001-Tag-themes-with-properties.patch

From 4aa11070669c4b7c802d54d7dd7dffbd41a1a409 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@HIDDEN>
Date: Sat, 17 Sep 2022 20:11:42 +0200
Subject: [PATCH] Tag themes with properties

* doc/emacs/custom.texi (Custom Themes): Document 'theme-choose-variant'.
* doc/lispref/customize.texi (Custom Themes): Document the new
optional argument to 'deftheme'.
* etc/themes/leuven-dark-theme.el (leuven-dark): Add properties.
* etc/themes/leuven-theme.el (leuven): Add properties.
* etc/themes/tango-dark-theme.el (tango-dark): Add properties.
* etc/themes/tango-theme.el (tango): Add properties.
* etc/themes/tsdh-dark-theme.el (tsdh-dark): Add properties.
* etc/themes/tsdh-light-theme.el (tsdh-light): Add properties.
* lisp/custom.el (deftheme): Allow for optional arguments to set the
property list.
(custom-declare-theme): Accept the same optional arguments as 'deftheme'.
(theme-list-variants): Add new function.
(theme-choose-variant): Add new command for switching between members
of a theme family.
(toggle-theme): Add an alias for 'theme-choose-variant'.
---
 doc/emacs/custom.texi           | 10 ++++++
 doc/lispref/customize.texi      |  5 +--
 etc/themes/leuven-dark-theme.el |  6 ++--
 etc/themes/leuven-theme.el      |  6 ++--
 etc/themes/tango-dark-theme.el  |  4 ++-
 etc/themes/tango-theme.el       |  4 ++-
 etc/themes/tsdh-dark-theme.el   |  4 ++-
 etc/themes/tsdh-light-theme.el  |  4 ++-
 lisp/custom.el                  | 61 +++++++++++++++++++++++++++++----
 9 files changed, 88 insertions(+), 16 deletions(-)

diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index ff7ab83190..f98527bf9a 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -667,6 +667,16 @@ Custom Themes
 the @file{*Custom Themes*} buffer; or type @kbd{M-x describe-theme}
 anywhere in Emacs and enter the theme name.
 
+@findex theme-choose-variant
+Some themes have variants (most often just two: light and dark).  You
+can switch to another variant using @kbd{M-x theme-choose-variant}.
+If the currently active theme has only one other variant, it will be
+selected; if there are more variants, the command will prompt you
+which one to switch to.
+
+Note that @code{theme-choose-variant} only works if a single theme
+is active.
+
 @node Creating Custom Themes
 @subsection Creating Custom Themes
 @cindex custom themes, creating
diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi
index 6ba35cffff..911b6c4d75 100644
--- a/doc/lispref/customize.texi
+++ b/doc/lispref/customize.texi
@@ -1428,12 +1428,13 @@ Custom Themes
 be a call to @code{deftheme}, and the last form should be a call to
 @code{provide-theme}.
 
-@defmac deftheme theme &optional doc
+@defmac deftheme theme &optional doc &rest properties
 This macro declares @var{theme} (a symbol) as the name of a Custom
 theme.  The optional argument @var{doc} should be a string describing
 the theme; this is the description shown when the user invokes the
 @code{describe-theme} command or types @kbd{?} in the @samp{*Custom
-Themes*} buffer.
+Themes*} buffer.  The remaining arguments @var{properties} are used
+pass a property list with theme attributes.
 
 Two special theme names are disallowed (using them causes an error):
 @code{user} is a dummy theme that stores the user's direct
diff --git a/etc/themes/leuven-dark-theme.el b/etc/themes/leuven-dark-theme.el
index 0e162c8bab..42ebd7b2d6 100644
--- a/etc/themes/leuven-dark-theme.el
+++ b/etc/themes/leuven-dark-theme.el
@@ -5,7 +5,7 @@
 ;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")>
 ;; Contributor: Thibault Polge <(concat "thibault" at-sign "thb.lt")>
 ;; URL: https://github.com/fniessen/emacs-leuven-dark-theme
-;; Version: 20220202.1126
+;; Version: 20220917.2332
 ;; Keywords: color theme
 
 ;; This file is part of GNU Emacs.
@@ -97,7 +97,9 @@ leuven-dark
   "Face colors with a light background.
 Basic, Font Lock, Isearch, Gnus, Message, Org mode, Diff, Ediff,
 Flyspell, Semantic, and Ansi-Color faces are included -- and much
-more...")
+more..."
+  :background-mode 'dark
+  :family 'leuven)
 
 (let ((class '((class color) (min-colors 89)))
 
diff --git a/etc/themes/leuven-theme.el b/etc/themes/leuven-theme.el
index d9a8d5391a..07c34e944c 100644
--- a/etc/themes/leuven-theme.el
+++ b/etc/themes/leuven-theme.el
@@ -4,7 +4,7 @@
 
 ;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")>
 ;; URL: https://github.com/fniessen/emacs-leuven-theme
-;; Version: 20200513.1928
+;; Version: 20220917.2332
 ;; Keywords: color theme
 
 ;; This file is part of GNU Emacs.
@@ -78,7 +78,9 @@ leuven
   "Face colors with a light background.
 Basic, Font Lock, Isearch, Gnus, Message, Org mode, Diff, Ediff,
 Flyspell, Semantic, and Ansi-Color faces are included -- and much
-more...")
+more..."
+  :background-mode 'light
+  :family 'leuven)
 
 (let ((class '((class color) (min-colors 89)))
 
diff --git a/etc/themes/tango-dark-theme.el b/etc/themes/tango-dark-theme.el
index ef00d2ac49..fb5a1b29eb 100644
--- a/etc/themes/tango-dark-theme.el
+++ b/etc/themes/tango-dark-theme.el
@@ -30,7 +30,9 @@
 (deftheme tango-dark
   "Face colors using the Tango palette (dark background).
 Basic, Font Lock, Isearch, Gnus, Message, Ediff, Flyspell,
-Semantic, and Ansi-Color faces are included.")
+Semantic, and Ansi-Color faces are included."
+  :background-mode 'dark
+  :family 'tango)
 
 (let ((class '((class color) (min-colors 89)))
       ;; Tango palette colors.
diff --git a/etc/themes/tango-theme.el b/etc/themes/tango-theme.el
index ecbbf03753..026718bf38 100644
--- a/etc/themes/tango-theme.el
+++ b/etc/themes/tango-theme.el
@@ -30,7 +30,9 @@
 (deftheme tango
   "Face colors using the Tango palette (light background).
 Basic, Font Lock, Isearch, Gnus, Message, Ediff, Flyspell,
-Semantic, and Ansi-Color faces are included.")
+Semantic, and Ansi-Color faces are included."
+  :background-mode 'light
+  :family 'tango)
 
 (let ((class '((class color) (min-colors 89)))
       ;; Tango palette colors.
diff --git a/etc/themes/tsdh-dark-theme.el b/etc/themes/tsdh-dark-theme.el
index a88ad75520..ddd710a16e 100644
--- a/etc/themes/tsdh-dark-theme.el
+++ b/etc/themes/tsdh-dark-theme.el
@@ -20,7 +20,9 @@
 ;;; Code:
 
 (deftheme tsdh-dark
-  "A dark theme used and created by Tassilo Horn.")
+  "A dark theme used and created by Tassilo Horn."
+  :background-mode 'dark
+  :family 'tsdh)
 
 (custom-theme-set-faces
  'tsdh-dark
diff --git a/etc/themes/tsdh-light-theme.el b/etc/themes/tsdh-light-theme.el
index d9d09b702b..724b081880 100644
--- a/etc/themes/tsdh-light-theme.el
+++ b/etc/themes/tsdh-light-theme.el
@@ -21,7 +21,9 @@
 
 (deftheme tsdh-light
   "A light Emacs theme.
-Used and created by Tassilo Horn.")
+Used and created by Tassilo Horn."
+  :background-mode 'light
+  :family 'tsdh)
 
 (custom-theme-set-faces
  'tsdh-light
diff --git a/lisp/custom.el b/lisp/custom.el
index 352b5b0e16..5a3d3b95e2 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -1152,9 +1152,11 @@ custom--sort-vars-1
 ;;   (provide-theme 'THEME)
 
 
-(defmacro deftheme (theme &optional doc)
+(defmacro deftheme (theme &optional doc &rest properties)
   "Declare THEME to be a Custom theme.
 The optional argument DOC is a doc string describing the theme.
+PROPERTIES are interpreted as a property list that will be stored
+in the `theme-properties' property for THEME.
 
 Any theme `foo' should be defined in a file called `foo-theme.el';
 see `custom-make-theme-feature' for more information."
@@ -1164,18 +1166,25 @@ deftheme
     ;; It is better not to use backquote in this file,
     ;; because that makes a bootstrapping problem
     ;; if you need to recompile all the Lisp files using interpreted code.
-    (list 'custom-declare-theme (list 'quote theme) (list 'quote feature) doc)))
+    (list 'custom-declare-theme (list 'quote theme) (list 'quote feature) doc
+          (cons 'list properties))))
 
-(defun custom-declare-theme (theme feature &optional doc)
+(defun custom-declare-theme (theme feature &optional doc properties)
   "Like `deftheme', but THEME is evaluated as a normal argument.
-FEATURE is the feature this theme provides.  Normally, this is a symbol
-created from THEME by `custom-make-theme-feature'."
+FEATURE is the feature this theme provides.  Normally, this is a
+symbol created from THEME by `custom-make-theme-feature'.  The
+optional argument DOC may contain the documentation for THEME.
+The optional argument PROPERTIES may contain a property list of
+attributes associated with THEME."
   (unless (custom-theme-name-valid-p theme)
     (error "Custom theme cannot be named %S" theme))
   (unless (memq theme custom-known-themes)
     (push theme custom-known-themes))
   (put theme 'theme-feature feature)
-  (when doc (put theme 'theme-documentation doc)))
+  (when doc
+    (put theme 'theme-documentation doc))
+  (when properties
+    (put theme 'theme-properties properties)))
 
 (defun custom-make-theme-feature (theme)
   "Given a symbol THEME, create a new symbol by appending \"-theme\".
@@ -1372,6 +1381,46 @@ load-theme
     (enable-theme theme))
   t)
 
+(defun theme-list-variants (theme &rest list)
+  "Return a list of theme variants for THEME.
+If the optional argument LIST is not given, "
+  (let* ((properties (get theme 'theme-properties))
+         (family (plist-get properties :family)))
+    (seq-filter
+     (lambda (variant)
+       (and (eq (plist-get (get variant 'theme-properties) :family)
+                family)
+            (not (eq variant theme))))
+     (or list (custom-available-themes)))))
+
+(defun theme-choose-variant (&optional no-confirm no-enable)
+  "Prompt to switch from the current theme to one of its a variants.
+The current theme will be disabled before variant is enabled.  If
+the current theme has only one variant, switch to that variant
+without prompting, otherwise prompt for the variant to select.
+See `load-theme' for the meaning of NO-CONFIRM and NO-ENABLE."
+  (interactive)
+  (cond
+   ((length= custom-enabled-themes 0)
+    (user-error "No theme is active, cannot toggle"))
+   ((length> custom-enabled-themes 1)
+    (user-error "More than one theme active, cannot unambiguously toggle")))
+  (let* ((theme (car custom-enabled-themes))
+         (family (plist-get (get theme 'theme-properties) :family)))
+    (unless family
+      (error "Theme `%s' does not have any known variants" theme))
+    (let* ((variants (theme-list-variants theme))
+           (choice (cond
+                    ((null variants)
+                     (error "`%s' has no variants" theme))
+                    ((length= variants 1)
+                     (car variants))
+                    ((intern (completing-read "Load custom theme: " variants))))))
+      (disable-theme theme)
+      (load-theme choice no-confirm no-enable))))
+
+(defalias 'toggle-theme #'theme-choose-variant)
+
 (defun custom-theme-load-confirm (hash)
   "Query the user about loading a Custom theme that may not be safe.
 The theme should be in the current buffer.  If the user agrees,
-- 
2.37.3


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 18 Sep 2022 06:54:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 18 02:54:04 2022
Received: from localhost ([127.0.0.1]:47635 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oZoBo-0006mv-FT
	for submit <at> debbugs.gnu.org; Sun, 18 Sep 2022 02:54:04 -0400
Received: from eggs.gnu.org ([209.51.188.92]:38594)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oZoBj-0006mF-RN
 for 57639 <at> debbugs.gnu.org; Sun, 18 Sep 2022 02:54:03 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:54844)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oZoBe-00071e-Au; Sun, 18 Sep 2022 02:53:54 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=Mh4BNZjBirPb7fgYipcxk8tOsZBqAEPhm4D66QbV3aA=; b=Pom7reXWD6J7
 fFN3BIrD/zr+4KLQWEA39a+qKDYkzWoAHT16+K2zuDoR0rFCppL24yCXYlFL8xdkcJJzAIm7/nubH
 d9gAMujNpygrg9FoSgTSr2off3hsNDqlbqN0m2wj/UmY9h44toT5OmWARuL22HvF75AETZOxjMy7X
 8pTAudUTLx0rrfMOY/8Y63keYKRwDlj0hVFByvAA/RK+meZysIxmfOYS9jALh6hbizcHvaw466Zsl
 dGwFhXwnwXHFez6eJIK8Zj+0YPLFZrw2SPTfITlxo2S/Jj7iXQkdaUvgdanyzfqqxK0E2Mxahify4
 FCk1NyzTLjGMzsVlw/hRrA==;
Received: from [87.69.77.57] (port=3867 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oZoBd-0003WJ-MG; Sun, 18 Sep 2022 02:53:54 -0400
Date: Sun, 18 Sep 2022 09:53:53 +0300
Message-Id: <83h715yxz2.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
In-Reply-To: <871qs9fzz5.fsf@HIDDEN> (message from Philip Kaludercic on
 Sat, 17 Sep 2022 21:33:18 +0000)
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN> <87o7vdg97w.fsf@HIDDEN>
 <831qs926np.fsf@HIDDEN> <871qs9fzz5.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: larsi@HIDDEN, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Philip Kaludercic <philipk@HIDDEN>
> Cc: larsi@HIDDEN,  57639 <at> debbugs.gnu.org
> Date: Sat, 17 Sep 2022 21:33:18 +0000
> 
> >> +  (let* ((theme (car custom-enabled-themes))
> >> +         (family (plist-get (get theme 'theme-properties) :family)))
> >> +    (unless family
> >> +      (error "`%s' is not part of a family" theme))
> >
> > "Family"? this terminology was never mentioned in the manual or the
> > doc string.  How about
> >
> >   Theme `%s' does not have any variants
> >
> > instead?
> 
> Strictly speaking that error message would be wrong at this point,
> because we cannot say if a theme has no variants if it is not part of a
> family.  This is because variants of a theme are all those that are part
> of the same family.  I think it would be better to clarify this in the
> documentation.

But the documentation doesn't explain what it means for a theme to be
part of a family.  Specifically, how does one tell, by looking at a
theme, whether it is or isn't part of a family?

An alternative for what I suggested above is to say

  Theme `%s' does not have any known variants

> +(defun theme-choose-variant (&optional no-confirm no-enable)
> +  "Prompt to switch from the current theme to a variant.
                                              ^^^^^^^^^^^^
"to one of its variants" is more clear.

> +Themes only have variants if they are part of a family of themes.

This should explain what it means to be part of a family, otherwise
this sentence is not helpful.

> +The current theme will be immediately disabled before variant is
> +enabled.

The "immediately" part should probably be removed, as it doesn't seem
to convey anything of importance, does it?  Come to think of it, what
exactly does this sentence try to say? isn't it obvious that the
current theme will be disabled and then the variant will be enabled?

>          In case the current theme has only one variant, it will
> +be toggled without prompting.

"toggled" is wrong here.  I suggest

  If the current theme has only one variant, switch to that variant
  without prompting, otherwise prompt for the variant to select.

>                                 For NO-CONFIRM and NO-ENABLE, see
> +`load-theme'."

I suggest to say this the other way around:

   See `load-theme' for the meaning of NO-CONFIRM and NO-ENABLE.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 17 Sep 2022 21:33:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 17 17:33:33 2022
Received: from localhost ([127.0.0.1]:47284 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oZfRM-0007Dp-I2
	for submit <at> debbugs.gnu.org; Sat, 17 Sep 2022 17:33:33 -0400
Received: from mout01.posteo.de ([185.67.36.65]:58231)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oZfRH-0007DZ-AH
 for 57639 <at> debbugs.gnu.org; Sat, 17 Sep 2022 17:33:30 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 2A759240026
 for <57639 <at> debbugs.gnu.org>; Sat, 17 Sep 2022 23:33:20 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1663450401; bh=xSyljolMsNgAxuSkKp7OOvrIm79H4eq78DNxjA51/kM=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=XaegDueKwr0HuGuE12Ji+lY9nL1eKHmA6Y/xdmSTYB79yc1oa19yNKSEJ3QTG853y
 yxfU3a4kfobaBRt5W9rQR+tT448qQcSEFQZJk2+fhH9dp9Ttf9/XHDiH8z0hDy8D+k
 MXlCZ6W+irJyqxpRz1SyG3Pw8Vycj40W05Yv61lgdcZa/jhSnKfuji2IX+rIk2EvQk
 HP03JyMV56yraTbwXuFCcVIugDLmCESWKhOqkVhRCEI2goP7qYiypWX9DgzGVQER35
 cwhA3wm43rEaCqs41McCMUCUPF1yZVoPr4fLrhcCGDOeZT0ZGgXkGEZHx2vJzhaLEA
 AHcH55QuibmYw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MVPLm19kqz6trG;
 Sat, 17 Sep 2022 23:33:19 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <831qs926np.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 17 Sep
 2022 21:32:42 +0300")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN> <87o7vdg97w.fsf@HIDDEN>
 <831qs926np.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Sat, 17 Sep 2022 21:33:18 +0000
Message-ID: <871qs9fzz5.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: larsi@HIDDEN, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain

Eli Zaretskii <eliz@HIDDEN> writes:

>> Cc: 57639 <at> debbugs.gnu.org
>> From: Philip Kaludercic <philipk@HIDDEN>
>> Date: Sat, 17 Sep 2022 18:13:39 +0000
>> 
>> +@findex theme-choose-variant
>> +  Some themes have variants (most often these are light and dark
>> +pairs).  You can switch between these by typing @kbd{M-x
>> +theme-choose-variant}.  Note that this only works if only one theme is
>> +active.  If a theme has only one alternative, it will toggle
>> +automatically.  If there are more of them, it will query which one to
>> +use.
>
> This description is confusing, I needed to read it several times
> before I understood what you were trying to say.  The main problem is
> that the "Note" sentence doesn't belong, and it interrupts the logic
> of the description.  Here's my suggestion for saying it more clearly:
>
>   Some themes have variants (most often just two: light and dark).
>   You can switch to another variant with @kbd{M-x
>   theme-choose-variant}.  If the currently active theme has only one
>   other variant, it will be selected; if there are more variants, the
>   command will prompt you which one to switch to.
>
>   Note that @code{theme-choose-variant} only works if a single theme
>   is active.

I prefer your phrasing and have adapted it in my next iteration of the
patch below.

> (Btw, what happens if more than one theme is active and the user
> invokes theme-choose-variant? should this be described?)

The current patch doesn't support this, but I've considered that a
custom theme could clarify that it is a colour scheme in the new property
list, and toggling would then not assume that there is only one active
theme but only one active colour scheme.

>> +Themes*} buffer.  The remaining arguments @var{properties} is used
>> +pass a property list with theme attributes.                ^^^^^^^
>
> "are used", in plural.

Fixed.

>> +  :brightness 'light
>
> Should we use :background-mode instead of :brightness, for consistency
> with frame-background-mode?

I chose "brightness" because I was looking at terms used in colour
theory and everyday language[0], and considered describing properties
such as "hue", "saturation", "contrast", etc. but that would probably be
overkill.  Consistency is probably preferable, so I'll also make this change.

[0] https://en.wikipedia.org/wiki/Color_term#In_natural_languages

>> +(defun theme-choose-variant (&optional no-confirm no-enable)
>> +  "Toggle the current active theme by enabling its dual pair.
>
> "Toggle ... by enabling"?  "Dual pair"?  Can this sentence be
> rephrased to be more clear?

>> +The current theme will be immediately disabled before the dual
>> +theme has been enabled.
>
> Likewise here: "dual theme" doesn't explain itself, and seems to be
> inaccurate, given the description in the manual.

You are right, the documentation was outdated.  See below.

>>                          If THEME is not active an error will be
>> +raised.
>
> Passive tense alert!
>
>>           If theme is nil For NO-CONFIRM and NO-ENABLE, see
>> +`load-theme'."
>
> Something's missing here or wrong with the punctuation?

The sentence was cut-off, so I just removed everything from "It" to
"nil".

>> +   ((length> custom-enabled-themes 1)
>> +    (user-error "More than one theme active, cannot unambiguously toggle")))
>
> Wouldn't it be better to prompt for the theme in this case?

That would be another possibility.  I guess it could be combined with
the above proposal.

>> +  (let* ((theme (car custom-enabled-themes))
>> +         (family (plist-get (get theme 'theme-properties) :family)))
>> +    (unless family
>> +      (error "`%s' is not part of a family" theme))
>
> "Family"? this terminology was never mentioned in the manual or the
> doc string.  How about
>
>   Theme `%s' does not have any variants
>
> instead?

Strictly speaking that error message would be wrong at this point,
because we cannot say if a theme has no variants if it is not part of a
family.  This is because variants of a theme are all those that are part
of the same family.  I think it would be better to clarify this in the
documentation.

> Thanks.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=0001-Tag-themes-with-properties.patch

From ae4f1596c479b9703c27b3635cff88f89a0b730a Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@HIDDEN>
Date: Sat, 17 Sep 2022 20:11:42 +0200
Subject: [PATCH] Tag themes with properties

* doc/emacs/custom.texi (Custom Themes): Document 'theme-choose-variant'.
* doc/lispref/customize.texi (Custom Themes): Document the new
optional argument to 'deftheme'.
* etc/themes/leuven-dark-theme.el (leuven-dark): Add properties.
* etc/themes/leuven-theme.el (leuven): Add properties.
* etc/themes/tango-dark-theme.el (tango-dark): Add properties.
* etc/themes/tango-theme.el (tango): Add properties.
* etc/themes/tsdh-dark-theme.el (tsdh-dark): Add properties.
* etc/themes/tsdh-light-theme.el (tsdh-light): Add properties.
* lisp/custom.el (deftheme): Allow for optional arguments to set the
property list.
(custom-declare-theme): Accept the same optional arguments as 'deftheme'.
(theme-list-variants): Add new function.
(theme-choose-variant): Add new command for switching between members
of a theme family.
(toggle-theme): Add an alias for 'theme-choose-variant'.
---
 doc/emacs/custom.texi           | 11 ++++++
 doc/lispref/customize.texi      |  5 +--
 etc/themes/leuven-dark-theme.el |  6 ++--
 etc/themes/leuven-theme.el      |  6 ++--
 etc/themes/tango-dark-theme.el  |  4 ++-
 etc/themes/tango-theme.el       |  4 ++-
 etc/themes/tsdh-dark-theme.el   |  4 ++-
 etc/themes/tsdh-light-theme.el  |  4 ++-
 lisp/custom.el                  | 62 +++++++++++++++++++++++++++++----
 9 files changed, 90 insertions(+), 16 deletions(-)

diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index ff7ab83190..4d5a674564 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -667,6 +667,17 @@ Custom Themes
 the @file{*Custom Themes*} buffer; or type @kbd{M-x describe-theme}
 anywhere in Emacs and enter the theme name.
 
+@findex theme-choose-variant
+Some themes have variants (most often just two: light and dark).  In
+this case we say the theme is part of a family of themes.  You can
+switch to another variant within a family using @kbd{M-x
+theme-choose-variant}.  If the currently active theme has only one
+other variant, it will be selected; if there are more variants, the
+command will prompt you which one to switch to.
+
+Note that @code{theme-choose-variant} only works if a single theme
+is active.
+
 @node Creating Custom Themes
 @subsection Creating Custom Themes
 @cindex custom themes, creating
diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi
index 6ba35cffff..911b6c4d75 100644
--- a/doc/lispref/customize.texi
+++ b/doc/lispref/customize.texi
@@ -1428,12 +1428,13 @@ Custom Themes
 be a call to @code{deftheme}, and the last form should be a call to
 @code{provide-theme}.
 
-@defmac deftheme theme &optional doc
+@defmac deftheme theme &optional doc &rest properties
 This macro declares @var{theme} (a symbol) as the name of a Custom
 theme.  The optional argument @var{doc} should be a string describing
 the theme; this is the description shown when the user invokes the
 @code{describe-theme} command or types @kbd{?} in the @samp{*Custom
-Themes*} buffer.
+Themes*} buffer.  The remaining arguments @var{properties} are used
+pass a property list with theme attributes.
 
 Two special theme names are disallowed (using them causes an error):
 @code{user} is a dummy theme that stores the user's direct
diff --git a/etc/themes/leuven-dark-theme.el b/etc/themes/leuven-dark-theme.el
index 0e162c8bab..42ebd7b2d6 100644
--- a/etc/themes/leuven-dark-theme.el
+++ b/etc/themes/leuven-dark-theme.el
@@ -5,7 +5,7 @@
 ;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")>
 ;; Contributor: Thibault Polge <(concat "thibault" at-sign "thb.lt")>
 ;; URL: https://github.com/fniessen/emacs-leuven-dark-theme
-;; Version: 20220202.1126
+;; Version: 20220917.2332
 ;; Keywords: color theme
 
 ;; This file is part of GNU Emacs.
@@ -97,7 +97,9 @@ leuven-dark
   "Face colors with a light background.
 Basic, Font Lock, Isearch, Gnus, Message, Org mode, Diff, Ediff,
 Flyspell, Semantic, and Ansi-Color faces are included -- and much
-more...")
+more..."
+  :background-mode 'dark
+  :family 'leuven)
 
 (let ((class '((class color) (min-colors 89)))
 
diff --git a/etc/themes/leuven-theme.el b/etc/themes/leuven-theme.el
index d9a8d5391a..07c34e944c 100644
--- a/etc/themes/leuven-theme.el
+++ b/etc/themes/leuven-theme.el
@@ -4,7 +4,7 @@
 
 ;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")>
 ;; URL: https://github.com/fniessen/emacs-leuven-theme
-;; Version: 20200513.1928
+;; Version: 20220917.2332
 ;; Keywords: color theme
 
 ;; This file is part of GNU Emacs.
@@ -78,7 +78,9 @@ leuven
   "Face colors with a light background.
 Basic, Font Lock, Isearch, Gnus, Message, Org mode, Diff, Ediff,
 Flyspell, Semantic, and Ansi-Color faces are included -- and much
-more...")
+more..."
+  :background-mode 'light
+  :family 'leuven)
 
 (let ((class '((class color) (min-colors 89)))
 
diff --git a/etc/themes/tango-dark-theme.el b/etc/themes/tango-dark-theme.el
index ef00d2ac49..fb5a1b29eb 100644
--- a/etc/themes/tango-dark-theme.el
+++ b/etc/themes/tango-dark-theme.el
@@ -30,7 +30,9 @@
 (deftheme tango-dark
   "Face colors using the Tango palette (dark background).
 Basic, Font Lock, Isearch, Gnus, Message, Ediff, Flyspell,
-Semantic, and Ansi-Color faces are included.")
+Semantic, and Ansi-Color faces are included."
+  :background-mode 'dark
+  :family 'tango)
 
 (let ((class '((class color) (min-colors 89)))
       ;; Tango palette colors.
diff --git a/etc/themes/tango-theme.el b/etc/themes/tango-theme.el
index ecbbf03753..026718bf38 100644
--- a/etc/themes/tango-theme.el
+++ b/etc/themes/tango-theme.el
@@ -30,7 +30,9 @@
 (deftheme tango
   "Face colors using the Tango palette (light background).
 Basic, Font Lock, Isearch, Gnus, Message, Ediff, Flyspell,
-Semantic, and Ansi-Color faces are included.")
+Semantic, and Ansi-Color faces are included."
+  :background-mode 'light
+  :family 'tango)
 
 (let ((class '((class color) (min-colors 89)))
       ;; Tango palette colors.
diff --git a/etc/themes/tsdh-dark-theme.el b/etc/themes/tsdh-dark-theme.el
index a88ad75520..ddd710a16e 100644
--- a/etc/themes/tsdh-dark-theme.el
+++ b/etc/themes/tsdh-dark-theme.el
@@ -20,7 +20,9 @@
 ;;; Code:
 
 (deftheme tsdh-dark
-  "A dark theme used and created by Tassilo Horn.")
+  "A dark theme used and created by Tassilo Horn."
+  :background-mode 'dark
+  :family 'tsdh)
 
 (custom-theme-set-faces
  'tsdh-dark
diff --git a/etc/themes/tsdh-light-theme.el b/etc/themes/tsdh-light-theme.el
index d9d09b702b..724b081880 100644
--- a/etc/themes/tsdh-light-theme.el
+++ b/etc/themes/tsdh-light-theme.el
@@ -21,7 +21,9 @@
 
 (deftheme tsdh-light
   "A light Emacs theme.
-Used and created by Tassilo Horn.")
+Used and created by Tassilo Horn."
+  :background-mode 'light
+  :family 'tsdh)
 
 (custom-theme-set-faces
  'tsdh-light
diff --git a/lisp/custom.el b/lisp/custom.el
index 352b5b0e16..f04241ca4d 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -1152,9 +1152,11 @@ custom--sort-vars-1
 ;;   (provide-theme 'THEME)
 
 
-(defmacro deftheme (theme &optional doc)
+(defmacro deftheme (theme &optional doc &rest properties)
   "Declare THEME to be a Custom theme.
 The optional argument DOC is a doc string describing the theme.
+PROPERTIES are interpreted as a property list that will be stored
+in the `theme-properties' property for THEME.
 
 Any theme `foo' should be defined in a file called `foo-theme.el';
 see `custom-make-theme-feature' for more information."
@@ -1164,18 +1166,25 @@ deftheme
     ;; It is better not to use backquote in this file,
     ;; because that makes a bootstrapping problem
     ;; if you need to recompile all the Lisp files using interpreted code.
-    (list 'custom-declare-theme (list 'quote theme) (list 'quote feature) doc)))
+    (list 'custom-declare-theme (list 'quote theme) (list 'quote feature) doc
+          (cons 'list properties))))
 
-(defun custom-declare-theme (theme feature &optional doc)
+(defun custom-declare-theme (theme feature &optional doc properties)
   "Like `deftheme', but THEME is evaluated as a normal argument.
-FEATURE is the feature this theme provides.  Normally, this is a symbol
-created from THEME by `custom-make-theme-feature'."
+FEATURE is the feature this theme provides.  Normally, this is a
+symbol created from THEME by `custom-make-theme-feature'.  The
+optional argument DOC may contain the documentation for THEME.
+The optional argument PROPERTIES may contain a property list of
+attributes associated with THEME."
   (unless (custom-theme-name-valid-p theme)
     (error "Custom theme cannot be named %S" theme))
   (unless (memq theme custom-known-themes)
     (push theme custom-known-themes))
   (put theme 'theme-feature feature)
-  (when doc (put theme 'theme-documentation doc)))
+  (when doc
+    (put theme 'theme-documentation doc))
+  (when properties
+    (put theme 'theme-properties properties)))
 
 (defun custom-make-theme-feature (theme)
   "Given a symbol THEME, create a new symbol by appending \"-theme\".
@@ -1372,6 +1381,47 @@ load-theme
     (enable-theme theme))
   t)
 
+(defun theme-list-variants (theme &rest list)
+  "Return a list of theme variants for THEME.
+If the optional argument LIST is not given, "
+  (let* ((properties (get theme 'theme-properties))
+         (family (plist-get properties :family)))
+    (seq-filter
+     (lambda (variant)
+       (and (eq (plist-get (get variant 'theme-properties) :family)
+                family)
+            (not (eq variant theme))))
+     (or list (custom-available-themes)))))
+
+(defun theme-choose-variant (&optional no-confirm no-enable)
+  "Prompt to switch from the current theme to a variant.
+Themes only have variants if they are part of a family of themes.
+The current theme will be immediately disabled before variant is
+enabled.  In case the current theme has only one variant, it will
+be toggled without prompting.  For NO-CONFIRM and NO-ENABLE, see
+`load-theme'."
+  (interactive)
+  (cond
+   ((length= custom-enabled-themes 0)
+    (user-error "No theme is active, cannot toggle"))
+   ((length> custom-enabled-themes 1)
+    (user-error "More than one theme active, cannot unambiguously toggle")))
+  (let* ((theme (car custom-enabled-themes))
+         (family (plist-get (get theme 'theme-properties) :family)))
+    (unless family
+      (error "`%s' is not part of a family" theme))
+    (let* ((variants (theme-list-variants theme))
+           (choice (cond
+                    ((null variants)
+                     (error "`%s' has no variants" theme))
+                    ((length= variants 1)
+                     (car variants))
+                    ((intern (completing-read "Load custom theme: " variants))))))
+      (disable-theme theme)
+      (load-theme choice no-confirm no-enable))))
+
+(defalias 'toggle-theme #'theme-choose-variant)
+
 (defun custom-theme-load-confirm (hash)
   "Query the user about loading a Custom theme that may not be safe.
 The theme should be in the current buffer.  If the user agrees,
-- 
2.37.3


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 17 Sep 2022 18:32:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 17 14:32:52 2022
Received: from localhost ([127.0.0.1]:47193 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oZccW-0000gf-2y
	for submit <at> debbugs.gnu.org; Sat, 17 Sep 2022 14:32:52 -0400
Received: from eggs.gnu.org ([209.51.188.92]:44882)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1oZccS-0000gO-Ie
 for 57639 <at> debbugs.gnu.org; Sat, 17 Sep 2022 14:32:50 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:44120)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oZccN-0003Es-8f; Sat, 17 Sep 2022 14:32:43 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=mjjvJyJId7bXtVV1KUroY6QLzIrwT/p+tef1IY/ckX8=; b=kIXt5cGpV8LC
 GXPsmXjRZ8ZR/c+cbTx5PuNUMm1jY2rajQMo7GZ3SaTW4FOIJesJhls02UPgl4zavHTmLeOMOuOSe
 2iGbiIjeIT7Lp98XlQc1UFT63RzTGvQ/p5mQQBeFv2lqdIP8NJM1MekO3qirTqUjB+8N1OAbP3e3N
 YsK2WMYEnEwSt9yquW6aL2srWyBaXaU+eYEdmSk2aFJyH/bkG18kn5M1NfapdgYLqizaRVXKSOJ2L
 dzfK4bC+ABlciU9B25ENfl24lvpdTG2JRpTiqZl7ojgu7GSRAOQruMF5YEdLnlR7WmQkn0p+0rVoN
 Qq+8h3xIrzZ07mi/di9fDQ==;
Received: from [87.69.77.57] (port=2234 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1oZccM-0000dt-Nb; Sat, 17 Sep 2022 14:32:43 -0400
Date: Sat, 17 Sep 2022 21:32:42 +0300
Message-Id: <831qs926np.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
In-Reply-To: <87o7vdg97w.fsf@HIDDEN> (message from Philip Kaludercic on
 Sat, 17 Sep 2022 18:13:39 +0000)
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN> <87o7vdg97w.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: larsi@HIDDEN, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: 57639 <at> debbugs.gnu.org
> From: Philip Kaludercic <philipk@HIDDEN>
> Date: Sat, 17 Sep 2022 18:13:39 +0000
> 
> +@findex theme-choose-variant
> +  Some themes have variants (most often these are light and dark
> +pairs).  You can switch between these by typing @kbd{M-x
> +theme-choose-variant}.  Note that this only works if only one theme is
> +active.  If a theme has only one alternative, it will toggle
> +automatically.  If there are more of them, it will query which one to
> +use.

This description is confusing, I needed to read it several times
before I understood what you were trying to say.  The main problem is
that the "Note" sentence doesn't belong, and it interrupts the logic
of the description.  Here's my suggestion for saying it more clearly:

  Some themes have variants (most often just two: light and dark).
  You can switch to another variant with @kbd{M-x
  theme-choose-variant}.  If the currently active theme has only one
  other variant, it will be selected; if there are more variants, the
  command will prompt you which one to switch to.

  Note that @code{theme-choose-variant} only works if a single theme
  is active.

(Btw, what happens if more than one theme is active and the user
invokes theme-choose-variant? should this be described?)

> +Themes*} buffer.  The remaining arguments @var{properties} is used
> +pass a property list with theme attributes.                ^^^^^^^

"are used", in plural.

> +  :brightness 'light

Should we use :background-mode instead of :brightness, for consistency
with frame-background-mode?

> +(defun theme-choose-variant (&optional no-confirm no-enable)
> +  "Toggle the current active theme by enabling its dual pair.

"Toggle ... by enabling"?  "Dual pair"?  Can this sentence be
rephrased to be more clear?

> +The current theme will be immediately disabled before the dual
> +theme has been enabled.

Likewise here: "dual theme" doesn't explain itself, and seems to be
inaccurate, given the description in the manual.

>                          If THEME is not active an error will be
> +raised.

Passive tense alert!

>           If theme is nil For NO-CONFIRM and NO-ENABLE, see
> +`load-theme'."

Something's missing here or wrong with the punctuation?

> +   ((length> custom-enabled-themes 1)
> +    (user-error "More than one theme active, cannot unambiguously toggle")))

Wouldn't it be better to prompt for the theme in this case?

> +  (let* ((theme (car custom-enabled-themes))
> +         (family (plist-get (get theme 'theme-properties) :family)))
> +    (unless family
> +      (error "`%s' is not part of a family" theme))

"Family"? this terminology was never mentioned in the manual or the
doc string.  How about

  Theme `%s' does not have any variants

instead?

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 17 Sep 2022 18:13:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 17 14:13:56 2022
Received: from localhost ([127.0.0.1]:47169 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oZcK8-0000CZ-F4
	for submit <at> debbugs.gnu.org; Sat, 17 Sep 2022 14:13:55 -0400
Received: from mout02.posteo.de ([185.67.36.66]:33317)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oZcK6-0000CI-4b
 for 57639 <at> debbugs.gnu.org; Sat, 17 Sep 2022 14:13:51 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 7B5D3240101
 for <57639 <at> debbugs.gnu.org>; Sat, 17 Sep 2022 20:13:43 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1663438423; bh=3B5N/ulLehB4AuP8PZNEL2xToEuA1fI/PEHFCH7cuhI=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=esEOon9JbUzwuZ3s1R8QFdvtoUOj/K/cO6pogS1ODhj5xKG3ZjcEh9AKJdU8cF455
 HU3DG+2lDTzBVZn+8tx9wgVMts0vBiqfgfxggPqLh0SgF84r70+ibwUZFakv8TDTwc
 l5ETQ/n/SUUT5XbdkcjBbfjPKAeF09lghMjASRzFdpTc22dPly/R5fyO+Gq8B8yw8V
 pS19YiwtF7xMeRT2xT2rFgVGvMDBIeBeS7TnSHeINSFmIlOabwBsO46iL6rKPF4DBV
 XHSfSqlp2Ub/EU70iXPjsL4L38LwT6kWqRLxlPzo7Sw3AgGqqELFURXTXpXDJg91Hr
 xsQ7D0/6z2Akg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MVJwQ68rLz6tmP;
 Sat, 17 Sep 2022 20:13:40 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <874jxa6kyj.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Wed,
 14 Sep 2022 17:21:08 +0200")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
 <874jxa6kyj.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Sat, 17 Sep 2022 18:13:39 +0000
Message-ID: <87o7vdg97w.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>> That was my question, should variants serve as the foundation for
>> tagging or is tagging an alternative for variants?
>
> I think feature tagging should be the basis here, because then we can
> use that tagging in several contexts (which we can't with variants).

Ok, I've updated the patch:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=0001-Tag-themes-with-properties.patch

From 0b346c567ffc0bd130b8c4157a9654134055f0e5 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@HIDDEN>
Date: Sat, 17 Sep 2022 20:11:42 +0200
Subject: [PATCH] Tag themes with properties

* doc/emacs/custom.texi (Custom Themes): Document 'theme-choose-variant'.
* doc/lispref/customize.texi (Custom Themes): Document the new
optional argument to 'deftheme'.
* etc/themes/leuven-dark-theme.el (leuven-dark): Add properties.
* etc/themes/leuven-theme.el (leuven): Add properties.
* etc/themes/tango-dark-theme.el (tango-dark): Add properties.
* etc/themes/tango-theme.el (tango): Add properties.
* etc/themes/tsdh-dark-theme.el (tsdh-dark): Add properties.
* etc/themes/tsdh-light-theme.el (tsdh-light): Add properties.
* lisp/custom.el (deftheme): Allow for optional arguments to set the
property list.
(custom-declare-theme): Accept the same optional arguments as 'deftheme'.
(theme-list-variants): Add new function.
(theme-choose-variant): Add new command for switching between members
of a theme family.
(toggle-theme): Add an alias for 'theme-choose-variant'.
---
 doc/emacs/custom.texi           |  8 +++++
 doc/lispref/customize.texi      |  5 +--
 etc/themes/leuven-dark-theme.el |  6 ++--
 etc/themes/leuven-theme.el      |  6 ++--
 etc/themes/tango-dark-theme.el  |  4 ++-
 etc/themes/tango-theme.el       |  4 ++-
 etc/themes/tsdh-dark-theme.el   |  4 ++-
 etc/themes/tsdh-light-theme.el  |  4 ++-
 lisp/custom.el                  | 61 +++++++++++++++++++++++++++++----
 9 files changed, 86 insertions(+), 16 deletions(-)

diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index ff7ab83190..f86c7e2dd9 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -667,6 +667,14 @@ Custom Themes
 the @file{*Custom Themes*} buffer; or type @kbd{M-x describe-theme}
 anywhere in Emacs and enter the theme name.
 
+@findex theme-choose-variant
+  Some themes have variants (most often these are light and dark
+pairs).  You can switch between these by typing @kbd{M-x
+theme-choose-variant}.  Note that this only works if only one theme is
+active.  If a theme has only one alternative, it will toggle
+automatically.  If there are more of them, it will query which one to
+use.
+
 @node Creating Custom Themes
 @subsection Creating Custom Themes
 @cindex custom themes, creating
diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi
index 6ba35cffff..7a8b62a85b 100644
--- a/doc/lispref/customize.texi
+++ b/doc/lispref/customize.texi
@@ -1428,12 +1428,13 @@ Custom Themes
 be a call to @code{deftheme}, and the last form should be a call to
 @code{provide-theme}.
 
-@defmac deftheme theme &optional doc
+@defmac deftheme theme &optional doc &rest properties
 This macro declares @var{theme} (a symbol) as the name of a Custom
 theme.  The optional argument @var{doc} should be a string describing
 the theme; this is the description shown when the user invokes the
 @code{describe-theme} command or types @kbd{?} in the @samp{*Custom
-Themes*} buffer.
+Themes*} buffer.  The remaining arguments @var{properties} is used
+pass a property list with theme attributes.
 
 Two special theme names are disallowed (using them causes an error):
 @code{user} is a dummy theme that stores the user's direct
diff --git a/etc/themes/leuven-dark-theme.el b/etc/themes/leuven-dark-theme.el
index 0e162c8bab..91432326de 100644
--- a/etc/themes/leuven-dark-theme.el
+++ b/etc/themes/leuven-dark-theme.el
@@ -5,7 +5,7 @@
 ;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")>
 ;; Contributor: Thibault Polge <(concat "thibault" at-sign "thb.lt")>
 ;; URL: https://github.com/fniessen/emacs-leuven-dark-theme
-;; Version: 20220202.1126
+;; Version: 20220917.1823
 ;; Keywords: color theme
 
 ;; This file is part of GNU Emacs.
@@ -97,7 +97,9 @@ leuven-dark
   "Face colors with a light background.
 Basic, Font Lock, Isearch, Gnus, Message, Org mode, Diff, Ediff,
 Flyspell, Semantic, and Ansi-Color faces are included -- and much
-more...")
+more..."
+  :brightness 'dark
+  :family 'leuven)
 
 (let ((class '((class color) (min-colors 89)))
 
diff --git a/etc/themes/leuven-theme.el b/etc/themes/leuven-theme.el
index d9a8d5391a..264a455518 100644
--- a/etc/themes/leuven-theme.el
+++ b/etc/themes/leuven-theme.el
@@ -4,7 +4,7 @@
 
 ;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")>
 ;; URL: https://github.com/fniessen/emacs-leuven-theme
-;; Version: 20200513.1928
+;; Version: 20220917.1825
 ;; Keywords: color theme
 
 ;; This file is part of GNU Emacs.
@@ -78,7 +78,9 @@ leuven
   "Face colors with a light background.
 Basic, Font Lock, Isearch, Gnus, Message, Org mode, Diff, Ediff,
 Flyspell, Semantic, and Ansi-Color faces are included -- and much
-more...")
+more..."
+  :brightness 'light
+  :family 'leuven)
 
 (let ((class '((class color) (min-colors 89)))
 
diff --git a/etc/themes/tango-dark-theme.el b/etc/themes/tango-dark-theme.el
index ef00d2ac49..1e342aa946 100644
--- a/etc/themes/tango-dark-theme.el
+++ b/etc/themes/tango-dark-theme.el
@@ -30,7 +30,9 @@
 (deftheme tango-dark
   "Face colors using the Tango palette (dark background).
 Basic, Font Lock, Isearch, Gnus, Message, Ediff, Flyspell,
-Semantic, and Ansi-Color faces are included.")
+Semantic, and Ansi-Color faces are included."
+  :brightness 'dark
+  :family 'tango)
 
 (let ((class '((class color) (min-colors 89)))
       ;; Tango palette colors.
diff --git a/etc/themes/tango-theme.el b/etc/themes/tango-theme.el
index ecbbf03753..8c3d1298e5 100644
--- a/etc/themes/tango-theme.el
+++ b/etc/themes/tango-theme.el
@@ -30,7 +30,9 @@
 (deftheme tango
   "Face colors using the Tango palette (light background).
 Basic, Font Lock, Isearch, Gnus, Message, Ediff, Flyspell,
-Semantic, and Ansi-Color faces are included.")
+Semantic, and Ansi-Color faces are included."
+  :brightness 'light
+  :family 'tango)
 
 (let ((class '((class color) (min-colors 89)))
       ;; Tango palette colors.
diff --git a/etc/themes/tsdh-dark-theme.el b/etc/themes/tsdh-dark-theme.el
index a88ad75520..cfcad356a3 100644
--- a/etc/themes/tsdh-dark-theme.el
+++ b/etc/themes/tsdh-dark-theme.el
@@ -20,7 +20,9 @@
 ;;; Code:
 
 (deftheme tsdh-dark
-  "A dark theme used and created by Tassilo Horn.")
+  "A dark theme used and created by Tassilo Horn."
+  :brightness 'dark
+  :family 'tsdh)
 
 (custom-theme-set-faces
  'tsdh-dark
diff --git a/etc/themes/tsdh-light-theme.el b/etc/themes/tsdh-light-theme.el
index d9d09b702b..295f56a8b9 100644
--- a/etc/themes/tsdh-light-theme.el
+++ b/etc/themes/tsdh-light-theme.el
@@ -21,7 +21,9 @@
 
 (deftheme tsdh-light
   "A light Emacs theme.
-Used and created by Tassilo Horn.")
+Used and created by Tassilo Horn."
+  :brightness 'light
+  :family 'tsdh)
 
 (custom-theme-set-faces
  'tsdh-light
diff --git a/lisp/custom.el b/lisp/custom.el
index 352b5b0e16..2982573b7d 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -1152,9 +1152,11 @@ custom--sort-vars-1
 ;;   (provide-theme 'THEME)
 
 
-(defmacro deftheme (theme &optional doc)
+(defmacro deftheme (theme &optional doc &rest properties)
   "Declare THEME to be a Custom theme.
 The optional argument DOC is a doc string describing the theme.
+PROPERTIES are interpreted as a property list that will be stored
+in the `theme-properties' property for THEME.
 
 Any theme `foo' should be defined in a file called `foo-theme.el';
 see `custom-make-theme-feature' for more information."
@@ -1164,18 +1166,25 @@ deftheme
     ;; It is better not to use backquote in this file,
     ;; because that makes a bootstrapping problem
     ;; if you need to recompile all the Lisp files using interpreted code.
-    (list 'custom-declare-theme (list 'quote theme) (list 'quote feature) doc)))
+    (list 'custom-declare-theme (list 'quote theme) (list 'quote feature) doc
+          (cons 'list properties))))
 
-(defun custom-declare-theme (theme feature &optional doc)
+(defun custom-declare-theme (theme feature &optional doc properties)
   "Like `deftheme', but THEME is evaluated as a normal argument.
-FEATURE is the feature this theme provides.  Normally, this is a symbol
-created from THEME by `custom-make-theme-feature'."
+FEATURE is the feature this theme provides.  Normally, this is a
+symbol created from THEME by `custom-make-theme-feature'.  The
+optional argument DOC may contain the documentation for THEME.
+The optional argument PROPERTIES may contain a property list of
+attributes associated with THEME."
   (unless (custom-theme-name-valid-p theme)
     (error "Custom theme cannot be named %S" theme))
   (unless (memq theme custom-known-themes)
     (push theme custom-known-themes))
   (put theme 'theme-feature feature)
-  (when doc (put theme 'theme-documentation doc)))
+  (when doc
+    (put theme 'theme-documentation doc))
+  (when properties
+    (put theme 'theme-properties properties)))
 
 (defun custom-make-theme-feature (theme)
   "Given a symbol THEME, create a new symbol by appending \"-theme\".
@@ -1372,6 +1381,46 @@ load-theme
     (enable-theme theme))
   t)
 
+(defun theme-list-variants (theme &rest list)
+  "Return a list of theme variants for THEME.
+If the optional argument LIST is not given, "
+  (let* ((properties (get theme 'theme-properties))
+         (family (plist-get properties :family)))
+    (seq-filter
+     (lambda (variant)
+       (and (eq (plist-get (get variant 'theme-properties) :family)
+                family)
+            (not (eq variant theme))))
+     (or list (custom-available-themes)))))
+
+(defun theme-choose-variant (&optional no-confirm no-enable)
+  "Toggle the current active theme by enabling its dual pair.
+The current theme will be immediately disabled before the dual
+theme has been enabled.  If THEME is not active an error will be
+raised.  If theme is nil For NO-CONFIRM and NO-ENABLE, see
+`load-theme'."
+  (interactive)
+  (cond
+   ((length= custom-enabled-themes 0)
+    (user-error "No theme is active, cannot toggle"))
+   ((length> custom-enabled-themes 1)
+    (user-error "More than one theme active, cannot unambiguously toggle")))
+  (let* ((theme (car custom-enabled-themes))
+         (family (plist-get (get theme 'theme-properties) :family)))
+    (unless family
+      (error "`%s' is not part of a family" theme))
+    (let* ((variants (theme-list-variants theme))
+           (choice (cond
+                    ((null variants)
+                     (error "`%s' has no variants" theme))
+                    ((length= variants 1)
+                     (car variants))
+                    ((intern (completing-read "Load custom theme: " variants))))))
+      (disable-theme theme)
+      (load-theme choice no-confirm no-enable))))
+
+(defalias 'toggle-theme #'theme-choose-variant)
+
 (defun custom-theme-load-confirm (hash)
   "Query the user about loading a Custom theme that may not be safe.
 The theme should be in the current buffer.  If the user agrees,
-- 
2.37.3


--=-=-=
Content-Type: text/plain


The only issue with this approach is that the properties are set using
`deftheme', and are therefore not visible before the theme has been
loaded.  Do you (or anyone else) have any ideas how this could be
improved?

I guess the dirty way would be to set the symbol property using a manual
`put' call and autoload it.

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 14 Sep 2022 15:21:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 14 11:21:34 2022
Received: from localhost ([127.0.0.1]:55804 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oYUCX-00015A-GA
	for submit <at> debbugs.gnu.org; Wed, 14 Sep 2022 11:21:34 -0400
Received: from quimby.gnus.org ([95.216.78.240]:50778)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oYUCV-00014t-83
 for 57639 <at> debbugs.gnu.org; Wed, 14 Sep 2022 11:21:19 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=tP956YPOyyw3J20z72N3k/dbOkR8XawAQjOnbZ//akU=; b=Xs8cgjOohxNa9iXqBewKvpYelF
 OvDJB5teEfYTenijhyEj1jRHsGIYPULBtrvx5hBHPDghibJKmFmwm7eM2MOsr0RfDBUHh077/sMgY
 6tNoPIMw6GX8HY65d8a6sXHr35UxiqE+zyJ26ykDPTNUAk57W3cdxjXb+HFsqWFiE8XA=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oYUCN-0007mv-36; Wed, 14 Sep 2022 17:21:13 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <87bkriyqci.fsf@HIDDEN> (Philip Kaludercic's message of "Wed, 
 14 Sep 2022 14:37:17 +0000")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN> <87bkriyqci.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEVXCCuhExf7LAHx
 EQX///+EbqWtAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+YJDg8IKWAxEiQAAAG0SURBVDjLjZSNkeMw
 CIWF3YCQGlhQA0b039s+kOxk93I3p5mMHL4Ajx+nlEL66ZR/AseZOubAB1/mwJUAT+P/Qg2eCZhv
 g6+7cgswmvSWZpwEiB5AGly3HSIS6A3iqz+kLA/txnekkeQqrXQjlT7SIWvwKUc4EQO0mfYNB3QC
 VBrc+YvCjrrh4qXVGR5CVK9rRhKY4XIS6jgN4Kr1arqSq9tZ+IhQ8GC2NiKRukSymckF+REcOifA
 Zd36bCu5IT6MI4AwtNxAfwB7AdnAlwdOixwjOpI5llz0wTXk6upgqNKkTfagVOW4+ghjxJsd4l8A
 sbLpYNL7A6hCZQ4QTJhvYJWJjzV2atGBDfjLiM4lgg7U+4AhHaHCPtE4LqGqxA9tyBq5K9VWMkfJ
 DcPZu0AYD9q+PaB8rzBk2ZhPqMywt+re3eXh0n4vdbmfPd8C9fEGxBs6spqyurkBl3psufnaPMDJ
 yDG6t/XddZAXrp0+gRNrXP8ERU4UXHesN+A6bRljSfjVK4z8wj4F6OaxcA9wqxZOhnWd8gPYxXlh
 MVnfAS8P3NLnW69QcI8b3Vx/AEU/nb+Cb7VUjESWM2HrAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIy
 LTA5LTE0VDE1OjA4OjQxKzAwOjAwHtKitAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wOS0xNFQx
 NTowODo0MSswMDowMG+PGggAAAAASUVORK5CYII=
X-Now-Playing: Don Cherry's New Researches featuring =?utf-8?Q?Nan=C3=A1?=
 Vasconcelos's
 _Organic Music Theatre Festival de Chateauvallon 1972 (1)_: "Resa"
Date: Wed, 14 Sep 2022 17:21:08 +0200
Message-ID: <874jxa6kyj.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Philip Kaludercic <philipk@HIDDEN> writes: > That was
 my question,
 should variants serve as the foundation for > tagging or is tagging
 an alternative for variants? I think feature tagging should be the basis
 here, because then we can use that tagging in several contexts (which we can't
 with variants). 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Philip Kaludercic <philipk@HIDDEN> writes:

> That was my question, should variants serve as the foundation for
> tagging or is tagging an alternative for variants?

I think feature tagging should be the basis here, because then we can
use that tagging in several contexts (which we can't with variants).





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 14 Sep 2022 14:37:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 14 10:37:30 2022
Received: from localhost ([127.0.0.1]:55725 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oYTW5-0003z4-Ve
	for submit <at> debbugs.gnu.org; Wed, 14 Sep 2022 10:37:30 -0400
Received: from mout02.posteo.de ([185.67.36.66]:52459)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oYTW3-0003yj-68
 for 57639 <at> debbugs.gnu.org; Wed, 14 Sep 2022 10:37:28 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 44AD8240101
 for <57639 <at> debbugs.gnu.org>; Wed, 14 Sep 2022 16:37:20 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1663166241; bh=rMbg1j46A6RDK2n88iaistTahMcjRN3R80qUMlPRGAE=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=lvUKNGpXcIjCsFCrER1ejfYULQP2mBDPLsNCtum5LwslOYN2JUobAw9dzDe6kefah
 +KocoQAyvyvCrTfSswyc3tDb3DibBzpPPIXAx4gpAVe9SYbmPxIeIg46zQ6rnjtcpM
 8x3ehVXxeUF79jbxIbxqT5s9O47pTNvYtFz8WaKsfwdjY0lLIAG9WDPUsgmJwFDAkQ
 rWHdJsClZGdFwKNgz3LA37SUQ+qo4N7AETXBZuiPqj+d/DgqmCmdDQ0Y6DSjgxMs8q
 ETc8cRYLaRAJTPqdg03gpWVDIS9FM232Zh7S/u7w1tTT+GcKpNDqaiiqxs3bX7s4CA
 0d+JA12kZW0iw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MSNG83Mc9z6tmq;
 Wed, 14 Sep 2022 16:37:17 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <877d269kgv.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Wed,
 14 Sep 2022 15:03:28 +0200")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
 <877d269kgv.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Wed, 14 Sep 2022 14:37:17 +0000
Message-ID: <87bkriyqci.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>>> Here is an updated version:
>>
>> Any comments on the updated patch?  Is it OK to push it in the current
>> state or is something missing?
>
> Well, the current state is with "variants" like
>
> +(put 'tango 'theme-variants 'tango-dark) ;see `toggle-theme'
>
> while I wanted to see tagging themes with features instead?

That was my question, should variants serve as the foundation for
tagging or is tagging an alternative for variants?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 14 Sep 2022 13:03:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 14 09:03:42 2022
Received: from localhost ([127.0.0.1]:54111 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oYS3J-00035B-RS
	for submit <at> debbugs.gnu.org; Wed, 14 Sep 2022 09:03:42 -0400
Received: from quimby.gnus.org ([95.216.78.240]:48730)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oYS3H-00034y-Rd
 for 57639 <at> debbugs.gnu.org; Wed, 14 Sep 2022 09:03:40 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=9Z5bykXnC5AmBzeXR7LH0NPhAaD9+0PMS9cG81ivr74=; b=XLUtJrPzqYsBQ3/ByGtHC3EMAD
 ylSFl8RpDcVvYlY+bO/0FhQAVM+EUSDcbtwJtG4KUsbi9uyODXs9JSFg4wubWVGU8Tf0YguIO/SRI
 JN9e8TnTGS/70OdjOd/ka1EewcJu7T+xOZAXaGwQPLljt/XU/s7ixVy27YdAie8Flk24=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oYS38-0006ex-VJ; Wed, 14 Sep 2022 15:03:33 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <87k066yyn0.fsf@HIDDEN> (Philip Kaludercic's message of "Wed, 
 14 Sep 2022 11:38:11 +0000")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <87k066yyn0.fsf@HIDDEN>
X-Now-Playing: Joan as Police Woman's _Joanthology (3)_: "Human Condition
 (Live at the BBC)"
Date: Wed, 14 Sep 2022 15:03:28 +0200
Message-ID: <877d269kgv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Philip Kaludercic <philipk@HIDDEN> writes: >> Here is
 an updated version: > > Any comments on the updated patch? Is it OK to push
 it in the current > state or is something missing? Well, the current state
 is with "variants" like 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

>> Here is an updated version:
>
> Any comments on the updated patch?  Is it OK to push it in the current
> state or is something missing?

Well, the current state is with "variants" like

+(put 'tango 'theme-variants 'tango-dark) ;see `toggle-theme'

while I wanted to see tagging themes with features instead?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 14 Sep 2022 11:38:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 14 07:38:32 2022
Received: from localhost ([127.0.0.1]:53965 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oYQit-000704-UC
	for submit <at> debbugs.gnu.org; Wed, 14 Sep 2022 07:38:32 -0400
Received: from mout02.posteo.de ([185.67.36.66]:40141)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oYQir-0006zq-8Q
 for 57639 <at> debbugs.gnu.org; Wed, 14 Sep 2022 07:38:30 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 1CC5B240101
 for <57639 <at> debbugs.gnu.org>; Wed, 14 Sep 2022 13:38:22 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1663155503; bh=zhoSa9RmFt6YROPKF8P5knUY15/OSW+FfQcOyOC+G9Y=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=myZJNNsbIxgAWd3DiBtIvT0Tf1Yrg7ikyiV4rpRLV3dSuVrx/FcpGGElTb2EaAlvs
 N2H7hYmLS0fUNocJn28fBLxY9qTA7bTDi+sNeQmr9Zmjdas1gJI9Hl5HmHbAk3bln7
 r5UOQUhNtoB//A0FcBQ/S2NZiW8HqntrHr5zgIiEoW2xDYvOiwK/q4r7v2GgF/Svp8
 DUj19147WsvfncWiC3H/hMjRG3suOwUiqnRYRbhv6k+4kwDPKb3MLqdZSLcRj3tGi3
 tWJGVcWt5HGblpQ4V2kCkd63RTIfWZNgCrr3pMCEp3PcVdikhS/GAIX9TpuamMAxTw
 HcG/R9zSXHLaQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MSJHf2QZRz9rxH;
 Wed, 14 Sep 2022 13:38:19 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <8735cxpx2r.fsf@HIDDEN> (Philip Kaludercic's message of "Sun, 
 11 Sep 2022 20:47:40 +0200")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Wed, 14 Sep 2022 11:38:11 +0000
Message-ID: <87k066yyn0.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

> Here is an updated version:

Any comments on the updated patch?  Is it OK to push it in the current
state or is something missing?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 13 Sep 2022 12:09:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 13 08:09:32 2022
Received: from localhost ([127.0.0.1]:49164 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oY4jL-0005rd-Pu
	for submit <at> debbugs.gnu.org; Tue, 13 Sep 2022 08:09:32 -0400
Received: from sonic316-20.consmr.mail.ne1.yahoo.com ([66.163.187.146]:38956)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1oY4jJ-0005rO-94
 for 57639 <at> debbugs.gnu.org; Tue, 13 Sep 2022 08:09:30 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1663070960; bh=Ifv05VDJS/JaBlRMa7Dy27YQVNpnGpahDS6UP6mcREI=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=TCSBix0AGOek9g62on4v9hytBNfaKFAupw3QttdcWvZMs8WNQqOMJQiK/CRi3iyfvzWTEj4Nzk0Z3pBuVcwqPxWziF4hZiyPUK0Nb7mNri2ZSsCovqPgszZDTSZMBAp6uAWGs4co2bklrHzwSMOHqLu7IEXhyiIYxrGRbrEX+zIBgy1LbSKOokKlaDsiziOfzk0zyBYeEtwCWfWo1cSpdLJwxaS6TpCbGBRhkCyryCUliHZzi435IkrIKL569R0mjBjpvXPAdTXsSF9h9JIGtqTpdEEHwao/SryCr73CbFOauc72Ale+5jLWka4vN/+BDC+SDZSRfgYqvsHgnZc38Q==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1663070960; bh=JkNBL40ceO2/XP6uNP4Ky6NQDXrLREYUm+fUKEcV9WT=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=tjl/XnBTuh68Ta6wki54Zh4GctAi1/YVjbPrifqsWF2r82BSlhOhCGR/zAPG1WVXsyqesCfGIKa+nIKgHrYBM1zkODI59AB3nwnu8hJdteHq7qxD8v+GDrfo+BBp2NiF2DK78jfRh9OKPd8HswtYhmFTnBDFJBsLG/CIuUTNbbtysgq86QrOGlO3FCDtOp0zCdIkxAC3qS3OWn4pZ8xPBK1BehOqMCoesKMwH9jN0LygtknwVOwKqYsJfBXnj1TOF6bVRlFeewaoX0HFpaJ5vdisvFYJUUvkSVxfeVDQSDDDgBqu+kWR8pchvVrlflNr09RlvNvGgxPkBtXX6k2b9w==
X-YMail-OSG: Y13ibQsVM1lrmmAom_Ivov0HVlkQcImR96GeVvPR.uxgQDAN4XVGgkCuXTDkbEp
 XLV3pqOLgVsFWu7Esfuw70jHsvRDu35YkjVixR_j1pC5g5HTc7wf2B86wKPiBIU4WAAdIgoS7lCQ
 g0B7PZJdrchH4eZNC2ySE_4eiUfMP6PFxoTfaJwXsa3xjck3ahuSKauZ2iHzlJo1Ts_vHPajN1aH
 KlgyPXKbmHx2ZaGNmeGYvOT_ugAqTROUOyHevZSbMUspP7IwuBkE2f5BKA56mJ4oKx15sgVTMGeC
 xORWXck94vYvrNvVGHc_OYz_r1mDj6u50FI0IkfKVM.Y_qfYmaEc.Ru99viZkdG_G9Zl90kSPhD.
 L9sry2lwI714ujzKNRxe.Ewcp7TvKLrifF7LMmBXCI5w0hPQGhC5PhDdQaa4SSnfeO_rkXhcnMZ0
 mKvsk06UCgUqgtzlDyok5r8KLSmLytJwx3TjKioX0jHEzuvAqBbBopk9o0Bj1y.foZuO.0.600dR
 jZ3mxYCAzGei91N8cgt4KQbcz0MbN4Ix4jqNJk7nWmsuChX_IpgbNpy9l3WSXDqY0n7coX1qIqXc
 qd5JKHp1fveHqKa.n7.gsaSNt8zyATaZQ7zsx85r.0EPjt_V7PtOVxbLsHd7WvL0aKlRZSoHy8aM
 zmJqQuj1L5cStH358AOfrpkhCMRmONl5ZMSWoZMDkTRvLW2cULZyAHJw3s_mJkAwG.DWEQP0NM8G
 _lmiw.Mv7Bq5hwZki70k.vGxBi_9SvK4hp2nwqKhN_tyB6gGftwvOywMsbuU3imZFOGpj6qyiIw2
 nnU6114TNhI3QyZJL5Na91FfQC9JFwpZ1DODq7MyK.2XuvUiHDlyCq4FIkBPmY8j.xkPtwPU4RpM
 wuTYFYVTRWYqh.VjI7tzWcAQhxwjnnEr4l89ZwCZN0rsHIMrc.EuwUzXENl6.01uLb.krAduor1z
 DXNpU.jjgIX8K0WZ7RAaqU3qbWQLghTJ6NHvTQT31lNLPtxcUJVh3CTNqZ1b6of2ZfN_sIcCJrSv
 RpwpcW6nfI._7wj9PNsqJjc9.8HKwyeVEnrlfcdv2m6ijzvNx0J.sqNfj4ROqWz9SXehTdpSVDa7
 .hAQMyxQ5w5gVFCuk.ihoR0MJSph0Hx9UzwRqC1YfvBbb0CLv9WZZAKR.9SO.ARHQjebt.ZUKLat
 mV2jGFyweVfWhNSPr_ClgevlDxeBgKuNzXPwLWu9ic7yDmr66iVHT2UIUdwbRu.2BtoAiRFILs3n
 gNeE9UrAksr7qz6Fsfh1yGVwTMNHZN7FkedhnT.VvkmuJMt6OD2wxZS0QGDykObuqcwHDuz_bAdf
 V8Q8SePyNvLIctnWuvTy_kiw.MaJRxW2Yt6LgwfoLlce2GkSigd77LjZea2cVEYkMZEbZxG9_UpY
 mHAEzcybyZUi6z99OsGPwzb7fE31LdrCZt6K2rEuCJvXE_HJK.1q5QhpYWumHmEhtAI6.2M8Xkca
 aXyQ_0k8qFNpBeSsGvTJ8uQJCD88jJrt1HUYMZYYQxl2k1wzsBIWmlf.qOMMjPiMuemR0cpzfb8A
 LWHKJZIvoNuZJuDJQw7tXrD.hlt5y.Q.yP19BJLcco2rQ3tztkfFvl9DQq6ZVoOer313bXqgGSax
 snqM84yzu_WillybNhBeBGsB9ifOdqiOmOKHu7lt5QjdnZCTa.N70kc.PHsE.Av.x2f2IFl44slc
 FciXGnEBciGyg.EJqvVUlS84gFfXntcTVEGRui9jzJDRtEzojs5fHvAJRuhYrLRuxiLTOBkMvem3
 kizJ54uxAHkY.Y7imdGobeLv7YDfBiuIYKfRRe5THLrE8RIQByGPdtJKiW6w1sPIp5sLdiNgLlNv
 knBwHJ_jlbdenZMOmnKy2SgIo7pTT.PmxK1Jqa0j9w1cti8VI2Wvw6sty1Tc6H9G.ogrTGrBg6q0
 rAk.FC_i.ZeYojl6pHOnl1n0ayNJOfd2FAeN5M98VjxXkLeRXNtLWjVGB8VZVVolJF6MCX4Cz08I
 in6K9cG.8BuBo9N6tD31Ah6dzm.1Ojmt6eIqBbqKmCsMUMO73ZScxEgvBUmG1tXGF1Egb2sUZErU
 Lo8NnA00QwZPAzB9Ydgr22j9yUSfzPZH8AuI97TeOLAC1isinnvXWLsmpGX3fUxy1hLnVL03QH.L
 lDIFEzJvGwnyjM1mo5pzSblMIpr8QnF4IM1IKXi3D6pGUMBfU.oqwkqck4CDkeMcjsxXwHwHCCoe
 JjbLM_6q_rTaL1lVSqcIBoTvbZvN0fKmiFQ2cX8I8qrHgspnNY..N8Jl3bV1RjictcOJFinnovrD
 Ddhh3OY3R480-
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic316.consmr.mail.ne1.yahoo.com with HTTP; Tue, 13 Sep 2022 12:09:20 +0000
Received: by hermes--canary-production-sg3-6bb8946c47-n8gf6 (Yahoo Inc. Hermes
 SMTP Server) with ESMTPA ID d8c099768da25e576c3a26ca60d1850c; 
 Tue, 13 Sep 2022 12:09:14 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Michael Albinus <michael.albinus@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <871qsgc390.fsf@HIDDEN>
 <871qsg4u0b.fsf@HIDDEN> <87v8psmyr9.fsf@HIDDEN>
Date: Tue, 13 Sep 2022 20:09:08 +0800
In-Reply-To: <87v8psmyr9.fsf@HIDDEN> (Michael Albinus's message of "Mon, 12
 Sep 2022 16:51:54 +0200")
Message-ID: <87h71b1nob.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.20612
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 201
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57639
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, Philip Kaludercic <philipk@HIDDEN>,
 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Michael Albinus <michael.albinus@HIDDEN> writes:

> And if I understand
> <https://github.com/flatpak/xdg-desktop-portal/blob/main/README.md>,
> this is not restricted to GTK only.

Indeed, it is not.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 13 Sep 2022 11:10:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 13 07:10:31 2022
Received: from localhost ([127.0.0.1]:49023 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oY3oF-0008O5-Iq
	for submit <at> debbugs.gnu.org; Tue, 13 Sep 2022 07:10:31 -0400
Received: from quimby.gnus.org ([95.216.78.240]:35180)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oY3oC-0008Nl-PB
 for 57639 <at> debbugs.gnu.org; Tue, 13 Sep 2022 07:10:30 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=afTCM78XxFnkoNyl7387jKf7G2yGOqyXUXtrZsaqBwo=; b=odKLblhlfPajuX7LuCsLQLpHI+
 gQ+z+NmviVJCMcdWxpsmKXNIR8cjq0hmy6SQCAt28gXpaWN7BtSdpd9Fc8UVxQQTtF02PJZIZa0Jl
 5YYp5Uwu9oOLtTSUkw9tYkDXDI+z5ixxGsNO9sIg5yEjBARYGC7X0Lglk9/o9wZdIucY=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oY3o3-0001zV-Hs; Tue, 13 Sep 2022 13:10:22 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <871qsg4u0b.fsf@HIDDEN> (Po Lu's message of "Mon, 12 Sep 2022
 21:11:48 +0800")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <871qsgc390.fsf@HIDDEN>
 <871qsg4u0b.fsf@HIDDEN>
X-Now-Playing: Laurel Halo's _Quarantine_: "Thaw"
Date: Tue, 13 Sep 2022 13:10:19 +0200
Message-ID: <871qsf5y3o.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Po Lu <luangruo@HIDDEN> writes: > However, that has been
 superseeded by a dbus based interface in recent > versions of GNOME. I do
 not understand the details, but it seems like > it could be implemented in
 Lisp: > > https://flatpak. [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: Philip Kaludercic <philipk@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Po Lu <luangruo@HIDDEN> writes:

> However, that has been superseeded by a dbus based interface in recent
> versions of GNOME.  I do not understand the details, but it seems like
> it could be implemented in Lisp:
>
>   https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings

Yeah, doing this via dbus is probably the best solution for GNU/Linux.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 13 Sep 2022 02:26:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 12 22:26:05 2022
Received: from localhost ([127.0.0.1]:48393 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXvcj-0002sy-M4
	for submit <at> debbugs.gnu.org; Mon, 12 Sep 2022 22:26:05 -0400
Received: from sonic314-22.consmr.mail.ne1.yahoo.com ([66.163.189.148]:35157)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1oXvcf-0002sS-U8
 for 57639 <at> debbugs.gnu.org; Mon, 12 Sep 2022 22:26:04 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1663035954; bh=m/pX5xIbXouRqz9blMRhJmh2X2SCnoLdqe2yzwRMuS4=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=Sdub+nd0iUOcmzPUi/lv9GEqlzBbbTvIkHZhh4lQN4XOpJ/w+jdxLcxhr1Z/U+KNj297wZGUkH7Zct8fEqMmS79g0mnNtYxTSaLhGkD6Moa68ZWJW8UHQE6Ct+BkGW3cJRMvJMiHWAv1/8rk8zkH4wyTqAs3nkW8d8VSYOwPkTDq3xXZ1zNBhaN8fnLQJDBaPDRTa8lDcjgfyycRtrk1kRAjz89bj5Tur14HQHIv9KXYsV/sM+vjtQa0mCaRYexcF7vRhPjsZPjP1frMOOVI8ebsMx6ryZrGsYFAUBpE3M64RMW5xZzfE1weLXjFux0sCdhyzB6OUQteGp00wXDEig==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1663035954; bh=WAlrTlRKa7QVMZnBbpiZx7PDeSLwYgrc5/st0jhJ50m=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=lS9S9MsyLOPtcib4Bq0EdofdyjH+J+iCNrkLqMPJ6Zorzpnqc1kTHLI73gpl//EjOozRNSXS5n0NIijaPeQRsoKh2lBEGSOk0jggq9XsOueO/Itogo15YnnRfE4EKZAcu7sp3pZVcNuqTz/yzNECfqCrt5SQCl8QhHxewAn3dVtO4tttcTNrw7mGcXjEfSOq1teLc0CfPEnfv1HfNi6OZUwj8sEpleuXknYszT4sN/XAYc/CVxYVmBbBvZ2RtRVY5YX6eCyPTKY9OFOOmkSqyFwgoyNJSRNAkelLpMvWgJZPpuKJRWO+9GPm8AR0vkwWAH5HiGIqXKRaE0KAlRLlBw==
X-YMail-OSG: PU.l60QVM1lK2Mm9bblCC__3iHuK1VOGCKuHUOCROdwjwdtD1KHqCJ6kb2YAItD
 Ey8TGbcR7g0GY.2iLmQGTEgbqLkc29RuaY7gTISH8.IYqRdwUA3GdivFYHM.QUWSlbVCdZ61xqmd
 tYIhnt1GvBL8ozcZvWXOFOXyTvkfA99NZyr1EuxxxCifbnvihGbGgzGmGHhDK0C0YoOWXWLRpApY
 55Cpn0OZaglX85_frjuV5aJFp_bCzP2f_vriV6iQn5PTYlSgR7UUb81iskzaShpHxiwlF9PAWe3C
 W64IEArNkHjbw.5CBdKUMpEzoq4CwS6IStii3oJ1NL36Gex7D78xrLwRI0JsX0KartjKqgx4AAMV
 5cdXwUzfX6hkqvnwssd9MHB.WNik_oETSWtSYlTb_LheQOM1QyJK98WTPUodwhX4xcdOx7nxJh50
 CB6ysBwgw2kuV4YGxq5k_kbbtW.oWdzq9hYsFeGHnRl5bHHKs7ZMxuZUPxTKxKGLPlQ903tGDfqq
 uRjnfEnJT5HKgEHRY1ecljAZSVXLX9Av2MU86JNWdkW_WGcs9jF9XOJQZOVwXROvLlESxkcuwtD5
 mD8hCMgdzV5ZPlR766NgISfnxU0HVfMFF7jbH1O3ipZmW5IQ3CXqbGNFrKFmwv2ruJrk3s4lsRI7
 2lSo.Zybl20w7SJAe6kAS0jh87gx4W0oWT6BZWaSuC5OTS3QnRHqBE7aZoBF8PjllftMN1zDIKqa
 jWRkWzmxKmpe3sd6R4X0n9Siyt1Em8ipK.a_hPOU4lrojEg.li7DFhCdJWdH.zZBoI0Hl4JS57W7
 2S87D12UwRhiTNHOOxNyMXVkusoEznchEL1TDl5tBDT9bbTbWA.QEAk7bxKYk9qXvRbKiOKvx224
 NtxpgmsOG4VcbqBBiRoR7YXVpMYAfnB5uADJFhV28tdffGCtLIeQvcRA7Yqqtp8emEx4S1F27Dsz
 9.CdetZWVEpaCHY5xCIGu_dFxQX.b8llTxC9fbCfsk5QIYfD7IzLA4FClY17aqN28OoS1llU5aS_
 oghrrPKdldgqHINYzLdMBFqV9ESa2veAwwYn8Gcyg91e38S_hOd9qDydQj_P96kOfh9IKFej6eQM
 bNJW51SeY.zvCeEJONZ.A3sLspXUsjEsAiKWRiJZU3RBWQwTfEhIDtyAV0xwrA5v3AmitN4xugy.
 LfW.Wxzi9uQXxhHIr1Zl3RhlZJt6L5JndAUE0_EWYmgx0n6QPShAV.RkjSDCNrEzc5RNPyTls4nN
 BBWckraUSIv0k7dgJIoaT6eS1yj8fyMkd8h_U4y_BvjdrCQ96EbCDbiam6GSW.pTZfEmiUssy7RE
 mayQWC_uHGatv6iAJIN9PRLclT1qWm7c0PgpEENA4IiYZGWl3dwbmfXoCjuPnvGlR0JsCXDmeHbs
 LaQkkWeq8RmB5SlijBWChaHz807tP8mCSxH_OzS5lWy236W3XjW2FnGLBLq8GywSgpTlDqGizPTl
 AYVQX7KVK2CseSfc8MQlDRZU6_7e2GXADUufsRGyPH9SNVyfFWzhjJzx5fiMdusmRhtOD6CeRW5t
 PLXciyEFXnQTCRi1cNkvX3sE92uDkPXPg.8Bv7SedvOZyTi5uEb.mXReIGmDo_u57uWG6gOZ3TwM
 NxWsFRYsn5UnW7TYtDU7Jghrpu.cZ7Yw.2z6YwLsQqIOI.USKvzedxbhnxmufVqFH99ugwmnsNyw
 RVDk422pxb5DqQ1TA0wMEuz75aD9BAsetx1SSlN9hCBMhrhHj3jLSUmU1ZHupmOhSEHsZifaJnwn
 jZtHn0i7VFqAqC79iii7293Df5nRk_ED24yjU5JotN.TUQhUkrcZcYBN4Agr8W5vGlpFPTcIIkB1
 L2mClaBox3XuOnHfO.Qo1Q1_Q3bvfgO2Sc_sV8U3x7ai_bBmqqibi4Kty51nzYS8B4QmS0Qv.Oru
 j.HHBHYMp0VdeOZzCu9xLpuxLiAt0_k0qAMeVAISzGMkiams4ngi.rxI30Xy1WrfzlJPyl48UgaH
 n.aFNzjeeO09xl1Jl51.Gb14eSigxMWTRII2zRMriKXLRF_3vmMWP8K.gA_kmCNvhR4HgRAYghQw
 DLrrkaAKwA040ui1vZ9uN4AxW8tZo27CxkOdGjz8fm2Xa9xx8Nr.BZqZemFJWmIcUN9RKZaRxQMM
 Kg5nR8fvYZrmr9gObQSYZXA5GihB3OHolU6Haurqetvt5eeD9SgYbEVV9m3zvvI4_3wPGbX6mpVN
 420wHGAMCYc1TzfQ41IJj.RNj4GJQLc40I9vhGniJsp2Wa.2GYxQgt0XkUXacubnMpwk5CwXZBPi
 VwlQrinIVug--
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic314.consmr.mail.ne1.yahoo.com with HTTP; Tue, 13 Sep 2022 02:25:54 +0000
Received: by hermes--canary-production-sg3-6bb8946c47-vfvlf (Yahoo Inc. Hermes
 SMTP Server) with ESMTPA ID d901c7ddad471e2237ab485c32354f04; 
 Tue, 13 Sep 2022 02:25:51 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <871qsgc390.fsf@HIDDEN>
 <871qsg4u0b.fsf@HIDDEN> <87pmg0pqam.fsf@HIDDEN>
Date: Tue, 13 Sep 2022 10:25:45 +0800
In-Reply-To: <87pmg0pqam.fsf@HIDDEN> (Philip Kaludercic's message of "Mon, 
 12 Sep 2022 15:26:25 +0000")
Message-ID: <87o7vk2eom.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.20612
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 536
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57639
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Philip Kaludercic <philipk@HIDDEN> writes:

> For now it is just detecting that a switch should be made.

Right... that's easier than trying to determine if a theme is dark or
light, but is still currently a mess on the X desktop.

> Would this have to be re-implemented for most desktop environments, or
> do most of them use DBus to signal these changes?

Recent releases of KDE and GNOME do.  I know nothing about the others,
but they probably do not provide a way to toggle between "dark" and
"light" themes in the first place.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 12 Sep 2022 15:26:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 12 11:26:38 2022
Received: from localhost ([127.0.0.1]:47600 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXlKY-000299-1n
	for submit <at> debbugs.gnu.org; Mon, 12 Sep 2022 11:26:38 -0400
Received: from mout01.posteo.de ([185.67.36.65]:35089)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oXlKV-00028x-SP
 for 57639 <at> debbugs.gnu.org; Mon, 12 Sep 2022 11:26:37 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 7CA88240026
 for <57639 <at> debbugs.gnu.org>; Mon, 12 Sep 2022 17:26:28 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1662996389; bh=WosNo/hf8eJ4XDukylnSV0p6I5fQl8SMikVE/xbDxtc=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=UVr6qVhLaplQ4ydgxoSUP5qOCG7esXp8vClgqW/jSrCjUHXZzbwxgzEvlOHlZZrH6
 8jTe+VCTwWiwmKYqu9WEOi8lVPPMgFjIYiszq6lw+7vzgu1oWnfrAMYQ/BNRT9UrNs
 x+b4WBnP1Kc0zZxQFSuhwdqylyJ3Um6+OuulNpAq311l33KCu9K+911PT/QWNkefSe
 gOlBMxZl9VSk6tLru7FwzmhLhXYGYkr/yRzYr3SFOG3smpha/Ly1BPImedw9REsJTS
 VpLybtU/25+JpzCaHVImpmFoCFxaLTAtQq7JnQ1Bi3ROtHOPUsLfWIBXBXCpkUxbg7
 59LDKKOWkduwA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MR9Rl4fTxz9rxK;
 Mon, 12 Sep 2022 17:26:26 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Po Lu <luangruo@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <871qsg4u0b.fsf@HIDDEN> (Po Lu's message of "Mon, 12 Sep 2022
 21:11:48 +0800")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <871qsgc390.fsf@HIDDEN>
 <871qsg4u0b.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Mon, 12 Sep 2022 15:26:25 +0000
Message-ID: <87pmg0pqam.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: Lars Ingebrigtsen <larsi@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Po Lu <luangruo@HIDDEN> writes:

> Lars Ingebrigtsen <larsi@HIDDEN> writes:
>
>> Philip Kaludercic <philipk@HIDDEN> writes:
>>
>>>> I thought we already had support for this under Gtk?  But I may be
>>>> misremembering.
>>>
>>> Am I reading it correctly that `style_changed_cb' in gtkutils.c would be
>>> a place to start looking for this functionality?
>>
>> Ah, yes, I think that's the one...  Po Lu probably know more about this;
>> added to the CCs.
>
> What exactly is the wanted feature?
>
> If it's automatically switching between dark and light themes

For now it is just detecting that a switch should be made.

>                                                              , then
> style_changed_cb is probably not the right place.  It's mostly vestigial
> code from when we used to update the region face along with the GTK
> stylesheet.  Instead, TRT used to be to listen for changes to the
> `gtk-application-prefer-dark-theme' property of the GtkSettings object.
>
> However, that has been superseeded by a dbus based interface in recent
> versions of GNOME.  I do not understand the details, but it seems like
> it could be implemented in Lisp:
>
>   https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings

Would this have to be re-implemented for most desktop environments, or
do most of them use DBus to signal these changes?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 12 Sep 2022 14:52:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 12 10:52:11 2022
Received: from localhost ([127.0.0.1]:47569 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXknD-0001GO-9L
	for submit <at> debbugs.gnu.org; Mon, 12 Sep 2022 10:52:11 -0400
Received: from mout.gmx.net ([212.227.15.15]:42485)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael.albinus@HIDDEN>) id 1oXkn9-0001Fo-3L
 for 57639 <at> debbugs.gnu.org; Mon, 12 Sep 2022 10:52:09 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1662994318;
 bh=yVwd85fe0F9Xsa8/9kSPQCq2bC79YshqHx5u72pMvtc=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date;
 b=dV+83GTQhHx4Q6snSu8bzmy1mf/G1ocKbR1wv7vLyEMYXC0k3UvJD7ULhnOG7Yj/3
 Y4lwRJpZxNExgEJyzY3827FzFVEGgH/Rddq/SbhEfsCv8NFOi33HsGDEedlKupmME1
 3ur7WVejuLcVpX97w6NJuv4iT0OL1GxGfzn8Qlrg=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from gandalf.gmx.de ([79.140.119.44]) by mail.gmx.net (mrgmx005
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MPXhA-1okLjL3z1u-00MfCv; Mon, 12
 Sep 2022 16:51:58 +0200
From: Michael Albinus <michael.albinus@HIDDEN>
To: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text
 editors" <bug-gnu-emacs@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <871qsg4u0b.fsf@HIDDEN> (Po Lu via's message of "Mon, 12 Sep
 2022 21:11:48 +0800")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <871qsgc390.fsf@HIDDEN>
 <871qsg4u0b.fsf@HIDDEN>
Date: Mon, 12 Sep 2022 16:51:54 +0200
Message-ID: <87v8psmyr9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:e2WNErgnxVOc3oLKAv0vuEmueLOgQt7YI0wgAZwpQoVhXJCUQ+S
 j/65BVEZbkVsRHgPZxNRsZmssblDHQkpsH9sJb/GLAnsnpDNXFmnt28AbHmBSumK0QzGdVI
 rmMq2pJ9lMKWd80fpAeyLlOk5+XOxn7boZ2jGFyl2n4pHQ5tmWJROacn6Tc3mUz8YNXikQq
 HJGJ8sB0Mtk4nybJn4UsQ==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:/3lYxQj1JSA=:QMEJwRMw+RZ5MwaBqfCqSc
 sleaNbWMawkG7hA1yOmehhtJ3XZPBxnlbnHUPrj8aT7MrmwoQQaroScDNhz0tLEBVs2t1v89N
 Ug4lUHiObQMapQnX5RK7oOP9UkPeRrjtKM58W8vDbzt1C1VwlJEK0orAtAVz1aSziLjocEtzC
 q6NWyf4HD5OsZj43P1M9E6+rtgjb+eYn0TsPPCuMQ/Iub2W1dPosEItlM13uiC5lp8DtEwtJg
 SM86JfZxXJK2p0asQr1sneRmucIWlLxLNJ47ZdikxXW/m2M0+wJA8nU/u/Lg3JyEL/23SgMTa
 zvzIqKmKYhFH3Ge/ikNNh1GHhxaiickXSjUUyOUj+sRb4j5cLUc8J6EFnC3sNU1TpbAcRqiqD
 v0n3/z2dRxszEa06nQBrGRh5TND5YUtwK1hqAsrnx32gxLf5ul1/vzcS7O0bSZkUTw9Oksv5o
 DzZjuxKuQadnI3F6siZiyIOV01S++PnrhGRSN/c5i6+OdVX21m0FQETFAtlX/NLyDDVtJ4j58
 rKRdfYKg9WAC4al0XxNWwCTtktkmurORrbNYQ6GC0AVtyINnY1lcTSGjtsI07PNFyeyWtfG9T
 YJl0ayco1obw9p8ZRbTXrwEpplD6tCh/OZLUORkpoCLVdsPjMxGlKpppVVqBgRkU0sWmJcs8+
 JVW6rkwYIfW+ByPrZ06o8Z0LDh16fMk+9SCT3NwBOPtSxknCx8FrnhsGoRDovr0APcCGC/WcH
 tkzbxmLZpHme9QiN9ga32jfNeHLvP3m0SBO4NaIT7oWkQLJtueOWQPlH6xcAjpsaGdeqIWKkf
 zlVOMRGqrvJN0OqkA4ebGTZiW6rl0L9miyhWNNo+GfwXDtoS/rMFOu2gifsf3SwYZXLEH89VW
 /DPZoCZTXI8AZ/OyJwYh4kMw0DWlGvHGNc4Bd5LS3aY3UdvfDXo7wBZ0IFqjvXffjxyMhIcIQ
 KAKguwkIlhw6iA5Huzx5anZwOLvdKQglI/l3bJJ8nAPrcBrMMBj1239Ko9OuyXHq6NCugTsrg
 sWtoFDYsrN1qhaftsZTjG2UMS0SASkYZULh/PkELoa9E4vJJgnQX9u3gyJiaa6xI+2JvlAGS4
 Ilj1mE+wOJqyN9kzTOeQVlfjc81Lu4Sm7wwE37j07RRvyLAxuuUMsMwl7IJ6xWQhASJnqvTbh
 mGCobFYt4mQB5kg/pe/Q4Ft0x+
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 57639
Cc: Po Lu <luangruo@HIDDEN>, Lars Ingebrigtsen <larsi@HIDDEN>,
 Philip Kaludercic <philipk@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@HIDDEN> writes:

> If it's automatically switching between dark and light themes, then
> style_changed_cb is probably not the right place.  It's mostly vestigial
> code from when we used to update the region face along with the GTK
> stylesheet.  Instead, TRT used to be to listen for changes to the
> `gtk-application-prefer-dark-theme' property of the GtkSettings object.
>
> However, that has been superseeded by a dbus based interface in recent
> versions of GNOME.  I do not understand the details, but it seems like
> it could be implemented in Lisp:
>
>   https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings

Definitely. Example D-Bus code is at <https://github.com/doomemacs/doomemacs/issues/6027>.

And if I understand
<https://github.com/flatpak/xdg-desktop-portal/blob/main/README.md>,
this is not restricted to GTK only.

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 12 Sep 2022 14:52:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 12 10:52:21 2022
Received: from localhost ([127.0.0.1]:47572 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXknN-0001Gn-J9
	for submit <at> debbugs.gnu.org; Mon, 12 Sep 2022 10:52:21 -0400
Received: from lists.gnu.org ([209.51.188.17]:36336)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael.albinus@HIDDEN>) id 1oXknL-0001Gf-IB
 for submit <at> debbugs.gnu.org; Mon, 12 Sep 2022 10:52:20 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:58136)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <michael.albinus@HIDDEN>)
 id 1oXknK-0004Gg-6K
 for bug-gnu-emacs@HIDDEN; Mon, 12 Sep 2022 10:52:19 -0400
Received: from mout.gmx.net ([212.227.15.15]:33385)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <michael.albinus@HIDDEN>)
 id 1oXknD-00052i-EC
 for bug-gnu-emacs@HIDDEN; Mon, 12 Sep 2022 10:52:17 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net;
 s=badeba3b8450; t=1662994318;
 bh=yVwd85fe0F9Xsa8/9kSPQCq2bC79YshqHx5u72pMvtc=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date;
 b=dV+83GTQhHx4Q6snSu8bzmy1mf/G1ocKbR1wv7vLyEMYXC0k3UvJD7ULhnOG7Yj/3
 Y4lwRJpZxNExgEJyzY3827FzFVEGgH/Rddq/SbhEfsCv8NFOi33HsGDEedlKupmME1
 3ur7WVejuLcVpX97w6NJuv4iT0OL1GxGfzn8Qlrg=
X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c
Received: from gandalf.gmx.de ([79.140.119.44]) by mail.gmx.net (mrgmx005
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MPXhA-1okLjL3z1u-00MfCv; Mon, 12
 Sep 2022 16:51:58 +0200
From: Michael Albinus <michael.albinus@HIDDEN>
To: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text
 editors" <bug-gnu-emacs@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <871qsg4u0b.fsf@HIDDEN> (Po Lu via's message of "Mon, 12 Sep
 2022 21:11:48 +0800")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <871qsgc390.fsf@HIDDEN>
 <871qsg4u0b.fsf@HIDDEN>
Date: Mon, 12 Sep 2022 16:51:54 +0200
Message-ID: <87v8psmyr9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:e2WNErgnxVOc3oLKAv0vuEmueLOgQt7YI0wgAZwpQoVhXJCUQ+S
 j/65BVEZbkVsRHgPZxNRsZmssblDHQkpsH9sJb/GLAnsnpDNXFmnt28AbHmBSumK0QzGdVI
 rmMq2pJ9lMKWd80fpAeyLlOk5+XOxn7boZ2jGFyl2n4pHQ5tmWJROacn6Tc3mUz8YNXikQq
 HJGJ8sB0Mtk4nybJn4UsQ==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:/3lYxQj1JSA=:QMEJwRMw+RZ5MwaBqfCqSc
 sleaNbWMawkG7hA1yOmehhtJ3XZPBxnlbnHUPrj8aT7MrmwoQQaroScDNhz0tLEBVs2t1v89N
 Ug4lUHiObQMapQnX5RK7oOP9UkPeRrjtKM58W8vDbzt1C1VwlJEK0orAtAVz1aSziLjocEtzC
 q6NWyf4HD5OsZj43P1M9E6+rtgjb+eYn0TsPPCuMQ/Iub2W1dPosEItlM13uiC5lp8DtEwtJg
 SM86JfZxXJK2p0asQr1sneRmucIWlLxLNJ47ZdikxXW/m2M0+wJA8nU/u/Lg3JyEL/23SgMTa
 zvzIqKmKYhFH3Ge/ikNNh1GHhxaiickXSjUUyOUj+sRb4j5cLUc8J6EFnC3sNU1TpbAcRqiqD
 v0n3/z2dRxszEa06nQBrGRh5TND5YUtwK1hqAsrnx32gxLf5ul1/vzcS7O0bSZkUTw9Oksv5o
 DzZjuxKuQadnI3F6siZiyIOV01S++PnrhGRSN/c5i6+OdVX21m0FQETFAtlX/NLyDDVtJ4j58
 rKRdfYKg9WAC4al0XxNWwCTtktkmurORrbNYQ6GC0AVtyINnY1lcTSGjtsI07PNFyeyWtfG9T
 YJl0ayco1obw9p8ZRbTXrwEpplD6tCh/OZLUORkpoCLVdsPjMxGlKpppVVqBgRkU0sWmJcs8+
 JVW6rkwYIfW+ByPrZ06o8Z0LDh16fMk+9SCT3NwBOPtSxknCx8FrnhsGoRDovr0APcCGC/WcH
 tkzbxmLZpHme9QiN9ga32jfNeHLvP3m0SBO4NaIT7oWkQLJtueOWQPlH6xcAjpsaGdeqIWKkf
 zlVOMRGqrvJN0OqkA4ebGTZiW6rl0L9miyhWNNo+GfwXDtoS/rMFOu2gifsf3SwYZXLEH89VW
 /DPZoCZTXI8AZ/OyJwYh4kMw0DWlGvHGNc4Bd5LS3aY3UdvfDXo7wBZ0IFqjvXffjxyMhIcIQ
 KAKguwkIlhw6iA5Huzx5anZwOLvdKQglI/l3bJJ8nAPrcBrMMBj1239Ko9OuyXHq6NCugTsrg
 sWtoFDYsrN1qhaftsZTjG2UMS0SASkYZULh/PkELoa9E4vJJgnQX9u3gyJiaa6xI+2JvlAGS4
 Ilj1mE+wOJqyN9kzTOeQVlfjc81Lu4Sm7wwE37j07RRvyLAxuuUMsMwl7IJ6xWQhASJnqvTbh
 mGCobFYt4mQB5kg/pe/Q4Ft0x+
Received-SPF: pass client-ip=212.227.15.15;
 envelope-from=michael.albinus@HIDDEN; helo=mout.gmx.net
X-Spam_score_int: -25
X-Spam_score: -2.6
X-Spam_bar: --
X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7,
 RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
Cc: Po Lu <luangruo@HIDDEN>, Lars Ingebrigtsen <larsi@HIDDEN>,
 Philip Kaludercic <philipk@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@HIDDEN> writes:

> If it's automatically switching between dark and light themes, then
> style_changed_cb is probably not the right place.  It's mostly vestigial
> code from when we used to update the region face along with the GTK
> stylesheet.  Instead, TRT used to be to listen for changes to the
> `gtk-application-prefer-dark-theme' property of the GtkSettings object.
>
> However, that has been superseeded by a dbus based interface in recent
> versions of GNOME.  I do not understand the details, but it seems like
> it could be implemented in Lisp:
>
>   https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings

Definitely. Example D-Bus code is at <https://github.com/doomemacs/doomemacs/issues/6027>.

And if I understand
<https://github.com/flatpak/xdg-desktop-portal/blob/main/README.md>,
this is not restricted to GTK only.

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 12 Sep 2022 13:12:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 12 09:12:08 2022
Received: from localhost ([127.0.0.1]:44584 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXjEO-0006Au-4Y
	for submit <at> debbugs.gnu.org; Mon, 12 Sep 2022 09:12:08 -0400
Received: from sonic317-32.consmr.mail.ne1.yahoo.com ([66.163.184.43]:39690)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <luangruo@HIDDEN>) id 1oXjEJ-0006AM-4d
 for 57639 <at> debbugs.gnu.org; Mon, 12 Sep 2022 09:12:06 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1662988316; bh=TFUvESNbNedaL/hDzC8xHSWi5MhUPQ0VgJUOj6xJ/Jo=;
 h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To;
 b=p2BnD9Hs+h0vxIuDZEQdCrepTbR84ySe+LS4yCoQZ3qjqWbRx959cXSpcbSkjUIc2znRgBb4pzNmgF5EXdFufxEodCi5hn2H9eombtRlQ8CP8TlIUXnsoWra+So40jaAo8boJivI+8x9f6iV4SvDnfNm0frur+8Zz5fMO6P4uXSVPsZoMqqPZgORAJyPsIk5VB5aZO0+lRircRdxCmWPjkl8BDbTLG8wwIMlxr/cwEjc6CGXdWGRHbaYoA/c/Hevdfk1ZxmsA42ceuaVhsiia6vUXLVlAs2v6CyNc2NkL2LRQhQehhvb5Vxcxe9KgCBREnBaqICRM6EfzDMLLA0eGw==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1662988316; bh=b2z8rU3GXtpneljW+50qxWiOsSyJpr2FvI+iOxL8hli=;
 h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
 b=QDzINrOR0CqbX4LQGBvAy/LowBEzZpNLqRd6/8F/l6w3Ik9qz2S9v907ydHbhxulMGPGIEg2prq1tznk6x9Rg24oRlFRmy8w/oLlZIGPqcw9zTKGsTmsWuR2YkhbGiBoGvfAf9knS8ZywooLhaf8WOvDLkSmA5vhZtXKvP4PQgClvHz2WGLgQ4SzvJL867VArqGSEAqOwFqmOsKu7Ii9Lnva6cN9M/IPoXl63sLA/yXb3PALEKnhIW87qXgiri08g8z9+HLFBhwAEkiWrBuabV1bdfmfS8xmwpeVVX8w4SSf0xaNMbxtrIUBVRwQiP++gGU8fyIOiI6SAmIi4aFvQA==
X-YMail-OSG: 0BUI_AMVM1kEN0fuGO.LpAakjI6auGUmkmdGXJ13qiG4x4E9MuOumDD8FCAkESJ
 Hm8o.R0BltnoVWhGZUdRxDQ_nx08TOPseciBce9.ZfFhTBTDDNvsGqI4Jd3WMKzYhwNsML_35r0N
 _jNGsm1Mps5J3jEQpxR9dGFWXj1ZPvESN1O0OcBGhV_22ZrVxFK.FHR.XxkWn9DXqU44ADMoJ3oP
 oD5hEIdOMOkEAQpgjX_uRwq71oCW1N2fyC5Zmm7WtpmeJibyIbiyxLtt9EiaLoTqy7FcYGd2n8bj
 F3kfUKb.qT7sP7z_E2T6NJ5pt4r1PQxGbbXHu7iUa.TVxmkGQK9oxPGw8VlYLzLf2QC1suXSz4xU
 bDAzK88575ZwOVAkrhn54tUlilS4MvQHrytEA9RNq4P06GJo6_yyvMgydaV0giEGonyurMo5FVMQ
 VQeJg0bFKocX_z5wstJdL8Om7rIYMNxvqwiYKm7g5YEgl0lsZV9Y5gR639KV3KM3rvAxvYXMqEyU
 B7tyXYBV0vw8y58sHXvypUFa8Nx4Txq3g84D7YXqyxr5JUCKdPuasdX96iLVVz6aSwnJo0xJDCRv
 7RBbfsGnOUmZhfB9fm4c0EUzzaigsR.O684GP7aeRnjJmBkwvaPDk6eh7KIMSDrOvWtz40cJCQJ0
 QlOWxjCDgETFJ9BfwFuMTVdvtDsFPzipamVV.JHGf8sGqTFjs0j401uC2ChpeEFqDNbvBIP11H8E
 nfReamMt.7biv_xdI71k8GJnpGCbnyeyXGMm4co4tqqB3lDXeg0UpI03E8pwJjtlb.9p9tCn1Oqu
 qdaPKtm71yk2miPMd4pqMk5oatNO2aItqxQTHrB6_6Vb.6OHzh66u1tzVHDPeAGz1KtGOEBAHHYz
 qUGI0wlCXthjX7ZJVoB9gvmX0DrxPmRMsdiQ0VarNXuqzUSHzXatW2mkQUybi8x9DfPfFbihON_R
 WG1P.BQ.SfJQRoDYJkL5tPVPvzv5xqQF34JIUWz9YgbRL81TKXCcx.2QWT1kX02dlQitf3CnB8iT
 UqRW8TzFpXcO5oA05ns.HiirNuz45BOZY7gqB71PWuW_StbR2Vb_1lUo9V6lSdcy_EUPP7o1prIy
 Rk3hQonlFYodwb7dM1iA.c71IfkMhnPFyhJL4uFerghfVU9fKUt7_HsK..J50bwhcKzqRKBIK9Ip
 sENn6bpycSF2CZJ7e.mTZiwPK9kzEtPjgLQizh_Kbz3zGCROCJdMGXxxzzTigllff1xwR.Acnyo0
 C_4gw1m0XnszFMQUlerG1Nsi3pihEqQiW55UaPCCXUNAUlDlJ8G3r5MTEFbqRw66i3A91HyRaOiU
 r8d0GGoO1GxZIoGfWnll2BGTOQO4rPSsSlwZ9UrIJn.UTTFlOWv2CijR9pHwOZ65NJWkZwYECZVE
 F_7v4IA9QCfQ8r3I7NlN6eItZctgV6QxHn1hgIqDQv10fxhtxXFRdxgHvgdZ6BNYS9oryETz65cF
 YQw2wu7s8dr4NKLRef4bKUfQWfqlMVhBmBDX4FYG7bEL.LPhre7zubuJpBjPGOieL_s8A_NUi.F0
 AqWzq7o.IGClaOtMyc.LnJMH_N_srhOUBw0GOZndpxxZvn4bg0OPo32u8ZkGcMvhtKGnC3ydnmLd
 CYcfrQ6Ni0vNY3mPakF0Tnp2J7AQLWbLiIZii0Y8bGI3cjJxT.Gsa9LglAfdYHfzLuwMgiwyj8Jy
 o6Z0Se9ZSdFHMznq11DDtXmFOCpDvlfEBKTiEXTZZebu987Tuv2Nz9ZJ7vDAhdnxHnKgXPxpf._q
 _x2JVf0n.SSOvKs6E0VNRTtDyyqOnLF4sZgAndPmnkskUfokr5y6Uyoil.vvRtPzqlxE9dlnhBxF
 rPSRvjiysirLuzuyVcBTFR7uPbyNxd7uX.Nha2gRpP7D3ryzzEHa4so77UfnP_6bQT5_nLKbiNEU
 zpI7snOi_Cs2DS5YnzOFYVAPoiHWwvEQ.IDhwf7IzFQenlsd8Agl9s5SH6FdtaprUXu1Sf_C.xll
 ylOYRbS20QSX42syIx4WwamIeWhRR.qMks8UnL5dhCS_pMWijcGqH4gA8IYDMB7JJRqOzLi75eRc
 fS15xZnvJ5iLs_M0CXWNphZPBLpEcOl50txcZujGV2OquGW0WrBsIFNIBTPMU8ljs2cO6bvddo4E
 Mc.GaACyRLYZrfc8qy.dcANLY4LudVih7P14w_4c_5QtFoSYBgtntEBjj1GsgniRijKs40EhDLSl
 3O8TsZF8qWIzutmhDMzHQgcKSghNBgaMu7SEltJgs5Oe6eXbnkIfu5p0vbjX8lbjOL0RlaFkRh4Y
 yP0MMsw--
X-Sonic-MF: <luangruo@HIDDEN>
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic317.consmr.mail.ne1.yahoo.com with HTTP; Mon, 12 Sep 2022 13:11:56 +0000
Received: by hermes--canary-production-sg3-6bb8946c47-n8gf6 (Yahoo Inc. Hermes
 SMTP Server) with ESMTPA ID db3308c25e5d1c00bc98b0797275c1fd; 
 Mon, 12 Sep 2022 13:11:53 +0000 (UTC)
From: Po Lu <luangruo@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <871qsgc390.fsf@HIDDEN>
Date: Mon, 12 Sep 2022 21:11:48 +0800
In-Reply-To: <871qsgc390.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Mon,
 12 Sep 2022 12:10:19 +0200")
Message-ID: <871qsg4u0b.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Mailer: WebService/1.1.20612
 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 1062
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57639
Cc: Philip Kaludercic <philipk@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>>> I thought we already had support for this under Gtk?  But I may be
>>> misremembering.
>>
>> Am I reading it correctly that `style_changed_cb' in gtkutils.c would be
>> a place to start looking for this functionality?
>
> Ah, yes, I think that's the one...  Po Lu probably know more about this;
> added to the CCs.

What exactly is the wanted feature?

If it's automatically switching between dark and light themes, then
style_changed_cb is probably not the right place.  It's mostly vestigial
code from when we used to update the region face along with the GTK
stylesheet.  Instead, TRT used to be to listen for changes to the
`gtk-application-prefer-dark-theme' property of the GtkSettings object.

However, that has been superseeded by a dbus based interface in recent
versions of GNOME.  I do not understand the details, but it seems like
it could be implemented in Lisp:

  https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 12 Sep 2022 11:12:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 12 07:12:46 2022
Received: from localhost ([127.0.0.1]:44306 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXhMr-0004hD-N4
	for submit <at> debbugs.gnu.org; Mon, 12 Sep 2022 07:12:46 -0400
Received: from quimby.gnus.org ([95.216.78.240]:51436)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oXhMi-0004gq-TK
 for 57639 <at> debbugs.gnu.org; Mon, 12 Sep 2022 07:12:43 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=b2mKg0nZzDWq4yIU0cp3D6hx/Jgis84KPgI0dpChVxU=; b=bM0SQEnXAz1CZxmuBENsHalavk
 shIAyzUSmCJuS81QMJ8Z8uPMQIMUmHL+WuQLAmgeajDR0mW73ZVqMZlRDEs5MX6Rw9EPl5TfjZ0R/
 jFkX4opV+LFlcNQn+1V2TrDJFPgT7Hb6McKZYQ9PX8YbOSCXKk2RyTdbeS9nCPC+mBbw=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oXhMa-0005XD-Ds; Mon, 12 Sep 2022 13:12:30 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <875yhsrgvu.fsf@HIDDEN> (Philip Kaludercic's message of "Mon, 
 12 Sep 2022 11:06:45 +0000")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <871qsgc390.fsf@HIDDEN>
 <875yhsrgvu.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEWZpZCJY0JsUiCT
 Zhw9LCDBkBr///+7s9DFAAAAAWJLR0QGYWa4fQAAAAd0SU1FB+YJDAsMEPZYP38AAAGySURBVDjL
 dZNbcuswCIaVM11A7aTvNZD3VtTvNaEr8Gj/WzmALnGmqTIjx3xcfiGc0l9rBoDXZ+CLVJ8D/Qs8
 RpymM/vKDxHVBoAAlPIovjM3AHfQM3RAGoAE8Og+IkjlzI8kAJqwW7WGIFARSvFOij0Hr3s2oVoB
 kFnA31VwLdSB/9G6O+L9CMQCxJ7vsikcgECW4O/TSfUOlgmIrNL2T6bLAUDK2YIEpllnDJkVyOLp
 YMENhH5KKTv1GqH140Vm60Jx0kD9nV7CoQFrQ57M0UyvF3Vl1wDZACw+EnLxs5iG60iV1QR9fV48
 yjxyi0ADQjfIsx3dO5sPEeaJPJOQxdxgRIDVBMx2k94ugHUUd2BlAKKPGoC9A+LXq7HZ/fdUwPXe
 FbOL3Ur5Bbz903kArkBcNvPyFiB3gF7q06cr/G12fVRzjAe7D69h5xxz5QDrWK2RyAG04g6w2Y0E
 qKlsx253VQOAlSjPABKWI0DLTFEDDnY2QHqLgbv7x6eV/DaptbTbIxVtEmAtjytRjbiG787jJBXA
 2nOPwITfiXrnDvYSqpCblLbGOczTB9wvt3/W/B/gyeFbKNUiOAAAACV0RVh0ZGF0ZTpjcmVhdGUA
 MjAyMi0wOS0xMlQxMToxMjoxNiswMDowMNYR3iUAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDkt
 MTJUMTE6MTI6MTYrMDA6MDCnTGaZAAAAAElFTkSuQmCC
X-Now-Playing: Django Django's _Django Django (Remaster)_: "Zumm Zumm"
Date: Mon, 12 Sep 2022 13:12:27 +0200
Message-ID: <87leqo978k.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Philip Kaludercic <philipk@HIDDEN> writes: > OK, now I
 understand what confused me. It certainly sounds interesting, > I just wonder
 what "features" there really are, or should it be kept > open-ended (i.e.
 any theme can specify any number of [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: Po Lu <luangruo@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

> OK, now I understand what confused me.  It certainly sounds interesting,
> I just wonder what "features" there really are, or should it be kept
> open-ended (i.e. any theme can specify any number of attributes)?

Yes, it's open-ended.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 12 Sep 2022 11:06:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 12 07:06:58 2022
Received: from localhost ([127.0.0.1]:44291 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXhHG-0004Xx-2u
	for submit <at> debbugs.gnu.org; Mon, 12 Sep 2022 07:06:58 -0400
Received: from mout02.posteo.de ([185.67.36.66]:52597)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oXhHD-0004Xi-1m
 for 57639 <at> debbugs.gnu.org; Mon, 12 Sep 2022 07:06:57 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 9E2D7240101
 for <57639 <at> debbugs.gnu.org>; Mon, 12 Sep 2022 13:06:48 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1662980808; bh=rfV3Jyrj5+O1ugIM+6JwsYOxJhUE7FGNDvYQQ+Q1Aiw=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=VskzHmt85ZQDI1mhj+COyP7nCRbj+NP3hfO0ZusnwPCAlPLKCrypWQtpO19yS1k0+
 frESUsqVq8K+eHdoTosnr30cPUPpZddd2EgXOZMwR3C/jtaMzbv1IQcpdsOGkXE35v
 YmQS/YOy+6Mj7MkztB5bLildlgtVrgV8Gwt16hjIQMUqXJH9uHclS/lJij/WUfLxsc
 TD2nX26fZLIyRReYR/wZPYMBNDhnssD9HqXiLfuVdXCIhUPaoLAiZGon2B6DwKlwl5
 d3P33t2lXF0ZvVMOOqIl5eCV9l136FnHKCfDCuyIEPRoYzXpe9XR+uYRHAHDCMdJ+r
 0zg1uVZfVCCSA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MR3h61wwXz6tqh;
 Mon, 12 Sep 2022 13:06:46 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <871qsgc390.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Mon,
 12 Sep 2022 12:10:19 +0200")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN> <871qsgc390.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Mon, 12 Sep 2022 11:06:45 +0000
Message-ID: <875yhsrgvu.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: Po Lu <luangruo@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>>> I thought we already had support for this under Gtk?  But I may be
>>> misremembering.
>>
>> Am I reading it correctly that `style_changed_cb' in gtkutils.c would be
>> a place to start looking for this functionality?
>
> Ah, yes, I think that's the one...  Po Lu probably know more about this;
> added to the CCs.
>
>> So would gruvbox-soft-dark have all the other themes as variants or only
>> gruvbox-soft-dark?=20=20
>
> Well, I was saying that the term "variants" isn't really what we need
> here, but tagging themes for features.
>
> So gruvbox-soft-dark would say
>
>   (theme-featues :name 'gruvbox :mode 'dark :softness 'soft)
>
> or...  feature names that make more sense.  =F0=9F=98=80
>
> Then the `theme-change-feature' if you have a gruvbox theme enabled
> would give you three other themes to choose from.
>
> If there's just the dark/light difference, then there's only one other
> theme to choose from, and no prompting would be needed.

OK, now I understand what confused me.  It certainly sounds interesting,
I just wonder what "features" there really are, or should it be kept
open-ended (i.e. any theme can specify any number of attributes)?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 12 Sep 2022 10:10:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 12 06:10:36 2022
Received: from localhost ([127.0.0.1]:44151 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXgOi-0004kW-AK
	for submit <at> debbugs.gnu.org; Mon, 12 Sep 2022 06:10:36 -0400
Received: from quimby.gnus.org ([95.216.78.240]:50614)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oXgOg-0004kJ-Sq
 for 57639 <at> debbugs.gnu.org; Mon, 12 Sep 2022 06:10:35 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=8Xc/vXO90cOHRbCNZSf4Lc5skEaUHqESPKMoiAvWTNo=; b=q4dJAeuIywH4yw1kYW8XtSu7oN
 bD/nqN9LSVyYZMeMDhkEOu3MKPjhbCyQguGxVs8MxTatWxmyUd07cwjjqKhupuREQBO0Hqd/PA9Jx
 oMjtnAYUOXWNuGvcU7mdVx/FS+thucieDn4ZZnRbUufafjo0ivjd0qkgwsWYRDxCJM7I=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oXgOT-00057U-Qu; Mon, 12 Sep 2022 12:10:28 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <8735cxpx2r.fsf@HIDDEN> (Philip Kaludercic's message of "Sun, 
 11 Sep 2022 18:47:40 +0000")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
 <8735cxpx2r.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEUoKi0JBgdNVVvA
 ys91gor////Gs4NHAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+YJDAk7Foy47hAAAAGfSURBVDjLlZPt
 lYQgDEUDTgHBsQBAG1iTAhig/5o2BMePmfXHokfRa/KSB4JBC+CMO42Zs3HQ5xewBLmAuxl3AMG6
 IBQdGs0oE31eYJUnMJuM6XpyG8D8KYAO/J043gHzH/AIqH3s9ewgWdMiUM8dNVU02nlE3zxA/NQA
 6FJfQJJ+1IAAmnD6ajN2d/G7aNh86+PE4XhRndszek2FXRrOACA04I/W9lSrfqAFXnwDCh049Jf1
 ByJvIDWQ4ykCBRBHBZQ/wVpfMrWFLxpLXl2RCJsHldtBlIIHphow0iUih4d5UqFso79aEsYwUqXV
 grh/8QrmhSvxsmLJFxAXX6U2StNWsDaqPsDAlYNBWtUC2NbDvuzUWjDIqzSP0C66S0SycElm5Gpl
 69tqDuMG6T88OVtAX0tooHv9FMfCzMnCIxZ1YPsNRqnKlOoh8kzcfqz3GhSiUDj6mdsnbgyw7Zwm
 QpJKzCERH1Nf2p5LcmhAqypBOnLRz8SF3hHHwkgE6WCb7BkU2gbDGbj9PbFvILx39VK3XDWHFD3s
 IVaBHB38AvdFaWXTEet7AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTA5LTEyVDA5OjU5OjIyKzAw
 OjAwI+RHuwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wOS0xMlQwOTo1OToyMiswMDowMFK5/wcA
 AAAASUVORK5CYII=
X-Now-Playing: David Lynch's _Ghost of Love_: "Imaginary Girl"
Date: Mon, 12 Sep 2022 12:10:19 +0200
Message-ID: <871qsgc390.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Philip Kaludercic <philipk@HIDDEN> writes: >> I thought
 we already had support for this under Gtk? But I may be >> misremembering.
 > > Am I reading it correctly that `style_changed_cb' in gtkutils.c would
 be > a place to start looking for this [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: Po Lu <luangruo@HIDDEN>, 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

>> I thought we already had support for this under Gtk?  But I may be
>> misremembering.
>
> Am I reading it correctly that `style_changed_cb' in gtkutils.c would be
> a place to start looking for this functionality?

Ah, yes, I think that's the one...  Po Lu probably know more about this;
added to the CCs.

> So would gruvbox-soft-dark have all the other themes as variants or only
> gruvbox-soft-dark?=20=20

Well, I was saying that the term "variants" isn't really what we need
here, but tagging themes for features.

So gruvbox-soft-dark would say

  (theme-featues :name 'gruvbox :mode 'dark :softness 'soft)

or...  feature names that make more sense.  =F0=9F=98=80

Then the `theme-change-feature' if you have a gruvbox theme enabled
would give you three other themes to choose from.

If there's just the dark/light difference, then there's only one other
theme to choose from, and no prompting would be needed.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 11 Sep 2022 18:48:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 11 14:48:07 2022
Received: from localhost ([127.0.0.1]:43514 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXRzy-0002Rg-Q7
	for submit <at> debbugs.gnu.org; Sun, 11 Sep 2022 14:48:07 -0400
Received: from mout02.posteo.de ([185.67.36.66]:38131)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oXRzv-0002R1-9e
 for 57639 <at> debbugs.gnu.org; Sun, 11 Sep 2022 14:48:05 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 29C26240105
 for <57639 <at> debbugs.gnu.org>; Sun, 11 Sep 2022 20:47:54 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1662922077; bh=UrVLAVKhSM84dg7BuA3dXlfEvNGua7IaTNwCuSZSRkg=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=DzAQKJtNEwUSBhchU+gDZ7XfTlrZnMtibnCDAFpLf//zv1oO5pmd6w8UXGmXd7z0L
 uEgPYyYyhxDeOC5QNHu+a5bqBY8ALOXWhPB08ofjZUHsHvcftb/zn0z8vnTIGOHZqt
 h+6zJIPVhwFvQwsPd0udYn8MUWnsIaTSA2mWjb1moi3cANQ6XEAbQjUnCnUEIrKelT
 kcoWEzzqzka8l/5h2D8sv29WWfmmOO7XCPMv0+osV7ZnLjsdtFW3EHLFiKStEGGgd2
 N4l7H26eMaop+SL9mLK3CT2ABcP8uBl7TC9MkMWOt2OwDUTqHW0b53VppHanBIatMp
 CR4wvI1IReILw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MQdyf0N5zz6tpF;
 Sun, 11 Sep 2022 20:47:51 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <87bkrmdt46.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sun,
 11 Sep 2022 13:54:01 +0200")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN> <87bkrmdt46.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Sun, 11 Sep 2022 18:47:40 +0000
Message-ID: <8735cxpx2r.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>>> 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.
>>
>> What about GNU/Linux desktops?
>
> I thought we already had support for this under Gtk?  But I may be
> misremembering.

Am I reading it correctly that `style_changed_cb' in gtkutils.c would be
a place to start looking for this functionality?

>> Stefans Gruvbox example had multiple dark and light variants.  E.g.
>> Would the new command toggle from `gruvbox-dark-soft' to
>> `gruvbox-dark-light' or prompt the user to select from all the gruvbox
>> themes?
>
> Yes, but if you have the soft gruvbox active, you don't want to switch
> to the hard one when changing between dark/light, so there's no ambiguity.

So would gruvbox-soft-dark have all the other themes as variants or only
gruvbox-soft-dark?=20=20

>>> But now I see that you've pushed `toggle-theme'...  *sigh*
>>
>> I'm very sorry about that, I've reverted those commits, since they were
>> accidentally pushed!
>
> *phew*  Thanks.  =F0=9F=98=80

Here is an updated version:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Add-new-command-theme-choose-variant.patch

From 1c9f1d92d0ecc4c7b94772e3a15ebf5e577a7f3d Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@HIDDEN>
Date: Tue, 6 Sep 2022 20:53:35 +0200
Subject: [PATCH] Add new command 'theme-choose-variant'

* doc/emacs/custom.texi (Custom Themes): Mention it.
* etc/themes/leuven-dark-theme.el (leuven-dark): Add dual theme.
* etc/themes/leuven-theme.el (leuven): Add dual theme.
* etc/themes/tango-dark-theme.el (tango-dark): Add dual theme.
* etc/themes/tango-theme.el (tango): Add dual theme.
* etc/themes/tsdh-dark-theme.el (tsdh-dark): Add dual theme.
* etc/themes/tsdh-light-theme.el (tsdh-light): Add dual theme.
* lisp/cus-theme.el (describe-theme-1): Say if a theme has a dual.
* lisp/custom.el (theme-choose-variant): Add new command.
(toggle-theme): Add an alias.  (Bug#57639)
---
 doc/emacs/custom.texi           |  8 ++++++++
 etc/themes/leuven-dark-theme.el |  4 +++-
 etc/themes/leuven-theme.el      |  4 +++-
 etc/themes/tango-dark-theme.el  |  2 ++
 etc/themes/tango-theme.el       |  2 ++
 etc/themes/tsdh-dark-theme.el   |  2 ++
 etc/themes/tsdh-light-theme.el  |  2 ++
 lisp/cus-theme.el               |  5 +++++
 lisp/custom.el                  | 27 +++++++++++++++++++++++++++
 9 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index ff7ab83190..f86c7e2dd9 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -667,6 +667,14 @@ Custom Themes
 the @file{*Custom Themes*} buffer; or type @kbd{M-x describe-theme}
 anywhere in Emacs and enter the theme name.
 
+@findex theme-choose-variant
+  Some themes have variants (most often these are light and dark
+pairs).  You can switch between these by typing @kbd{M-x
+theme-choose-variant}.  Note that this only works if only one theme is
+active.  If a theme has only one alternative, it will toggle
+automatically.  If there are more of them, it will query which one to
+use.
+
 @node Creating Custom Themes
 @subsection Creating Custom Themes
 @cindex custom themes, creating
diff --git a/etc/themes/leuven-dark-theme.el b/etc/themes/leuven-dark-theme.el
index 0e162c8bab..dfcd64a11c 100644
--- a/etc/themes/leuven-dark-theme.el
+++ b/etc/themes/leuven-dark-theme.el
@@ -5,7 +5,7 @@
 ;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")>
 ;; Contributor: Thibault Polge <(concat "thibault" at-sign "thb.lt")>
 ;; URL: https://github.com/fniessen/emacs-leuven-dark-theme
-;; Version: 20220202.1126
+;; Version: 20220911.1858
 ;; Keywords: color theme
 
 ;; This file is part of GNU Emacs.
@@ -1083,6 +1083,8 @@ leuven-dark
   (add-to-list 'custom-theme-load-path
                (file-name-as-directory (file-name-directory load-file-name))))
 
+(put 'leuven-dark 'theme-variants 'leuven) ;see `toggle-theme'
+
 (provide-theme 'leuven-dark)
 
 ;; This is for the sake of Emacs.
diff --git a/etc/themes/leuven-theme.el b/etc/themes/leuven-theme.el
index d9a8d5391a..66a65bc0b3 100644
--- a/etc/themes/leuven-theme.el
+++ b/etc/themes/leuven-theme.el
@@ -4,7 +4,7 @@
 
 ;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")>
 ;; URL: https://github.com/fniessen/emacs-leuven-theme
-;; Version: 20200513.1928
+;; Version: 20220911.1858
 ;; Keywords: color theme
 
 ;; This file is part of GNU Emacs.
@@ -1065,6 +1065,8 @@ leuven
   (add-to-list 'custom-theme-load-path
                (file-name-as-directory (file-name-directory load-file-name))))
 
+(put 'leuven 'theme-variants 'leuven-dark) ;see `toggle-theme'
+
 (provide-theme 'leuven)
 
 ;; This is for the sake of Emacs.
diff --git a/etc/themes/tango-dark-theme.el b/etc/themes/tango-dark-theme.el
index ef00d2ac49..81b7cbde13 100644
--- a/etc/themes/tango-dark-theme.el
+++ b/etc/themes/tango-dark-theme.el
@@ -190,6 +190,8 @@ tango-dark
    `(ansi-color-bright-white ((,class (:background ,alum-1
 				       :foreground ,alum-1))))))
 
+(put 'tango-dark 'theme-variants 'tango) ;see `toggle-theme'
+
 (provide-theme 'tango-dark)
 
 ;;; tango-dark-theme.el ends here
diff --git a/etc/themes/tango-theme.el b/etc/themes/tango-theme.el
index ecbbf03753..7f53a5cce2 100644
--- a/etc/themes/tango-theme.el
+++ b/etc/themes/tango-theme.el
@@ -173,6 +173,8 @@ tango
    `(ansi-color-bright-white ((,class (:background ,alum-1
 				       :foreground ,alum-1))))))
 
+(put 'tango 'theme-variants 'tango-dark) ;see `toggle-theme'
+
 (provide-theme 'tango)
 
 ;;; tango-theme.el ends here
diff --git a/etc/themes/tsdh-dark-theme.el b/etc/themes/tsdh-dark-theme.el
index a88ad75520..aef8cae3e0 100644
--- a/etc/themes/tsdh-dark-theme.el
+++ b/etc/themes/tsdh-dark-theme.el
@@ -142,6 +142,8 @@ tsdh-dark
  '(widget-field ((t (:box (:line-width 2 :color "grey75" :style pressed-button)))))
  '(window-number-face ((t (:foreground "red" :weight bold)))))
 
+(put 'tsdh-dark 'theme-variants 'tsdh-light) ;see `toggle-theme'
+
 (provide-theme 'tsdh-dark)
 
 ;;; tsdh-dark-theme.el ends here
diff --git a/etc/themes/tsdh-light-theme.el b/etc/themes/tsdh-light-theme.el
index d9d09b702b..d0f11f272b 100644
--- a/etc/themes/tsdh-light-theme.el
+++ b/etc/themes/tsdh-light-theme.el
@@ -104,6 +104,8 @@ tsdh-light
  '(show-paren-mismatch ((t (:background "deep pink" :weight bold))))
  '(window-number-face ((t (:foreground "red" :weight bold)))))
 
+(put 'tsdh-light 'theme-variants 'tsdh-dark) ;see `toggle-theme'
+
 (provide-theme 'tsdh-light)
 
 ;;; tsdh-light-theme.el ends here
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el
index 90680ff68f..dcd562c6af 100644
--- a/lisp/cus-theme.el
+++ b/lisp/cus-theme.el
@@ -515,6 +515,11 @@ describe-theme-1
 			  (end-of-file nil)))))
             (and (eq (car-safe sexp) 'deftheme)
 		 (setq doc (nth 2 sexp)))))))
+    (when-let ((variants (get theme 'theme-variants)))
+      (princ (concat " Variants of this theme are "
+                     (mapconcat
+                      (lambda (th) (concat "`" th "'"))
+                      variants ", "))))
     (princ "\n\nDocumentation:\n")
     (princ (if (stringp doc)
 	       (substitute-command-keys doc)
diff --git a/lisp/custom.el b/lisp/custom.el
index 352b5b0e16..58f8d05ec6 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -1372,6 +1372,33 @@ load-theme
     (enable-theme theme))
   t)
 
+(defun theme-choose-variant (&optional no-confirm no-enable)
+  "Toggle the current active theme by enabling its dual pair.
+The current theme will be immediately disabled before the dual
+theme has been enabled.  If THEME is not active an error will be
+raised.  If theme is nil For NO-CONFIRM and NO-ENABLE, see
+`load-theme'."
+  (interactive)
+  (cond
+   ((length= custom-enabled-themes 0)
+    (user-error "No theme is active, cannot toggle"))
+   ((length> custom-enabled-themes 1)
+    (user-error "More than one theme active, cannot unambiguously toggle")))
+  (let ((theme (car custom-enabled-themes)) variants)
+    (dolist (variant (ensure-list (get theme 'theme-variants)))
+      (when (and (custom-theme-p theme) (not (eq variant theme)))
+        (push variant variants)))
+    (let ((choice (cond
+                   ((null variants)
+                    (error "`%s' has no variants" theme))
+                   ((length= variants 1)
+                    (car variants))
+                   ((intern (completing-read "Load custom theme: " variants))))))
+      (disable-theme theme)
+      (load-theme choice no-confirm no-enable))))
+
+(defalias 'toggle-theme #'theme-choose-variant)
+
 (defun custom-theme-load-confirm (hash)
   "Query the user about loading a Custom theme that may not be safe.
 The theme should be in the current buffer.  If the user agrees,
-- 
2.37.3


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 11 Sep 2022 11:54:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 11 07:54:11 2022
Received: from localhost ([127.0.0.1]:41038 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXLXO-0000B2-Uo
	for submit <at> debbugs.gnu.org; Sun, 11 Sep 2022 07:54:11 -0400
Received: from quimby.gnus.org ([95.216.78.240]:39836)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oXLXN-0000An-Kv
 for 57639 <at> debbugs.gnu.org; Sun, 11 Sep 2022 07:54:10 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=1Y6pj0z6yg5F8fdndoyoz5ldd/VtZJYSPrcGb8hQSG8=; b=F4yUEGje1akA7Nwt27awh1QOj2
 x/Efx55h3mWqp1ufRIpss50KiaO1YlRVlB7w4gSa3o4gEGus5TLBqF8Mu1I58RwacqFXUd3sW9LUU
 0Q9ruF6FasCbq+/md8i9JZhziEalgE70PPo4Zg88IRsQ8wZ7c7SXbgij1+pYLipKcMT0=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oXLXF-00042l-GW; Sun, 11 Sep 2022 13:54:03 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <87a676jfx2.fsf@HIDDEN> (Philip Kaludercic's message of "Sun, 
 11 Sep 2022 11:42:33 +0000")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
 <87a676jfx2.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAFVBMVEWpnZGWh3hwUU9R
 NjyKbGFHNDj////PEsqRAAAAAWJLR0QGYWa4fQAAAAd0SU1FB+YJCws0CG98I2sAAAGwSURBVDjL
 XZNdrhshDIXhKgsYIxZwYybvt1Dei+sNdBD730rNzwQIUqKRP8wx5lipvsB4RHQ4VqIRV9ogkkTO
 Fj8XYE8WxokJWf55AgCQn3wkAG0ngKMCzWnsW4AGkHMCqm1pqNtEN5RfH+BQGtG7EPOxA1AmoMRL
 +bcDthRavOQNqGTl4g2U7w3UpvgOrk2+luRfoYKyyZsKXG7gZz2LWvt6xnqWZkm4Qf4ALmBs6mtd
 wEwV9JQfvQAiF/0A1wRWxF3xMX+qC3ChXK/S1eENHtKPUPIN5qvYBkocgCaQO+QJvt5FnYRZMrp2
 uW6gkwCc4NvMTv2VrscbqFv8gcF5QgGx9+pdFQUvFn0N9WsCI8B410H+PcFX8GSC6woh4ALQsMOu
 EJebi6fsaSnmmGsD5lMZd8ogUA13p8x7JKpAavgElp6MwfMOHijbWS7z1NbVxoQFyIjxsxXoRGic
 ZMMpYZuOt8VG00046Ux8PyjAnUDhrCO7ebaZjaQJyH9W9zdpqbGCaQ0FoyZ5DvS8nHQMI8j0eYQd
 6ONgwPpQSa1AxlX8jOJmhE0bIHGdmLhlaPUfUnGIzGLe2Y4AAAAldEVYdGRhdGU6Y3JlYXRlADIw
 MjItMDktMTFUMTE6NTI6MDgrMDA6MDDTlWKWAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTA5LTEx
 VDExOjUyOjA4KzAwOjAwosjaKgAAAABJRU5ErkJggg==
X-Now-Playing: Earwig's _Under My Skin I Am Laughing_: "Every Day Shines"
Date: Sun, 11 Sep 2022 13:54:01 +0200
Message-ID: <87bkrmdt46.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Philip Kaludercic <philipk@HIDDEN> writes: >> 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. > > W [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

>> 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.
>
> What about GNU/Linux desktops?

I thought we already had support for this under Gtk?  But I may be
misremembering.

> Stefans Gruvbox example had multiple dark and light variants.  E.g.
> Would the new command toggle from `gruvbox-dark-soft' to
> `gruvbox-dark-light' or prompt the user to select from all the gruvbox
> themes?

Yes, but if you have the soft gruvbox active, you don't want to switch
to the hard one when changing between dark/light, so there's no ambiguity.

>> But now I see that you've pushed `toggle-theme'...  *sigh*
>
> I'm very sorry about that, I've reverted those commits, since they were
> accidentally pushed!

*phew*  Thanks.  =F0=9F=98=80




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 11 Sep 2022 11:42:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 11 07:42:43 2022
Received: from localhost ([127.0.0.1]:40994 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXLMI-00063o-Sw
	for submit <at> debbugs.gnu.org; Sun, 11 Sep 2022 07:42:43 -0400
Received: from mout02.posteo.de ([185.67.36.66]:51737)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oXLMH-00063Y-5O
 for 57639 <at> debbugs.gnu.org; Sun, 11 Sep 2022 07:42:41 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id A1EFA240103
 for <57639 <at> debbugs.gnu.org>; Sun, 11 Sep 2022 13:42:35 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1662896555; bh=uZy6w8SPHRiXm36XtgBaC0Lf19Rw2N/nmqOOwOhoE90=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=e8owUIRIjYOedtnsInVC2lsJSqQqlAXZ1BMEtPSvnc6SJ/gZ8U8IsSZn2RzryPMgP
 kZUDQFJ9/OgWrd0tt28557ruZIYBh/7alhZDk3NFzDcfq+IerCrvLIsDKPLv4n3sNu
 Mzp7jCeQa9+oafWWNdOyW1hOtFLfCgtGpxFhSVf0FXdulH9NF3hjiHHRkP5I8bjiCU
 GUPQ5euVmzC1x+drXxDob/TCHWZ8MfDKYkVwmAKuFTLucBusaFNycy3AlOJni4y9X9
 ifUGFyH6V9QVpxrp0fTmyk+JrkKSyfVN7hvR2Oa0DQ8Gx7pXU4CPIZpdmaLR6GZmDH
 C9GsQMHQKF3Hg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MQSWt6jNVz6tmF;
 Sun, 11 Sep 2022 13:42:34 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <87fsgygo7c.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sun,
 11 Sep 2022 13:11:51 +0200")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Sun, 11 Sep 2022 11:42:33 +0000
Message-ID: <87a676jfx2.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> 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.  =F0=9F=98=80

Ok, I'll implement this then.

>>> 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.

What about GNU/Linux desktops?

>> 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.

Stefans Gruvbox example had multiple dark and light variants.  E.g.
Would the new command toggle from `gruvbox-dark-soft' to
`gruvbox-dark-light' or prompt the user to select from all the gruvbox
themes?

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Lars Ingebrigtsen <larsi@HIDDEN> writes:
>
>> 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.
>
> But now I see that you've pushed `toggle-theme'...  *sigh*

I'm very sorry about that, I've reverted those commits, since they were
accidentally pushed!




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 11 Sep 2022 11:22:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 11 07:22:50 2022
Received: from localhost ([127.0.0.1]:40924 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXL34-0003GP-Bs
	for submit <at> debbugs.gnu.org; Sun, 11 Sep 2022 07:22:50 -0400
Received: from quimby.gnus.org ([95.216.78.240]:39390)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oXL32-0003GA-Ls
 for 57639 <at> debbugs.gnu.org; Sun, 11 Sep 2022 07:22:49 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=DP3UdaVVmYlQNe97P4u5j5bK9bNS7FlUp7B9GPpZR0Y=; b=jw8BpN5LXtGqZmvp5XNv9fX0Qc
 l7MekrO4BsGaVezIcJXOK8Arw3Yxm2c3N4CvjRt4W4ICnVn/JGHvdKQQP/ST4CrJRL10E0NpIYYsg
 YJ4R9qM3nUwuBI7iolrnK47ELJ/5zOOSN391Pj15Z3li0O/oFqHQeowtiTApUtz7yIsI=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oXL2u-0003lj-Ko; Sun, 11 Sep 2022 13:22:42 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <87fsgygo7c.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sun,
 11 Sep 2022 13:11:51 +0200")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN> <87fsgygo7c.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAGFBMVEVsWl2JbHWSd4iZ
 lKutrcrDvdZ8fo3///93xNKjAAAAAWJLR0QHFmGI6wAAAAd0SU1FB+YJCwo0L8u0/DcAAAG6SURB
 VDjLZZNfbsMgDMbNJvU5wAUGuUDAbM+ToLvAmvdKlXL/I8w2f0o6S1US//Lhz44LUENTeO8RC8d+
 2yW7aF3BiqmU684Bi1l1iBFN0JTHsreAYK0LEdEGGwl8DoDeaefjujrDilQGiE5p/SwyaiCGnje1
 +n4GfihOgF52/8CH5JlM4EpAN8AXAly7CFA1g+hkJAKudFSADpBANUWeATcgCQG/vD1nUgEIKOXH
 dMWNwQeQxPhUrrfYG//FBEmAJlAKYp9IsJDuA2Qcn+PXi4J9IaeD6iRDCqIw7DdtYFNrHTC7OkRu
 JIPGMXYqGV0DJDGNQCpUEdkoFcFvULYSSJmtSLBmAWXEG/CLE/giKyZREhAHyI3olR5mIBKaNh2G
 J0WVpE0Zrz1IZ50JybyxhudhpO/USclaLxp6PFBYNZ/RD/COm5nK3QaAA8DUapl/cAqFI2A7k7ou
 0ge8iCzmCibJXf6NXYGTMbk3vMWawL2DNkMjX5QaG2cdh5C6AHBMZ/HDsHt5zOVlMhXA8Tg5plVa
 KyD9uUmZTKTr5XhpUq30t+Sby1T/OGRjLTYzT8vkRbUa4mV02X39AX+VsqWy2GUYAAAAJXRFWHRk
 YXRlOmNyZWF0ZQAyMDIyLTA5LTExVDEwOjUyOjQ3KzAwOjAwfAHFAAAAACV0RVh0ZGF0ZTptb2Rp
 ZnkAMjAyMi0wOS0xMVQxMDo1Mjo0NyswMDowMA1cfbwAAAAASUVORK5CYII=
X-Now-Playing: Insides's _Euphoria_: "Yes"
Date: Sun, 11 Sep 2022 13:22:40 +0200
Message-ID: <87zgf6f94v.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Lars Ingebrigtsen <larsi@HIDDEN> writes: > 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. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> 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.

But now I see that you've pushed `toggle-theme'...  *sigh*




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 11 Sep 2022 11:12:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 11 07:12:03 2022
Received: from localhost ([127.0.0.1]:40885 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXKsc-0002v7-Kl
	for submit <at> debbugs.gnu.org; Sun, 11 Sep 2022 07:12:02 -0400
Received: from quimby.gnus.org ([95.216.78.240]:39228)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oXKsa-0002uY-Ji
 for 57639 <at> debbugs.gnu.org; Sun, 11 Sep 2022 07:12:01 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID
 :Date:References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-ID:
 Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
 :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=SaA+r/sKJLZGoUseTxqzWQ2uvSqf7rEQ4I3jeFpmCoY=; b=uTaqA5VYWF112ZyoGxYX3TS3yi
 X4M5tGcMXGvUolbjfaXVlxEOrzOCKQ61Q4PmT50SfsDyKus1u6vyERguIFH3HynaRjW1QfCKEDGeE
 uT3u7TFBLt2uypfpJQRDd+iV80/Bm+Qr5Cm9AIhXIufZiM1nIyBbiMsmBtIYniOVNeR0=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oXKsS-0003cS-Bc; Sun, 11 Sep 2022 13:11:54 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <871qsil3jm.fsf@HIDDEN> (Philip Kaludercic's message of "Sun, 
 11 Sep 2022 08:26:53 +0000")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
 <871qsil3jm.fsf@HIDDEN>
X-Now-Playing: Insides's _Euphoria_: "Relentless"
Date: Sun, 11 Sep 2022 13:11:51 +0200
Message-ID: <87fsgygo7c.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Philip Kaludercic <philipk@HIDDEN> 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 s [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Philip Kaludercic <philipk@HIDDEN> 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.  =F0=9F=98=80

>> 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.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 11 Sep 2022 08:27:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 11 04:27:04 2022
Received: from localhost ([127.0.0.1]:40707 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXIIy-0004rG-7D
	for submit <at> debbugs.gnu.org; Sun, 11 Sep 2022 04:27:04 -0400
Received: from mout01.posteo.de ([185.67.36.65]:58295)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oXIIv-0004qk-RH
 for 57639 <at> debbugs.gnu.org; Sun, 11 Sep 2022 04:27:02 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 13726240026
 for <57639 <at> debbugs.gnu.org>; Sun, 11 Sep 2022 10:26:55 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1662884816; bh=FjIU4DXC0sb6KKOuzDkTQhLzIAXtg2zTLWHgPvEMess=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=qei7IgwNlkFhBBXLETRZtr2D/3ERH9JhPpMZkIuM97WQQ7pv38G1KcKgOOr9FiRZ/
 PAmrTEXkME8ruwZl7J/cuY5XlXz0HAGaSIiPGsRUrHvqcPciAx6flklzVRKTSHMq0m
 +6V7JkE/fpqkCEiKr5dSm3kgNMVbRoZhKAemo9R0Ks1VRGANKFWAX3az0DtOza81kv
 ZlTIP8m+I/aW5IgycWR8QSp/SNRV6w5JJy2U20C5jlBtnfsanq+Q5nkFIWaOKo1Rg2
 FTsDQ/SAIiwrzgRKU4LRcPAlphumIK/8EGQCvRBmO8jhsoGPGfEpNlaFk4Iw+65lS3
 YBdNcdva6ephg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MQNB63s5Fz6tn9;
 Sun, 11 Sep 2022 10:26:54 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <87fsh25bso.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Thu,
 08 Sep 2022 13:46:15 +0200")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN> <87fsh25bso.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Sun, 11 Sep 2022 08:26:53 +0000
Message-ID: <871qsil3jm.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>> Do you think it would be better to less general, and instead of talking
>> about "dual" themes always assume we want to toggle between a light and
>> a dark variant?  If not, this sounds like a separate feature (say that
>> could be handled by a different property `theme-variant').
>
> Well, if we had marking for "theme with variant", then we'd know which
> themes are "the same", but with a variant.
>
> So your command could instead be `theme-choose-variant', but since
> there's only two variants here, it'd toggle.  If there were more, the
> user would be prompted for which variant to use, which would cover
> gruvbox, which Stefan mentioned.

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 it would make sense to alias the name, since most themes, if
they do have variants just come with dark and light where "toggle" is
a more intuitive term.

> 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?

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 8 Sep 2022 11:46:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 08 07:46:27 2022
Received: from localhost ([127.0.0.1]:57393 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oWFzH-0005Mi-84
	for submit <at> debbugs.gnu.org; Thu, 08 Sep 2022 07:46:27 -0400
Received: from quimby.gnus.org ([95.216.78.240]:53380)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oWFzE-0005MR-TK
 for 57639 <at> debbugs.gnu.org; Thu, 08 Sep 2022 07:46:25 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=4iRkLWcUfaYv+cuQ4Nq+LDShkUuU8figk7ySd3Tb1So=; b=SZWz5rCOoOJYvDG2Fco4Qgq8dO
 +MqAZB7oCgbJCdrN8FHf5x7je5IUQZCoB+/1SCJaHpvc/e/60K19MnfRafI3KsOq7zyQ2Cm6g4y02
 bz3fArusDIkyw291BTPllnPe58O9a4y04zttpIMUSo7Y17wUTUB3vNpgInG9Qt3uXN8k=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oWFz6-0001lv-3t; Thu, 08 Sep 2022 13:46:18 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <875yhzl3a1.fsf@HIDDEN> (Philip Kaludercic's message of "Wed, 
 07 Sep 2022 13:31:18 +0000")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
 <875yhzl3a1.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAALVBMVEUuIwtVOyFpZlQG
 BgJIMgZWTRBnVx1xbyt5gzmJczGFek2fklG6spOsl0T///9GbpeoAAAAAWJLR0QOb70wTwAAAAd0
 SU1FB+YJCAsjLERJ7MIAAAGVSURBVDjL1dO9TsMwEAdwoxbmFgl2eAKkvgBIyQMg1V4QA0POCkwM
 sRv1AcLHxEDLqXSBibIhgWhNJD7WsCKhknfBLthJQWxd+E/R/XJ2Yp0JIXN1m0X3VK+Rxh+ZGazN
 BshPWCOEVD2dEpia5+KAkKl6AVU6yW+YBwAuwaT5A6RN4GuoWFgA4YB6vl8CLpMviOhUB5etgwNT
 x4hSv1mxvznPpUxaiGg6KLu+WF0pNhcyNiAgoO3R4MbtcSyT3qFS6kjdertTkNwfDTQM1ZDuZdmz
 Bb1vS/Y0XCkVlAFAQ4zHajhOo60HB0xQJvlZt6dG6vXO36nXvr+KyUA3hdDWi6VvbJ/UGhYmJ8i4
 HEh83x4/PDmgTNdhWba7aX6eZQU0eRQusRBjzPOPAmjkC9E/3Qyxg6mRRwsB7Uo8qQNy1C1jC1V9
 QF3ADoQI8TRQ1jEAKOK0DPqsk7j/DhCLEPt5L3v5Hrt14gd6nU4oIBz289yCGSyPVr9mZ2MZ+PWl
 A10lRYr7YQZR6/qkXGmUwb058zv47+ATvbpQrpuNH0IAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjIt
 MDktMDhUMTE6MzU6NDQrMDA6MDDAyxK/AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTA5LTA4VDEx
 OjM1OjQ0KzAwOjAwsZaqAwAAAABJRU5ErkJggg==
X-Now-Playing: David Grubbs & Nikus Veliotis's _The Harmless Dust_: "The
 Harmless Dust, Pt. Two"
Date: Thu, 08 Sep 2022 13:46:15 +0200
Message-ID: <87fsh25bso.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Philip Kaludercic <philipk@HIDDEN> writes: > Do you think
 it would be better to less general, and instead of talking > about "dual"
 themes always assume we want to toggle between a light and > a dark variant?
 If not, this sounds like a separat [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

> Do you think it would be better to less general, and instead of talking
> about "dual" themes always assume we want to toggle between a light and
> a dark variant?  If not, this sounds like a separate feature (say that
> could be handled by a different property `theme-variant').

Well, if we had marking for "theme with variant", then we'd know which
themes are "the same", but with a variant.

So your command could instead be `theme-choose-variant', but since
there's only two variants here, it'd toggle.  If there were more, the
user would be prompted for which variant to use, which would cover
gruvbox, which Stefan mentioned.

And in addition, this tagging could be used for automatic dark/light OS
changes, so it's at least three birds with one stone.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 7 Sep 2022 13:31:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 07 09:31:28 2022
Received: from localhost ([127.0.0.1]:54075 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVv9L-00085F-Qq
	for submit <at> debbugs.gnu.org; Wed, 07 Sep 2022 09:31:28 -0400
Received: from mout01.posteo.de ([185.67.36.65]:35509)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oVv9K-000850-Ep
 for 57639 <at> debbugs.gnu.org; Wed, 07 Sep 2022 09:31:27 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 1A361240026
 for <57639 <at> debbugs.gnu.org>; Wed,  7 Sep 2022 15:31:19 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1662557480; bh=HIU+75GVxcrye2ziwVLc/9xykkmn/yHY23XjIeYmaok=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=CtRaYuib/psSMe6nbUMoX9Fur+N8ix1hs2zXfGWqqQTTgTjUXQUYSIcg1ajIPFaP+
 DapAO21Lvav6mo/XNCDIQtAHG8jFMEaXvHf6p2Szmq1BjHyobGPI9/DeYiOZSJXGFJ
 prUTFxRD0Y1uZCQ+VjczLVq6fQ6Qk5nyOGrzgjmB8yDtJTx6J30SnZ0gHKEQk1GqDH
 TsFi3UT+hIFTfqnZwpje9yl7IGVOpWoEW9LTYUimlMmCEORJhV50gAxzJdS3E0wS4E
 LgFh1j/xzgOkR5SI4tP+tdqCqq6M3WQOEL+38/I5GB79avONiIGlJbkdN6EQU56M+d
 FJxNLyLxv9dQQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MN37C1Qf8z9rxV;
 Wed,  7 Sep 2022 15:31:18 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <875yhzmj50.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Wed,
 07 Sep 2022 15:03:23 +0200")
References: <875yhzmz25.fsf@HIDDEN> <875yhzmj50.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Wed, 07 Sep 2022 13:31:18 +0000
Message-ID: <875yhzl3a1.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>> Find below a patch for a command that a lot of custom themes
>> re-implement, whenever there exists a light and dark variant.
>
> I think it would also be nice if the themes themselves explicitly
> defined themselves as being light/dark, really.  That way, when Emacs
> finally grows a "react to the OS dark mode settings", Emacs could also
> flip to the correct theme (if we have a dual theme).

Do you think it would be better to less general, and instead of talking
about "dual" themes always assume we want to toggle between a light and
a dark variant?  If not, this sounds like a separate feature (say that
could be handled by a different property `theme-variant').




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 7 Sep 2022 13:03:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 07 09:03:35 2022
Received: from localhost ([127.0.0.1]:54008 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVuiN-0005EL-3I
	for submit <at> debbugs.gnu.org; Wed, 07 Sep 2022 09:03:35 -0400
Received: from quimby.gnus.org ([95.216.78.240]:41818)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oVuiK-0005E4-FE
 for 57639 <at> debbugs.gnu.org; Wed, 07 Sep 2022 09:03:32 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=B91TsdjELM2aq/DV6POJmnipJWs9Ok3Swr7ou0+pIUY=; b=WU8oTbgsmjtP99NhO/zh/9PaDD
 UOsP8tyQQz9opG65rf9EVfR9c1aaHsxB6STc/C3e694BmK3WVfwqtzA9Bw2rDc12CZH1DCeJ4a5Ry
 x+TlaNDwL/qogr3tzViZ/5R+XqLiYSq9ZTqLJr+MjyhM8nBjvjCs7b75TYKkUdVjMPP8=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oVuiC-000702-87; Wed, 07 Sep 2022 15:03:26 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <875yhzmz25.fsf@HIDDEN> (Philip Kaludercic's message of "Wed, 
 07 Sep 2022 07:19:30 +0000")
References: <875yhzmz25.fsf@HIDDEN>
X-Now-Playing: The Senior Allstars - =?utf-8?Q?=E2=80=98Slipping?= Into
 =?utf-8?Q?Darkness=E2=80=99's?= _Late Night
 Tales: Version Excursions (Selected By Don Letts)_: "Originally recorded
 by WAR "
Date: Wed, 07 Sep 2022 15:03:23 +0200
Message-ID: <875yhzmj50.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Philip Kaludercic <philipk@HIDDEN> writes: > Find below
 a patch for a command that a lot of custom themes > re-implement, whenever
 there exists a light and dark variant. I think it would also be nice if the
 themes themselves explicitly defined themselves as being light/dark, really.
 That way, when Emacs finally grows a "react to the OS dark mode settings",
 Emacs could [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

> Find below a patch for a command that a lot of custom themes
> re-implement, whenever there exists a light and dark variant.

I think it would also be nice if the themes themselves explicitly
defined themselves as being light/dark, really.  That way, when Emacs
finally grows a "react to the OS dark mode settings", Emacs could also
flip to the correct theme (if we have a dual theme).






Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 7 Sep 2022 08:52:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 07 04:52:10 2022
Received: from localhost ([127.0.0.1]:53370 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVqn4-0002Xm-60
	for submit <at> debbugs.gnu.org; Wed, 07 Sep 2022 04:52:10 -0400
Received: from mail-oa1-f48.google.com ([209.85.160.48]:36367)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1oVqmy-0002XE-I7
 for 57639 <at> debbugs.gnu.org; Wed, 07 Sep 2022 04:52:08 -0400
Received: by mail-oa1-f48.google.com with SMTP id
 586e51a60fabf-127ba06d03fso10806954fac.3
 for <57639 <at> debbugs.gnu.org>; Wed, 07 Sep 2022 01:52:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:from:to:cc:subject:date;
 bh=l9OYPgFr4lBWl0vnL3406ZN/abkITBi68zd9it19wNs=;
 b=h2Q+emaYcAH85FwS6SadBkRbhAcADFRdFVQ4vnztEJ5PUc+MjoCgYuWrdXr+lHqerZ
 1zqTiL/6rIm0Ii+woZKw2L26kMOoBwUwKGXyZ7xBM2fAiW/wBRWGYaW6C2fttz1pyUDc
 UM7ooUuO3ojuKsBLJCHd8+bAzxbPCzF0f1kcVev+mn2HRGIou6Gz6nm8RHcMgbsE4QDr
 bZELo2OoCCdkR3mNJztlE5aPrOm3vA5fzwcTJquwmmWQf8xH8riL8BJO8lvG4VJag8//
 yhb7r8U/IwPi2bp2T89LQLdyUtKnx+wcoQD8nRKsSUmRlCPkX1trqDPy1qq+34CtXtnk
 ES0g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:x-gm-message-state:from:to:cc:subject:date;
 bh=l9OYPgFr4lBWl0vnL3406ZN/abkITBi68zd9it19wNs=;
 b=aAYQsngnX4WIHeFqQW4h8V6xZICQb5I4RuDE1AS1AA15bGFsiuBAGtL8DjqdIdS/32
 GxkpY/te90iHWZTQUKDbAFjK0UskdGlphtfebEDGsmSMZiplxED6yWUFcpp1cGVQwj2D
 JgrI6zlvem+g0R7lixKOiCGlwwj4zaFr52OvOc87k38nJJUgzm7Fck1Oq41+OqoJjjhl
 45CDkaHnLs2Vil66YTeA/T/5CPCKSlPM8B3dP005mkT/kA+Hp6s6xZgEvl9Paidqs1zW
 oXtP+eVIavVJF627vg8G5G89A/WOI804YDg4bsH5wKY1+tEDgUW2g1L3ly855cXDhdn6
 PV+Q==
X-Gm-Message-State: ACgBeo29f9A7yQ1J5CNj6YmJaK2FUA8sPk0mmBh4WbSIwrtEDmWP2Ypd
 sXgZ7VVFZYA1I/b3pvrG2KhPdjeylge7+23Ezw0=
X-Google-Smtp-Source: AA6agR6upVovHCzGNrs/oHuY13vZ/kwaRMH2i6NJgT28LkxHCE0z+aoKkGNfSbM/vypzIblXloCvxN+btdrCJ+LOvDw=
X-Received: by 2002:a05:6808:1688:b0:345:ea9a:2954 with SMTP id
 bb8-20020a056808168800b00345ea9a2954mr11596325oib.199.1662540718914; Wed, 07
 Sep 2022 01:51:58 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Wed, 7 Sep 2022 01:51:58 -0700
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <87pmg7lh2z.fsf@HIDDEN>
References: <875yhzmz25.fsf@HIDDEN>
 <CADwFkmnUX4hCDDZyKwfE8Zgp51aLnQ+snaYexEXY6H3RjXjcNw@HIDDEN>
 <87pmg7lh2z.fsf@HIDDEN>
X-Hashcash: 1:20:220907:philipk@HIDDEN::XzHDKP5LuJacItZ/:6abB
MIME-Version: 1.0
Date: Wed, 7 Sep 2022 01:51:58 -0700
Message-ID: <CADwFkm=JOnUyKvyAQOE6GOHrPTdxboFcs-VUGstZJPFa=L8G2g@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
To: Philip Kaludercic <philipk@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57639
Cc: 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Philip Kaludercic <philipk@HIDDEN> writes:

> In principle the current implementation doesn't insist on there only
> being two variants.  Each theme defines its dual, and these don't have
> to be symmetrical.

That sounds good, thanks for clarifying.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 7 Sep 2022 08:33:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 07 04:33:20 2022
Received: from localhost ([127.0.0.1]:53350 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVqUq-000223-53
	for submit <at> debbugs.gnu.org; Wed, 07 Sep 2022 04:33:20 -0400
Received: from mout02.posteo.de ([185.67.36.66]:32795)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oVqUn-00021o-8n
 for 57639 <at> debbugs.gnu.org; Wed, 07 Sep 2022 04:33:18 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 0BB4A240103
 for <57639 <at> debbugs.gnu.org>; Wed,  7 Sep 2022 10:33:10 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1662539591; bh=kJv1T1oF2KeGDSaTSH2gnW8LEltd3J6LM8jKBAkHDys=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=KjMmSy9GWjyZyoIiI6/iNKfVNjIchbOdV+vfyPkPB5yVSX2Trvz7K/zmoXCOWEoKL
 bjAQIdCtoAv0DWrbTZn501hL7xyn7pBgblO99OMK/IL6cPDKRuBQtql6Cjrw6zi4ie
 ZYTietxCbo24bWCYcXecZ742706GK7FsMIZpglicaKqGJhN/Y/Ez7UlZrA/x6oa7/R
 QtCfDGRp8B0c/IkO0rcx1E7z2WoOADlICVxZjafz7B+86FTwlEPHEpDL26G3HxA8KP
 GyNH892cXFe2XuJOSzbpTImjrjWC0Z9HjzAJnfxuKgi33enAwsZVJzDGTxlbe8IPDJ
 7pvrNPeqk7afg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MMwW94Sv1z9rxQ;
 Wed,  7 Sep 2022 10:33:08 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
In-Reply-To: <CADwFkmnUX4hCDDZyKwfE8Zgp51aLnQ+snaYexEXY6H3RjXjcNw@HIDDEN>
 (Stefan Kangas's message of "Wed, 7 Sep 2022 04:06:36 -0400")
References: <875yhzmz25.fsf@HIDDEN>
 <CADwFkmnUX4hCDDZyKwfE8Zgp51aLnQ+snaYexEXY6H3RjXjcNw@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Wed, 07 Sep 2022 08:33:08 +0000
Message-ID: <87pmg7lh2z.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 57639
Cc: 57639 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Stefan Kangas <stefankangas@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>> Find below a patch for a command that a lot of custom themes
>> re-implement, whenever there exists a light and dark variant.
>
> Could/should this be generalized to more than two variants?

In principle the current implementation doesn't insist on there only
being two variants.  Each theme defines its dual, and these don't have
to be symmetrical.

> The gruvbox theme, for example, has these variants:
>
>     gruvbox-dark-hard
>     gruvbox-dark-medium
>     gruvbox-dark-soft
>     gruvbox-light-hard
>     gruvbox-light-medium
>     gruvbox-light-soft
>
> But I'm not sure what a reasonable user interface would look like.

E.g. in this case one could do:

(put 'gruvbox-dark-hard 'theme-dual 'gruvbox-dark-medium)
(put 'gruvbox-dark-medium 'theme-dual 'gruvbox-dark-soft)
(put 'gruvbox-dark-soft 'theme-dual 'gruvbox-light-hard)
(put 'gruvbox-light-hard 'theme-dual 'gruvbox-light-medium)
(put 'gruvbox-light-medium 'theme-dual 'gruvbox-light-soft)
(put 'gruvbox-light-soft 'theme-dual 'gruvbox-dark-hard)

But wouldn't just associating gruvbox-dark-hard with gruvbox-light-hard,
etc. be just as good?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at 57639 <at> debbugs.gnu.org:


Received: (at 57639) by debbugs.gnu.org; 7 Sep 2022 08:06:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 07 04:06:44 2022
Received: from localhost ([127.0.0.1]:53309 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVq56-0001Kg-Ix
	for submit <at> debbugs.gnu.org; Wed, 07 Sep 2022 04:06:44 -0400
Received: from mail-oa1-f47.google.com ([209.85.160.47]:41774)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1oVq54-0001KS-Np
 for 57639 <at> debbugs.gnu.org; Wed, 07 Sep 2022 04:06:43 -0400
Received: by mail-oa1-f47.google.com with SMTP id
 586e51a60fabf-12803ac8113so864269fac.8
 for <57639 <at> debbugs.gnu.org>; Wed, 07 Sep 2022 01:06:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=to:subject:message-id:date:mime-version:references:in-reply-to:from
 :from:to:cc:subject:date;
 bh=uSsdqkmAazNw+ZSq/dg/w2yEiiNgePXjj2hEw7XpN3U=;
 b=T1QE0rVc1MBFK/1o5VpcJkfg+zmFnImWPF0C/8TCK2ekk47TQpqZf66RcQcd/VJs4R
 vmoqfOQGYc3wjUOE/VB/m31Tbzgp01MiGJodCCp/c+MMQ1OR9UFL12A3B8VFTe4133ve
 aDQO0TFT69/R/NtaGxzxIktfBzOLEvIcs2p3m6c1nd9XgrPneg85wxhyZM4lxpPJYLrB
 fpEnEcHo7gLTub0bkh6INjhRS+H4ICP7ZpRoxi8GRmG55W9Uugc5O0m7nk6GRFej8vGG
 k3ZLCeOvj631svBOjCBilPkxOLgdO7EVogwzamfnspYq8GPrP/4yxNomppF0bGyE+/FV
 65Pg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=to:subject:message-id:date:mime-version:references:in-reply-to:from
 :x-gm-message-state:from:to:cc:subject:date;
 bh=uSsdqkmAazNw+ZSq/dg/w2yEiiNgePXjj2hEw7XpN3U=;
 b=MNDAsU8dJ38Vge7pPYLIZoVcMxyuMYG5SWNjmfWWxQnlY/0XYyfjq6ENADa1bZcVbX
 CV/qZDJZnzLxU2mcwhIL9l4B01WlOwylyUuqVcr6JmsYmIZ+TXh11+htkBq6bVk87Uo3
 s4b09YjirQKHi1H2r9U6u19XbH/pvFMkJLncobt8rU2kjf2D+l7+VprXA90J+AxXtR1A
 t3M9l1u9Z7v0AhHp8g9uFF2+6ihq5vpNaaWZ1ekjiRGBaMlAf1kDomsZkwP/HI28nf8E
 L+nXb/0Y12BJMxBS3xGbpBvzz6OAPZjxjGPQHBJmwKUmpO/NzZtpgQu22+sUJKFoAxsq
 vAcQ==
X-Gm-Message-State: ACgBeo2uG6NacaBdYPiray2BheYITL7mS3sWrNqlKs70q9ad+JedXs4N
 BuRTsdu4aRN5W7GS4D81HJyq0KMV58MEceCJFZ0=
X-Google-Smtp-Source: AA6agR5nSnBlXa/B1obL2ZOu5acv3BNYAd4l+f+MyQ2qMwpWk5BqyE9wNHNPy3+SdCoz4OkNGoNTlQraRycK9MR1Omw=
X-Received: by 2002:a05:6870:5581:b0:11e:300:8189 with SMTP id
 n1-20020a056870558100b0011e03008189mr13854317oao.199.1662537997177; Wed, 07
 Sep 2022 01:06:37 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Wed, 7 Sep 2022 04:06:36 -0400
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <875yhzmz25.fsf@HIDDEN>
References: <875yhzmz25.fsf@HIDDEN>
X-Hashcash: 1:20:220907:philipk@HIDDEN::6ZbC6bxsRpmQy4eG:20AQ
MIME-Version: 1.0
Date: Wed, 7 Sep 2022 04:06:36 -0400
Message-ID: <CADwFkmnUX4hCDDZyKwfE8Zgp51aLnQ+snaYexEXY6H3RjXjcNw@HIDDEN>
Subject: Re: bug#57639: [PATCH] Add new command 'toggle-theme'
To: Philip Kaludercic <philipk@HIDDEN>, 57639 <at> debbugs.gnu.org
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 57639
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Philip Kaludercic <philipk@HIDDEN> writes:

> Find below a patch for a command that a lot of custom themes
> re-implement, whenever there exists a light and dark variant.

Could/should this be generalized to more than two variants?

The gruvbox theme, for example, has these variants:

    gruvbox-dark-hard
    gruvbox-dark-medium
    gruvbox-dark-soft
    gruvbox-light-hard
    gruvbox-light-medium
    gruvbox-light-soft

But I'm not sure what a reasonable user interface would look like.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 7 Sep 2022 07:19:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 07 03:19:50 2022
Received: from localhost ([127.0.0.1]:53243 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oVpLi-0008VT-12
	for submit <at> debbugs.gnu.org; Wed, 07 Sep 2022 03:19:50 -0400
Received: from lists.gnu.org ([209.51.188.17]:59402)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1oVpLf-0008VE-FG
 for submit <at> debbugs.gnu.org; Wed, 07 Sep 2022 03:19:48 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:56798)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <philipk@HIDDEN>)
 id 1oVpLa-00004w-CV
 for bug-gnu-emacs@HIDDEN; Wed, 07 Sep 2022 03:19:45 -0400
Received: from mout01.posteo.de ([185.67.36.65]:33363)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <philipk@HIDDEN>)
 id 1oVpLX-000639-Lz
 for bug-gnu-emacs@HIDDEN; Wed, 07 Sep 2022 03:19:42 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 16E8824002A
 for <bug-gnu-emacs@HIDDEN>; Wed,  7 Sep 2022 09:19:36 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1662535177; bh=pZbeE2viNzs3FrR+80kOAyAzmB1HZjj2cYOO4rFTB0o=;
 h=From:To:Subject:Autocrypt:Date:From;
 b=mUxSt2LWxr5K+KGX5FgtRF1vauHd+9uAJV+hen20iU7CDz3Dw73/XNDFaO6PMIOSw
 dsQreAiRbVbi0hyhV1R+P3d4xHvQVNBzAbn1MYxeFEQarOtkQZdMwu12q635CDYrqg
 TVvCOF2aM2f2T9WT56afyurjm7aJ0sAHB/PgX1SHu7CUyrxT7iup+JrKvEU2TY+LQA
 34zUxQC7qu3jmBO3g9Ubss2XLNhvT0tZtAAUN4lJscuOfFaTu5g36Q7ZhtmnCHiL5c
 2xmw6zUZI79kx8Bq1YVWvmAHnKCewqhl3rVA8VY5niL8JTm9N+O0OnwoNI2ZowZqV5
 kX5UPJXYrCSlA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4MMttJ3P7Bz6tm9
 for <bug-gnu-emacs@HIDDEN>; Wed,  7 Sep 2022 09:19:36 +0200 (CEST)
From: Philip Kaludercic <philipk@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] Add new command 'toggle-theme'
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Wed, 07 Sep 2022 07:19:30 +0000
Message-ID: <875yhzmz25.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@HIDDEN;
 helo=mout01.posteo.de
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--=-=-=
Content-Type: text/plain

Tags: patch


Find below a patch for a command that a lot of custom themes
re-implement, whenever there exists a light and dark variant.

In GNU Emacs 29.0.50 (build 8, x86_64-pc-linux-gnu, GTK+ Version
 3.24.34, cairo version 1.17.6) of 2022-09-03 built on rhea
Repository revision: 2763a516a048c2cbabb10a5bbe22dc3bbde561f3
Repository branch: master
System Description: Fedora Linux 36 (Workstation Edition)

Configured using:
 'configure --with-pgtk --with-native-compilation --with-imagemagick'


--=-=-=
Content-Type: text/patch
Content-Disposition: attachment;
 filename=0001-Add-new-command-toggle-theme.patch

From 2f27885460095a247421431faca14bf35fae3995 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@HIDDEN>
Date: Tue, 6 Sep 2022 20:53:35 +0200
Subject: [PATCH 1/2] Add new command 'toggle-theme'

* doc/emacs/custom.texi (Custom Themes): Mention it.
* etc/themes/leuven-dark-theme.el (leuven-dark): Add dual theme.
* etc/themes/leuven-theme.el (leuven): Add dual theme.
* etc/themes/tango-dark-theme.el (tango-dark): Add dual theme.
* etc/themes/tango-theme.el (tango): Add dual theme.
* etc/themes/tsdh-dark-theme.el (tsdh-dark): Add dual theme.
* etc/themes/tsdh-light-theme.el (tsdh-light): Add dual theme.
* lisp/cus-theme.el (describe-theme-1): Say if a theme has a dual.
* lisp/custom.el (toggle-theme): Add new command.
---
 doc/emacs/custom.texi           |  5 +++++
 etc/themes/leuven-dark-theme.el |  4 +++-
 etc/themes/leuven-theme.el      |  4 +++-
 etc/themes/tango-dark-theme.el  |  2 ++
 etc/themes/tango-theme.el       |  2 ++
 etc/themes/tsdh-dark-theme.el   |  2 ++
 etc/themes/tsdh-light-theme.el  |  2 ++
 lisp/cus-theme.el               |  2 ++
 lisp/custom.el                  | 19 +++++++++++++++++++
 9 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index ff7ab83190..3dabba9d2f 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -667,6 +667,11 @@ Custom Themes
 the @file{*Custom Themes*} buffer; or type @kbd{M-x describe-theme}
 anywhere in Emacs and enter the theme name.
 
+@findex toggle-theme
+  Some themes have dual variants (most often these are light and dark
+pairs).  You can switch between these by typing @kbd{M-x
+toggle-theme}.  Note that this only works if only one theme is active.
+
 @node Creating Custom Themes
 @subsection Creating Custom Themes
 @cindex custom themes, creating
diff --git a/etc/themes/leuven-dark-theme.el b/etc/themes/leuven-dark-theme.el
index 0e162c8bab..cef40782c1 100644
--- a/etc/themes/leuven-dark-theme.el
+++ b/etc/themes/leuven-dark-theme.el
@@ -5,7 +5,7 @@
 ;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")>
 ;; Contributor: Thibault Polge <(concat "thibault" at-sign "thb.lt")>
 ;; URL: https://github.com/fniessen/emacs-leuven-dark-theme
-;; Version: 20220202.1126
+;; Version: 20220906.2016
 ;; Keywords: color theme
 
 ;; This file is part of GNU Emacs.
@@ -1083,6 +1083,8 @@ leuven-dark
   (add-to-list 'custom-theme-load-path
                (file-name-as-directory (file-name-directory load-file-name))))
 
+(put 'leuven-dark 'dual-theme 'leuven) ;see `toggle-theme'
+
 (provide-theme 'leuven-dark)
 
 ;; This is for the sake of Emacs.
diff --git a/etc/themes/leuven-theme.el b/etc/themes/leuven-theme.el
index d9a8d5391a..73ac96d28d 100644
--- a/etc/themes/leuven-theme.el
+++ b/etc/themes/leuven-theme.el
@@ -4,7 +4,7 @@
 
 ;; Author: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")>
 ;; URL: https://github.com/fniessen/emacs-leuven-theme
-;; Version: 20200513.1928
+;; Version: 20220906.2016
 ;; Keywords: color theme
 
 ;; This file is part of GNU Emacs.
@@ -1065,6 +1065,8 @@ leuven
   (add-to-list 'custom-theme-load-path
                (file-name-as-directory (file-name-directory load-file-name))))
 
+(put 'leuven 'dual-theme 'leuven-dark) ;see `toggle-theme'
+
 (provide-theme 'leuven)
 
 ;; This is for the sake of Emacs.
diff --git a/etc/themes/tango-dark-theme.el b/etc/themes/tango-dark-theme.el
index ef00d2ac49..f9f2692ac5 100644
--- a/etc/themes/tango-dark-theme.el
+++ b/etc/themes/tango-dark-theme.el
@@ -190,6 +190,8 @@ tango-dark
    `(ansi-color-bright-white ((,class (:background ,alum-1
 				       :foreground ,alum-1))))))
 
+(put 'tango-dark 'dual-theme 'tango) ;see `toggle-theme'
+
 (provide-theme 'tango-dark)
 
 ;;; tango-dark-theme.el ends here
diff --git a/etc/themes/tango-theme.el b/etc/themes/tango-theme.el
index ecbbf03753..8d1686f05e 100644
--- a/etc/themes/tango-theme.el
+++ b/etc/themes/tango-theme.el
@@ -173,6 +173,8 @@ tango
    `(ansi-color-bright-white ((,class (:background ,alum-1
 				       :foreground ,alum-1))))))
 
+(put 'tango 'dual-theme 'tango-dark) ;see `toggle-theme'
+
 (provide-theme 'tango)
 
 ;;; tango-theme.el ends here
diff --git a/etc/themes/tsdh-dark-theme.el b/etc/themes/tsdh-dark-theme.el
index a88ad75520..ad54eb3df0 100644
--- a/etc/themes/tsdh-dark-theme.el
+++ b/etc/themes/tsdh-dark-theme.el
@@ -142,6 +142,8 @@ tsdh-dark
  '(widget-field ((t (:box (:line-width 2 :color "grey75" :style pressed-button)))))
  '(window-number-face ((t (:foreground "red" :weight bold)))))
 
+(put 'tsdh-dark 'dual-theme 'tsdh-light) ;see `toggle-theme'
+
 (provide-theme 'tsdh-dark)
 
 ;;; tsdh-dark-theme.el ends here
diff --git a/etc/themes/tsdh-light-theme.el b/etc/themes/tsdh-light-theme.el
index d9d09b702b..64c048f7e5 100644
--- a/etc/themes/tsdh-light-theme.el
+++ b/etc/themes/tsdh-light-theme.el
@@ -104,6 +104,8 @@ tsdh-light
  '(show-paren-mismatch ((t (:background "deep pink" :weight bold))))
  '(window-number-face ((t (:foreground "red" :weight bold)))))
 
+(put 'tsdh-light 'dual-theme 'tsdh-dark) ;see `toggle-theme'
+
 (provide-theme 'tsdh-light)
 
 ;;; tsdh-light-theme.el ends here
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el
index 69ec837db8..04d9ed0004 100644
--- a/lisp/cus-theme.el
+++ b/lisp/cus-theme.el
@@ -515,6 +515,8 @@ describe-theme-1
 			  (end-of-file nil)))))
             (and (eq (car-safe sexp) 'deftheme)
 		 (setq doc (nth 2 sexp)))))))
+    (when-let ((dual (get theme 'dual-theme)))
+      (princ (format " The dual theme is `%s'" dual)))
     (princ "\n\nDocumentation:\n")
     (princ (if (stringp doc)
 	       (substitute-command-keys doc)
diff --git a/lisp/custom.el b/lisp/custom.el
index 96dfb37d86..ec15267c62 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -1374,6 +1374,25 @@ load-theme
     (enable-theme theme))
   t)
 
+(defun toggle-theme (&optional no-confirm no-enable)
+  "Toggle the current active theme by enabling its dual pair.
+The current theme will be immediately disabled before the dual
+theme has been enabled.  If THEME is not active an error will be
+raised.  If theme is nil For NO-CONFIRM and NO-ENABLE, see
+`load-theme'."
+  (interactive)
+  (cond
+   ((length= custom-enabled-themes 0)
+    (user-error "No theme is active, cannot toggle"))
+   ((length> custom-enabled-themes 1)
+    (user-error "More than one theme active, cannot unambiguously toggle")))
+  (let* ((theme (car custom-enabled-themes))
+         (dual (get theme 'dual-theme)))
+    (unless dual
+      (error "`%s' has no dual theme to toggle between" theme))
+    (disable-theme theme)
+    (load-theme dual no-confirm no-enable)))
+
 (defun custom-theme-load-confirm (hash)
   "Query the user about loading a Custom theme that may not be safe.
 The theme should be in the current buffer.  If the user agrees,
-- 
2.37.2


--=-=-=--




Acknowledgement sent to Philip Kaludercic <philipk@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#57639; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 21 Sep 2022 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.