[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#48736: 28.0.50; Regression in `enable-theme'
From: |
Mauro Aranda |
Subject: |
bug#48736: 28.0.50; Regression in `enable-theme' |
Date: |
Sun, 30 May 2021 09:40:46 -0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Daniel Mendler <mail@daniel-mendler.de> writes:
> On Emacs 27 the following snippet works as expected:
>
> ~~~
> (defun set-theme (theme)
> (mapc #'disable-theme custom-enabled-themes)
> (when theme
> (if (custom-theme-p theme)
> (enable-theme theme)
> (load-theme theme :no-confirm))))
>
> (set-theme 'deeper-blue)
> (set-theme 'leuven)
> (set-theme 'deeper-blue)
> ~~~
>
> On Emacs 28, the second call `(set-theme 'deeper-blue)` is ineffective
> and `deeper-blue` is not enabled. In contrast, the `set-theme` function
> works, if written as follows, indicating a regression in `enable-theme`.
>
> ~~~
> (defun set-theme (theme)
> (mapc #'disable-theme custom-enabled-themes)
> (when theme
> (load-theme theme :no-confirm)))
> ~~~
>
Hello Daniel, thanks for the bug report.
The regression is not in enable-theme, but in disable-theme, since it is
resetting all theme settings via custom-push-theme. I thought I had
fixed it in a follow up commit to this one:
commit 527413fb2ff8c073d89ee2d22d38a67c74678b27
Author: Mauro Aranda <maurooaranda@gmail.com>
Date: Fri Nov 6 09:34:08 2020 -0300
Go back to not using custom-push-theme when enabling a theme
* lisp/custom.el (enable-theme): Relying on custom-push-theme to
handle theme settings and prior user settings was a mistake. The
theme settings haven't changed between loading the theme and enabling
it, so we don't need all of what custom-push-theme does. However, we
still need to save a user setting outside of Customize, in order to be
able to get back to it, so do that in enable-theme itself.
But it looks like I didn't. Anyway, it should be fixed on master,
please confirm.