unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: Daniel Mendler <mail@daniel-mendler.de>
Cc: 48736@debbugs.gnu.org
Subject: bug#48736: 28.0.50; Regression in `enable-theme'
Date: Sun, 30 May 2021 09:40:46 -0300	[thread overview]
Message-ID: <87r1hos8c1.fsf@tbb.theblackbeard.org> (raw)
In-Reply-To: <4c28cdc6-3014-7fe6-52ec-9bab0ad395fb@daniel-mendler.de> (Daniel Mendler's message of "Sun, 30 May 2021 05:06:55 +0200")

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.





  reply	other threads:[~2021-05-30 12:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-30  3:06 bug#48736: 28.0.50; Regression in `enable-theme' Daniel Mendler
2021-05-30 12:40 ` Mauro Aranda [this message]
2021-05-30 13:02   ` Daniel Mendler
2021-05-30 15:03     ` Mauro Aranda

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r1hos8c1.fsf@tbb.theblackbeard.org \
    --to=maurooaranda@gmail.com \
    --cc=48736@debbugs.gnu.org \
    --cc=mail@daniel-mendler.de \
    /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 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).