emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is custom--inhibit-theme-enable not t by default?


From: Stefan Monnier
Subject: Re: Why is custom--inhibit-theme-enable not t by default?
Date: Wed, 13 Jun 2018 23:26:53 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>   > > 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.
>
> Perhaps we should redesign the way themes work
> so that a theme is represented by data that says what it does,
> and we could turn it on and off.

I don't think we need to redesign them, really: we simply need to say
that loading the file won't enable the theme any more.  Also loading
such a file should not have any "visible" side effect (same rule as for
Elisp packages).

If a theme needs to run arbitrary code, it simply needs to define its
own global minor mode `my-foo-mode` and then within its custom settings,
it needs to set `my-foo-mode` to t.

Themes which follow these rules should work just fine in current
Emacsen, so we can simply introduce this new rule, just like we did
(a long time ago) when we decided that loading an Elisp file
should be harmless.

AFAICT the themes bundled with Emacs already obey the rule.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]