From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#57639: [PATCH] Add new command 'toggle-theme' Date: Sun, 11 Sep 2022 08:26:53 +0000 Message-ID: <871qsil3jm.fsf@posteo.net> References: <875yhzmz25.fsf@posteo.net> <875yhzmj50.fsf@gnus.org> <875yhzl3a1.fsf@posteo.net> <87fsh25bso.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8842"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57639@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 11 10:28:15 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oXIK7-00026b-11 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Sep 2022 10:28:15 +0200 Original-Received: from localhost ([::1]:59140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXIK5-0002Q7-U2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Sep 2022 04:28:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXIJv-0002Pw-Jo for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2022 04:28:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52008) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXIJu-0002uV-BW for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2022 04:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oXIJt-0004sT-U8 for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2022 04:28:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Sep 2022 08:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57639 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 57639-submit@debbugs.gnu.org id=B57639.166288482418682 (code B ref 57639); Sun, 11 Sep 2022 08:28:01 +0000 Original-Received: (at 57639) by debbugs.gnu.org; 11 Sep 2022 08:27:04 +0000 Original-Received: from localhost ([127.0.0.1]:40707 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXIIy-0004rG-7D for submit@debbugs.gnu.org; Sun, 11 Sep 2022 04:27:04 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:58295) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXIIv-0004qk-RH for 57639@debbugs.gnu.org; Sun, 11 Sep 2022 04:27:02 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 13726240026 for <57639@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== Original-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) In-Reply-To: <87fsh25bso.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 08 Sep 2022 13:46:15 +0200") Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:242129 Archived-At: Lars Ingebrigtsen writes: > Philip Kaludercic 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?