all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: wgreenhouse@riseup.net (W. Greenhouse)
To: Drew Adams <drew.adams@oracle.com>
Cc: wgg2@member.fsf.org, 15687@debbugs.gnu.org
Subject: bug#15687: 24.3.50; custom themes: disabling does not restore initial configuration
Date: Tue, 26 Nov 2013 19:44:48 +0000	[thread overview]
Message-ID: <8761rf9ccv.fsf@motoko.kusanagi> (raw)
In-Reply-To: <e8fd319e-7f56-49ee-9a5f-93022c281740@default> (Drew Adams's message of "Tue, 26 Nov 2013 11:01:53 -0800 (PST)")

Drew Adams <drew.adams@oracle.com> writes:

> Please read the bug report.  It includes the case where all themes
> that have ever been applied have since been disabled.  That does not
> restore all other customizations that were in effect before theming.
> That's all.

I read the bug report in detail.  Despite its length, it failed to
provide a minimal recipe for reproducing the bug.  Without it, I
essentially had to read your mind.  What I have been able to discover on
my own is that Custom themes do not prevent you from easily and
completely restoring faces altered with M-x customize.  I was able to do
so in my example.

> If you need a recipe, emacs -Q, load oneonone.el, then doremi.el and
> doremi-cmd.el.  Then cycle among themes, using `doremi-custom-themes+'.
> Use `C-g' to cancel.  The initial state is not restored.  Nothing
> close to it.  Not for any existing frames.

Since I was able to revert in the same frame completely without these
libraries, I think the problem lies not in the implementation of Custom
themes but rather the implementation for changing them in these
libraries.  To achieve a clean slate, `doremi-custom-themes' should do
exactly what `customize-themes' does: if
`custom-theme-allow-multiple-selections' is nil, `disable-theme' should
be called for every element in `custom-enabled-themes' before enabling a
new one.

> Sure, if you then create a new frame, things will look generally OK
> in that frame.  But the state of any existing frames has been altered
> and not restored.  Disabling a theme does not undo its effect wrt
> Emacs in general.  It simply disables one theme wrt other themes
> (including wrt all other themes).

Disabling a theme undoes its effect with respect to any setting made
through M-x customize.

> In addition, I see no way to take a snapshot of the current Emacs
> state as a theme, or even as a pseudo theme, to which one can revert.

(customize-create-theme) is roughly equivalent to
`color-theme-make-snapshot'.  It fills out a Custom theme using Emacs's
current state as a basis.

> This is something that is trivial with color themes - just call
> `color-theme-make-snapshot'.
>
> Try the same thing, but with command `doremi-color-themes+'.
> No problem.

As I alluded to in the last post, I think the problem lies in UI and
user expectations rather than underlying implementation.  I was never
able to get color-theme.el themes to undo themselves cleanly, because I
hadn't discovered `color-theme-make-snapshot' or your functions taking
advantage of it.

As far as I can determine from testing from emacs -Q, Custom themes
adhere to what (info "(emacs) Custom Themes") says they adhere to:

>    Any customizations that you make through the customization buffer
> take precedence over theme settings.  This lets you easily override
> individual theme settings that you disagree with.  If settings from two
> different themes overlap, the theme occurring earlier in
> `custom-enabled-themes' takes precedence.  In the customization buffer,
> if a setting has been changed from its default by a Custom theme, its
> `State' display shows `THEMED' instead of `STANDARD'.

Stuff set through Customize (whether before or after loading Custom
themes) survives enabling a theme, and those customizations will still
be there when any/all themes are disabled.  And in my own setup, which
is fairly complicated (an Emacs that's also subject to ~/.Xresources
theming as well as theming by elisp), frames do "return to normal" when
all themes are disabled.

I don't think Custom themes guarantee anything for settings made
otherwise than through M-x customize; for that case you could use
(customize-create-theme) similarly to how you'd use
(color-theme-make-snapshot) to make a point to reverse to.

--
Best,
WGG





  reply	other threads:[~2013-11-26 19:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=8761rf9ccv.fsf@motoko.kusanagi \
    --to=wgreenhouse@riseup.net \
    --cc=15687@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=wgg2@member.fsf.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.