all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: "Basil L. Contovounesios" <contovob@tcd.ie>
Cc: Eli Zaretskii <eliz@gnu.org>, dancol@dancol.org, emacs-devel@gnu.org
Subject: RE: Why is custom--inhibit-theme-enable not t by default?
Date: Wed, 13 Jun 2018 07:22:24 -0700 (PDT)	[thread overview]
Message-ID: <d4ba7140-da4e-490d-bf6b-53d89e34d5f4@default> (raw)
In-Reply-To: <874li63iit.fsf@tcd.ie>

> 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.



  reply	other threads:[~2018-06-13 14:22 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12  4:14 Why is custom--inhibit-theme-enable not t by default? dancol
2018-06-12 15:23 ` Eli Zaretskii
2018-06-12 15:42   ` dancol
2018-06-12 16:37     ` Eli Zaretskii
     [not found]     ` <<83vaao3qrn.fsf@gnu.org>
2018-06-12 19:54       ` Drew Adams
2018-06-13 13:47         ` Basil L. Contovounesios
2018-06-13 14:22           ` Drew Adams [this message]
2018-06-13 16:55             ` Disabling custom themes (was: Why is custom--inhibit-theme-enable not t by default?) Basil L. Contovounesios
2018-06-13 17:16               ` Drew Adams
2018-06-13 17:21                 ` Disabling custom themes Eric Abrahamsen
2018-06-13 17:30                   ` Daniel Colascione
2018-06-14  2:34             ` Why is custom--inhibit-theme-enable not t by default? Richard Stallman
2018-06-14  3:26               ` Stefan Monnier
2018-06-14 14:21                 ` Drew Adams
2018-06-14 18:02                   ` Stefan Monnier
2018-06-14 18:16                     ` Drew Adams
2018-06-14 18:30                       ` Stefan Monnier
2018-06-14 18:41                         ` Basil L. Contovounesios
2018-06-14 20:09                           ` Stefan Monnier
2018-06-13 14:01     ` Basil L. Contovounesios
2018-06-17 21:31     ` Andy Moreton
2018-06-18 14:07       ` Andy Moreton
2018-06-19 14:49         ` Daniel Colascione
2018-06-12 18:24   ` Basil L. Contovounesios
2018-06-13  2:16   ` Richard Stallman
2018-06-13 13:56     ` Basil L. Contovounesios

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d4ba7140-da4e-490d-bf6b-53d89e34d5f4@default \
    --to=drew.adams@oracle.com \
    --cc=contovob@tcd.ie \
    --cc=dancol@dancol.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.