unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#48736: 28.0.50; Regression in `enable-theme'
@ 2021-05-30  3:06 Daniel Mendler
  2021-05-30 12:40 ` Mauro Aranda
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Mendler @ 2021-05-30  3:06 UTC (permalink / raw)
  To: 48736; +Cc: maurooaranda

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)))
~~~

In GNU Emacs 28.0.50 (build 12, x86_64-pc-linux-gnu, GTK+ Version
3.24.5, cairo version 1.16.0)
 of 2021-05-23 built on projects
Repository revision: 04e7c6da34df6b60e253a35b9baa3eba4062617f
Repository branch: icomplete-affixate
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux 10 (buster)





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

* bug#48736: 28.0.50; Regression in `enable-theme'
  2021-05-30  3:06 bug#48736: 28.0.50; Regression in `enable-theme' Daniel Mendler
@ 2021-05-30 12:40 ` Mauro Aranda
  2021-05-30 13:02   ` Daniel Mendler
  0 siblings, 1 reply; 4+ messages in thread
From: Mauro Aranda @ 2021-05-30 12:40 UTC (permalink / raw)
  To: Daniel Mendler; +Cc: 48736

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.





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

* bug#48736: 28.0.50; Regression in `enable-theme'
  2021-05-30 12:40 ` Mauro Aranda
@ 2021-05-30 13:02   ` Daniel Mendler
  2021-05-30 15:03     ` Mauro Aranda
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Mendler @ 2021-05-30 13:02 UTC (permalink / raw)
  To: Mauro Aranda; +Cc: 48736

On 5/30/21 2:40 PM, Mauro Aranda wrote:
> But it looks like I didn't.  Anyway, it should be fixed on master,
> please confirm.

Thank you for the quick fix! I confirm that it works.

Daniel





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

* bug#48736: 28.0.50; Regression in `enable-theme'
  2021-05-30 13:02   ` Daniel Mendler
@ 2021-05-30 15:03     ` Mauro Aranda
  0 siblings, 0 replies; 4+ messages in thread
From: Mauro Aranda @ 2021-05-30 15:03 UTC (permalink / raw)
  To: Daniel Mendler; +Cc: 48736

tags 48736 fixed
close 48736
quit

Daniel Mendler <mail@daniel-mendler.de> writes:

> On 5/30/21 2:40 PM, Mauro Aranda wrote:
>> But it looks like I didn't.  Anyway, it should be fixed on master,
>> please confirm.
>
> Thank you for the quick fix! I confirm that it works.
>
> Daniel

Thanks for confirming.





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

end of thread, other threads:[~2021-05-30 15:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-30  3:06 bug#48736: 28.0.50; Regression in `enable-theme' Daniel Mendler
2021-05-30 12:40 ` Mauro Aranda
2021-05-30 13:02   ` Daniel Mendler
2021-05-30 15:03     ` Mauro Aranda

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).