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: Disabling custom themes (was: Why is custom--inhibit-theme-enable not t by default?) Date: Wed, 13 Jun 2018 10:16:33 -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> <87602m1v94.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 1528910185 9410 195.159.176.226 (13 Jun 2018 17:16:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 13 Jun 2018 17:16:25 +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 19:16:21 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 1fT9Na-0002HY-Iz for ged-emacs-devel@m.gmane.org; Wed, 13 Jun 2018 19:16:18 +0200 Original-Received: from localhost ([::1]:35818 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fT9Ph-0006US-HH for ged-emacs-devel@m.gmane.org; Wed, 13 Jun 2018 13:18:29 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fT9O9-000680-9h for emacs-devel@gnu.org; Wed, 13 Jun 2018 13:16:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fT9O7-0000tD-Vg for emacs-devel@gnu.org; Wed, 13 Jun 2018 13:16:53 -0400 Original-Received: from aserp2130.oracle.com ([141.146.126.79]:46656) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fT9O3-0000Y1-UB; Wed, 13 Jun 2018 13:16:48 -0400 Original-Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w5DHDquY175781; Wed, 13 Jun 2018 17:16:37 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=RzwagCQkcz99rLZyHhF36NtmoJcAgnAAAgS5YQ1icQI=; b=pBmvzx+MvGAsosGD22GHv+69UwBbWhBg6yZfdQjte9UwBGEK43Puh2HP0c/q0fiAXTnA 1JgPSZ2A1At4MFqmpS+tXiAOH38AfSmyTxsxIfbKnSTVm5DzSHRZmMIt01CRNJ8xxZ4+ nfTg4QoudiSSuPdBf3LF8ECKrMZt0QvKgLHYEAoBVN/PITsIn/jJeLr3ngJ0ybkDMz3s HmLD3lWxm5NE/PV9uPhqBqmwZ0xLuyAqsuvZZ2ABhR22hjQYQDunaPzo6h3lv/269KdO KBfRegxDaMLAFXltc0S+qQ6ovlX8KFk3eqSB+6MqsiSagJZefsk7jGU6Uk0Rwx0xSl2V Jg== Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2jk0xqspr4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Jun 2018 17:16:37 +0000 Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w5DHGZup013633 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Jun 2018 17:16:36 GMT Original-Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w5DHGZeT010762; Wed, 13 Jun 2018 17:16:35 GMT In-Reply-To: <87602m1v94.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=8923 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=925 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806130184 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 141.146.126.79 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:226297 Archived-At: > 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. >=20 > Either way, thanks for the explanation and background. Thanks for reopening bug #15687. And from your post there I think you have understood. To try to clarify - I mean only that custom-theme enabling/disabling knows only about (custom) themes. It does not know about other user customizations, so it cannot restore them when it is disabled. What's missing is a function that captures the state of Emacs (anything that a custom state might modify) before any custom theme is applied, so that that state can be restored. Then you could (as you can with color themes) invoke that function to take a snapshot of your Emacs before "theming", and you could use that snapshot to restore your Emacs pretty much as it was before "theming". It's easy to understand if you look at what's possible with color themes. There, you can create a color theme (kind of a pseudo-theme, actually) at the outset, which records the current Emacs state as a snapshot, i.e., anything that might be recorded in a color theme. To restore the initial state you need only apply that (pseudo) color theme. Voila: back to what you started with, as much as is practicable. With custom themes, if the initial state before applying a custom theme has non-default frame parameters, faces, etc., and if you enable and then disable a custom theme, those user customizations are lost - not restored. You need to quit Emacs and restart it to get them back - and that works only if you saved those (non-theme) customizations. That's all. If you start by applying a custom theme to a virgin (`emacs -Q') session then you likely won't see the problem. But if you start from a customized Emacs you can. The use case is someone who has a customized Emacs (with those customizations saved or not), and who wants to try on some themes, to see what they look/act like. S?he can cycle among themes, trying them on one after another. But s?he cannot get back to what s?he started with. Why? Because there is no custom theme that captures that initial state, and disabling a custom theme just does so relative to other custom themes. The initial, default custom theme, called `user', is not a snapshot of the user's actual customizations (faces etc.). =20