From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Why is custom--inhibit-theme-enable not t by default? Date: Wed, 13 Jun 2018 07:22:24 -0700 (PDT) Message-ID: 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; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1528900125 30037 195.159.176.226 (13 Jun 2018 14:28:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 13 Jun 2018 14:28:45 +0000 (UTC) Cc: Eli Zaretskii , dancol@dancol.org, emacs-devel@gnu.org To: "Basil L. Contovounesios" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 13 16:28:41 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 1fT6lL-0007hb-QD for ged-emacs-devel@m.gmane.org; Wed, 13 Jun 2018 16:28:40 +0200 Original-Received: from localhost ([::1]:34758 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fT6nS-0000mu-SC for ged-emacs-devel@m.gmane.org; Wed, 13 Jun 2018 10:30:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fT6fb-0003r9-6S for emacs-devel@gnu.org; Wed, 13 Jun 2018 10:22:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fT6fZ-000333-PZ for emacs-devel@gnu.org; Wed, 13 Jun 2018 10:22:43 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:58574) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fT6fU-0002pm-T1; Wed, 13 Jun 2018 10:22:37 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w5DEJAW2168874; Wed, 13 Jun 2018 14:22:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=21K3zKgwsq+Z4awFFOS1BzDg5xeR3Y8pXwHQf4LRegw=; b=YNWAUTGz+mdN5fBF4iCwJqCzmZZkkDzMWW93nOOyx6aPs6jHTJFFZRnzlULsPGIZKvAl SdwAM4gIFxEausQlOSPzwNvU/dAxFrCDnA3ugfkmnFl2QLQqxErf1z9NYLvDnhm/utGC tsYflIUvMAq0USDmwdspUjOnPoWHJXuRjquXwerNOuSRRZBwOvBqXPBjtIYdR2VrSlvU LrQ4TSLYi3u4+S2/0cYbh+jKa7EJ8EG5YfOwFfUBcHb/PrYSrOnQsHJ4+HdHiRPqkoad 2dPLYW49/MQvEtDMjWu2hZxPoFvvMzeI8lDFHi3qhMC6nybn5/lUqZ9r3N5/bqpPx6C7 uA== Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2jk0xrgxgb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Jun 2018 14:22:27 +0000 Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w5DEMQLa022735 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Jun 2018 14:22:26 GMT Original-Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w5DEMPUQ005235; Wed, 13 Jun 2018 14:22:26 GMT In-Reply-To: <874li63iit.fsf@tcd.ie> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4690.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8922 signatures=668702 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806130154 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.78 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:226292 Archived-At: > 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.=20 https://www.emacswiki.org/emacs/CustomThemes#ComparedToColorThemes See bug #15687. https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D15687 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.