From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.devel Subject: Disabling custom themes (was: Why is custom--inhibit-theme-enable not t by default?) Date: Wed, 13 Jun 2018 19:55:35 +0300 Message-ID: <87602m1v94.fsf_-_@tcd.ie> References: <10b7bd657091b074d8da1bf1ae35b1f4.squirrel@dancol.org> <83h8m8owp2.fsf@gnu.org> <48a7bd1277a18dd0a68d06cd8b022062.squirrel@dancol.org>> <83vaao3qrn.fsf@gnu.org>> <874li63iit.fsf@tcd.ie> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1528908832 8624 195.159.176.226 (13 Jun 2018 16:53:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 13 Jun 2018 16:53:52 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Eli Zaretskii , dancol@dancol.org, emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 13 18:53:48 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fT91o-0002Aa-53 for ged-emacs-devel@m.gmane.org; Wed, 13 Jun 2018 18:53:48 +0200 Original-Received: from localhost ([::1]:35714 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fT93v-0005yM-0P for ged-emacs-devel@m.gmane.org; Wed, 13 Jun 2018 12:55:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fT93k-0005xz-IV for emacs-devel@gnu.org; Wed, 13 Jun 2018 12:55:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fT93g-0004bT-Lc for emacs-devel@gnu.org; Wed, 13 Jun 2018 12:55:48 -0400 Original-Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:38474) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fT93g-0004Wb-AT for emacs-devel@gnu.org; Wed, 13 Jun 2018 12:55:44 -0400 Original-Received: by mail-wm0-x234.google.com with SMTP id 69-v6so6726374wmf.3 for ; Wed, 13 Jun 2018 09:55:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=PduOJyJWdgjTQwElI/JMXrecilr5+5qegRGCTZoTgUg=; b=Xkblf0keHuzZ29EwH4Gr7gepx7lOcFVBDABYaPDVo+yfm4GcCKua6Bve5wgXdxsVLz qOdOeB05gbDiE+/9PQg3oYA0NDtTCil5qdm1zjkGkmkgkThmuvPxqFVIGvTZ80RrJik4 X9cvPidaIHVpL9ILWixh4IPjxw7tnU0iFyYxk2ELkOZGl1agnUY7dYmFoYoptw+KhDWL NL5S+B8tAWeQeeQ+YGRCkCZvbLMLcLqrZaLXIIyU/QDt+7ufcjjuyfCSTKzjlt4uZIIX JpHpFMJAFxl3G8+5bVcv9wfZY8lEY/Uh837O3AgtCKK0VL7TzR/7MbRcryikuurWq63T dM0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=PduOJyJWdgjTQwElI/JMXrecilr5+5qegRGCTZoTgUg=; b=DaN0zamaMShpZjYgUsRsXhy3Dvy0RLZeby6QzM9VHVTFIpfFfsFJK8NuswrzBTVaqc fvD6NEkbODwGwaRGfRBZeys4yzyrdgUldW9l5JkrzRzHWhKuR3/v1BtkOVy92GbWBnwP kZT83jnfygzEOIJ/iN3H6Cymgf92k8GPI5WpccjV0t2EJJmEfIYOcPNjgO7OhwiFFlY5 jieK5YWzeNL1993UfFQL61kiNKx/nkHOEDcCyQz5w8hkziDPrP/HG+PblztLzEqmYTAY 75TNd6ltJ2tcP5++D+s1B0wbScs0LTH4VSj715/46T3rStTDY2ILKp6QPgeRehyObTvz C55g== X-Gm-Message-State: APt69E1/Kqr++nSSjun1U5JcDEXmyS5hNtq3glwfd+0AmrbfFr7pfYdu Ns7zxR6hMzqvTKzLgb6bzRrwIQ== X-Google-Smtp-Source: ADUXVKKf6SkOXqKqHe1rXZXtMWsJs09dAu68XzknGsAwUNLHa2Bf9de0uEgoFeVMgBUxlxjPYj4iVA== X-Received: by 2002:a1c:d287:: with SMTP id j129-v6mr3816870wmg.106.1528908942693; Wed, 13 Jun 2018 09:55:42 -0700 (PDT) Original-Received: from localhost (adsl-109.91.140.91.tellas.gr. [91.140.91.109]) by smtp.gmail.com with ESMTPSA id j13-v6sm3829818wre.38.2018.06.13.09.55.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Jun 2018 09:55:41 -0700 (PDT) In-Reply-To: (Drew Adams's message of "Wed, 13 Jun 2018 07:22:24 -0700 (PDT)") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::234 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:226296 Archived-At: Drew Adams writes: >> Doesn't the command disable-theme undo the application of a custom >> theme? > > No. Summary: There is no function that takes a snapshot > of the Emacs state (even, e.g., as a custom theme) before > applying any custom theme - which snapshot can then be used > to restore that pre-theme state. > > You cannot undo the application of custom themes, to return > to the state _before_ applying any theme. You can only > disable custom themes, not undo them to a non-theme state. > You can swap one custom theme for another, but any > non-theme state before applying a custom theme is lost. > > What's missing is the ability to put you back to anything > close to the pre-theme state (i.e., as much as possible), > whatever that customized state might have been. > > https://www.emacswiki.org/emacs/CustomThemes#ComparedToColorThemes > > See bug #15687. > > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15687 > > Recipe: > > 1. You start out with Emacs in your preferred (non-theme) > customized state, a result perhaps of multiple option settings, > frame parameter settings, face settings, etc. For example, > you have used `default-frame-alist' and customized some > particular faces. > > No custom theme (except `user' - the default) has been applied yet. > > 2. You enable a custom theme. Then you disable it. The > settings remain those of the "disabled" custom theme. Your > initial state is not restored. > > Disabling does not undo the effect upon Emacs of enabling - > "disabling" is a misnomer. > > Enabling not only makes a theme current but also changes > variable values, face settings, frame parameters etc., but > _none of that is part of disabling_, except in so far as > it affects or is affected by other custom themes. > > The ex-theme state of Emacs is ignored wrt both enabling > and disabling. There is no record of anything to restore. > > A more precise use case: As above, but you cycle among a > set of custom themes. You want C-g during the cycling to > cancel (i.e., undo) all effects, restoring the initial > state because you decided not to use any theme. > > With `color-theme.el' this is trivial to do: just take a > (pseudotheme) snapshot before cycling, and then restore > the snapshot upon C-g. > > There is no equivalent of such a snapshot with custom > themes, and it's not clear how to create one. > > In particular, all of the custom-theme code requires a > theme argument, which must be defined fully, including > actually having been written to a theme file. Hardly > something that facilitates dynamic state recording and > reverting. > > FWIW, I have code that uses (e.g., cycles among) > either color themes or custom themes. I don't "favor" > one or the other. Each kind has its advantages. > Neither kind replaces the other. A disadvantage of > custom themes is that you cannot undo them. > > Not the end of the world, but for someone who wants to > try out themes, starting from a customized Emacs (faces, > frame parameters, etc.), it's not possible to simply > cancel out (`C-g') of the trial and return to what you > started with. > > You can of course quit Emacs and start a new session, > to get back your initial, customized state. But you > can't simply _undo_ the effect of applying a custom theme. Sorry, I'm not sure I completely understand what you mean (for example w.r.t. "initial state" and "settings of the 'disabled' custom theme"), but I've posted a recipe with what I think you're getting at to bug#15687, where I think any further discussion of the effects of theme disabling can be continued. Either way, thanks for the explanation and background. -- Basil