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.help Subject: Re: M-x toggle-theme Date: Tue, 22 Nov 2022 16:59:27 +0000 Message-ID: <87v8n79b80.fsf@posteo.net> References: <875yf9xvja.phibqa@vnoxvs.kbxpyjyhg.info> <8735abj43k.fsf@dataswamp.org> <87wn7niiaf.fsf@codeisgreat.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33527"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 22 18:00:14 2022 Return-path: Envelope-to: geh-help-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 1oxWd4-0008Ws-2k for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 22 Nov 2022 18:00:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxWcR-0000U6-Hn; Tue, 22 Nov 2022 11:59:35 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxWcP-0000Tw-Ef for help-gnu-emacs@gnu.org; Tue, 22 Nov 2022 11:59:33 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxWcN-000556-E8 for help-gnu-emacs@gnu.org; Tue, 22 Nov 2022 11:59:33 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 07D3B240103 for ; Tue, 22 Nov 2022 17:59:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1669136369; bh=7AT8Ah4bZVwrZSYR/SJf+TcO0WRXQZHSnmUq3XH8t8U=; h=From:To:Subject:Date:From; b=FCAN55ydcBII6kGUWtCsbmIR4WnmLUNbLh5g4lnXnqEa+rvQcmnYJ4nmriMMNOEEa 7xUS2Om2KUvBubCyVVYNbjzd2oBXjlZf38CJHifOCnZIEUqd25hSj4P7aE6lUM5iaj ektEbbh+EN5jT4XaSKbyAP09kg6kGo+lCyhUPKDoHHeHNT2HAwxVTlVghZD9E7stDQ xzH/64xI2Wh5csQ03DfgJpa+cZJLiRkM+2S4c6eekD9e85nIqz93q2Nsn3+LI9IdH1 MUpuPT4JZlXNtnlF7MWGcjbXJWnYquSw/QeUEssmbdcKuDH67qeSztfxOWMaQeuCDr h8jEd7df+sMOA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NGr8H3KkYz6trQ for ; Tue, 22 Nov 2022 17:59:27 +0100 (CET) In-Reply-To: (Jean Louis's message of "Tue, 22 Nov 2022 17:34:16 +0300") Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:141108 Archived-At: Jean Louis writes: > * Pankaj Jangid [2022-11-22 10:03]: >> 2. Earlier I wrote a function to toggle themes. Now it is builtin. > > I have just tried: M-x toggle-theme and I get error: > > toggle-theme: Theme =E2=80=98light-blue=E2=80=99 does not have any known = variants > > This may be because=20 > > '(custom-enabled-themes '(light-blue)) > > So toggle-theme should have better working. You misunderstand the mechanism by which toggle-theme works. A theme may declare a family: (deftheme tsdh-light "A light Emacs theme. Used and created by Tassilo Horn." :background-mode 'light :kind 'color-scheme :family 'tsdh) When a theme of this family is enabled, M-x toggle-theme will either prompt the user or toggle the theme to some other member of the family automatically (the latter works if there are only two themes to switch between).