unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15687: 24.3.50; custom themes: disabling does not restore initial configuration
@ 2013-10-22 20:55 Drew Adams
  2013-11-26  2:14 ` Stefan Monnier
  2013-11-26 18:47 ` William G. Gardella
  0 siblings, 2 replies; 18+ messages in thread
From: Drew Adams @ 2013-10-22 20:55 UTC (permalink / raw)
  To: 15687


Dunno whether this is a bug or a missing feature (enhancement request).

Custom themes were presumably inspired from the color themes of library
`color-theme.el'.  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.

Here is a use case.  You tell me whether custom themes offer something
in this regard.

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.

You enable a custom theme.  Then you disable it.  The settings remain
those of the "disabled" custom theme.  Your initial state is not
restored.

It seems that disabling a theme is only relative to other custom themes.
Disabling does not undo the effect upon Emacs of enabling (in which case
it 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 was trivial to do: just take a
(pseudotheme) snapshot before cycling, and then restore the snapshot
upon C-g.

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.

Please let me know if I'm missing something.  If not already available,
please provide such a useful feature: the ability to record settings as
a (pseudo)theme that is not full-blown, e.g., is not associated with a
theme file etc.

If necessary, it would be OK if the function to create such a snapshot
pseudotheme specified the particular settings to record.  Another
possibility would be to record not the current dynamic Emacs state but
the user's initial state as defined by the `custom-set-variables' and
`custom-set-faces' sexps in `(or custom-file user-init-file)'.


In GNU Emacs 24.3.50.1 (i686-pc-mingw32)
 of 2013-10-19 on LEG570
Bzr revision: 114715 rgm@gnu.org-20131019023520-s8mwtib7xcx9e05w
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --enable-checking 'CFLAGS=-O0 -g3' CPPFLAGS=-DGLYPH_DEBUG=1'





^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2018-06-14 20:03 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-22 20:55 bug#15687: 24.3.50; custom themes: disabling does not restore initial configuration Drew Adams
2013-11-26  2:14 ` Stefan Monnier
2013-11-26 14:05   ` Drew Adams
2013-11-26 20:16     ` Stefan Monnier
2013-11-26 20:44       ` Drew Adams
2013-11-30  8:57         ` Glenn Morris
2013-11-30 17:10           ` Drew Adams
2014-11-05  3:48             ` Drew Adams
2018-06-14 19:53               ` Stefan Monnier
2013-11-26 14:08   ` Drew Adams
2013-11-26 18:47 ` William G. Gardella
2013-11-26 19:01   ` Drew Adams
2013-11-26 19:44     ` W. Greenhouse
2013-11-26 21:16       ` Drew Adams
2015-12-26  1:08         ` Lars Ingebrigtsen
2015-12-26  4:28           ` Drew Adams
2018-06-13 16:41             ` Basil L. Contovounesios
2018-06-14 20:03               ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).