From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#15687: 24.3.50; custom themes: disabling does not restore initial configuration Date: Tue, 26 Nov 2013 06:05:21 -0800 (PST) Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1385474780 27610 80.91.229.3 (26 Nov 2013 14:06:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Nov 2013 14:06:20 +0000 (UTC) Cc: 15687@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 26 15:06:24 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VlJHT-0002SK-9D for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Nov 2013 15:06:23 +0100 Original-Received: from localhost ([::1]:58878 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlJHS-0008Tx-Q7 for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Nov 2013 09:06:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlJHG-0008Rr-Sq for bug-gnu-emacs@gnu.org; Tue, 26 Nov 2013 09:06:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlJH8-0000ja-A1 for bug-gnu-emacs@gnu.org; Tue, 26 Nov 2013 09:06:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59780) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlJH8-0000jW-7V for bug-gnu-emacs@gnu.org; Tue, 26 Nov 2013 09:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VlJH7-0005XN-NY for bug-gnu-emacs@gnu.org; Tue, 26 Nov 2013 09:06:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Nov 2013 14:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15687 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15687-submit@debbugs.gnu.org id=B15687.138547473521243 (code B ref 15687); Tue, 26 Nov 2013 14:06:01 +0000 Original-Received: (at 15687) by debbugs.gnu.org; 26 Nov 2013 14:05:35 +0000 Original-Received: from localhost ([127.0.0.1]:45566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VlJGg-0005WY-DQ for submit@debbugs.gnu.org; Tue, 26 Nov 2013 09:05:35 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:32633) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VlJGd-0005WK-PL for 15687@debbugs.gnu.org; Tue, 26 Nov 2013 09:05:32 -0500 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id rAQE5N2c007183 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 26 Nov 2013 14:05:25 GMT Original-Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rAQE5M9A002947 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 26 Nov 2013 14:05:22 GMT Original-Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rAQE5Lst022332; Tue, 26 Nov 2013 14:05:21 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:80987 Archived-At: > > You enable a custom theme. Then you disable it. The settings remain > > those of the "disabled" custom theme. Your initial state is not > > restored. >=20 > I tried >=20 > emacs -Q > M-x custom-themes RET > RET on the first theme to enable it > RET again to disable it >=20 > and the settings were apparently properly reset. Do you have a recipe > that triggers the problem? You skipped the first part: You start out with Emacs in your preferred 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') has been applied. A demonstration that disabling a custom-theme can put you back to the emacs -Q state is not too surprising. 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. Of course, that state is not *automatically* recorded anywhere. What's really missing, AFAICT, is the ability to take a snapshot of the state, which can then be restored at any time. As the bug says: AFAICT, there is no equivalent of such a snapshot with custom themes, and it's not clear how to create one. But please prove me wrong. 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. See the full description of the bug. And see the treatment in color-theme.el (not my library, BTW). There, you can take such a snapshot at any time. And it serves, in effect, more or less as a theme (a pseudo theme). As the bug report says: However, I do not see, for custom themes, what is an important feature of `color-theme.el': the ability to take a snapshot of the current settings (independent of how they were set, whether via themes or not) as something that can function as a (pseudo)theme. Compare these commands, which cycle among themes: 1. In doremi-cmd.el: `doremi-custom-themes+' vs `doremi-color-themes+'. 2. In icicles-cmd1.el: `icicle-custom-theme' vs `icicle-color-theme'. >From the doc string of `icicle-color-theme', this part about undoing: If you use `C-g' during this command, the previous color-theme snapshot is used to restore that color theme. Remember too that you can use the pseudo-theme [Reset] to restore the last theme: `M-x color-theme-select [Reset]'. By default, each time you invoke this command, a snapshot is first made of the current color theme (or current colors, if no theme is used). Thus, by default, if you use `C-g', the colors restored are those used before you changed themes using this command. However, if you use a prefix arg, then this command takes no new snapshot, unless no snapshot has ever been taken during this Emacs session. This can be useful when experimenting, to restore not to the state just before this command invocation, but to some previous snapshot. That part about the pseudo-them [Reset] is straight color-theme.el. It has nothing to do with Icicles. See color-theme.el for info about such a snapshot. >From the doc string of `icicle-custom-theme', by contrast: You can use `C-g' to quit and cancel changes by the command. Note, however, that some things might not be restored. `C-g' can only disable any themes that you applied. It cannot restore other customizations that enabling a theme might have overruled. This is a limitation of Emacs custom themes: you can disable them, but you cannot restore non-theme settings in effect before enabling a theme. Color themes (and command `icicle-color-theme') do not have this limitation. >From the doc string of `doremi-color-themes+': You can use `C-g' to quit and cancel changes made so far. Alternatively, after using `doremi-color-themes+' you can use `color-theme-select' and choose pseudo-theme `[Reset]' - that does the same thing. Note that in either case, some things might not be restored. >From the doc string of `doremi-custom-themes+': You can use `C-g' to quit and cancel changes made so far. Note, however, that some things might not be restored. `C-g' can only disable any themes that you applied. It cannot restore other customizations that enabling a theme might have overruled. ---- An additional problem with custom themes, compared with color themes, is that when multiple frames are present things become extremely slow (maybe exponentially wrt the number of frames? dunno). This alone makes cycling among custom themes almost unusable when there are multiple frames. And this is the case even when, as is done for these cycling commands, accumulation of custom themes is turned off. If, on the other hand, accumulation is allowed (the normal case for custom themes), then things really grind to a halt. A guess would be that this might be because custom themes record more information than color themes. But why this would make such a difference, and why it might be related to the number of frames in such a marked way, I have no idea. If you want to see the difference, just try, say, `doremi-custom-themes+' compared with `doremi-color-themes+', with several frames open. You need only the files doremi.el and doremi-cmd.el to try that. Both are on MELPA and on Emacs Wiki (as are the Icicles files).