Subject: bug#77215: 31.0.50; enable-theme-functions fires twice after a load-theme

From: Filippo Argiolas <[email-masked]>
Date: Tue, 25 Mar 2025 06:22:17 +0100

Mauro Aranda <[email-masked]> writes:

> Filippo Argiolas <[email-masked]> writes:
>
>  > Hi,
>  >
>  > I noticed that my `enable-theme-functions' hook always fires twice
>  > after either a `load-theme' or a `enable-theme'.
>  >
>  > Problem is `enable-theme' in custom.el always also enables the user
>  > theme to push it on top of the list.
>  >
>  > Is this desired?
>  >
>  > Technically I'd say it's correct, two enables spark two hooks, but
>  > from the user point of view seems a counterintuitive side effect
>  > without digging into the code.
>  >
>  > Filippo
>
> I think it would be good to avoid it.  The attached patch does that.

Thanks, looks good to me and it fixes the problem here.

Filippo