Subject: bug#76685: 30.1; custom--inhibit-theme-enable

From: Mauro Aranda <[email-masked]>
Date: Tue, 4 Mar 2025 16:41:52 -0300

João Guerra <[email-masked]> writes:

 > Hello, would it be possible to expose the functionality of
 > custom--inhibit-theme-enable as a user option, in some form?

Something like this has been discussed before:
https://lists.gnu.org/archive/html/emacs-devel/2018-06/msg00374.html

We don't act upon a call to custom-theme-set-faces immediately, to avoid
applying the theme's settings when loading it.  And it looks to me
that we don't want to make that customizable, since it's bad practice
for a package (theme or not) to have effects just because of loading it.

 > The default behavior, where modifying a loaded and enabled theme
 > requires re-enabling it to see the changes, may feel counterintuitive
 > to some users.
 >
 > Allowing immediate visual feedback when evaluating
 > custom-theme-set-faces would make theme customization easier.

So the use case would be:
The user already loaded and enabled a theme (via load-theme and
enable-theme) and then, while the theme is enabled, he/she wants to
reevaluate a custom-theme-set-faces and see its effect immediately?

Perhaps we can handle that use case by specializing
custom--should-apply-setting a bit more, without a need to expose
custom--inhibit-theme-enable.