GNU bug report logs - #37802
27.0.50; Feature request: hook for theme enabling/disabling

Previous Next

Package: emacs;

Reported by: Óscar Fuentes <ofv <at> wanadoo.es>

Date: Fri, 18 Oct 2019 00:30:02 UTC

Severity: wishlist

Tags: moreinfo

Found in version 27.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #13 received at 37802 <at> debbugs.gnu.org (full text, mbox):

From: Óscar Fuentes <ofv <at> wanadoo.es>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 37802 <at> debbugs.gnu.org
Subject: Re: bug#37802: 27.0.50; Feature request: hook for theme
 enabling/disabling
Date: Fri, 20 May 2022 16:51:35 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Óscar Fuentes <ofv <at> wanadoo.es> writes:
>
>> I'm experimenting with some code that uses face-remap-add-relative to
>> modify colors on specific windows. It takes the attribute of an existing
>> face, alters it and uses :filtered to apply the change conditionally. On
>> my specific case I use that technique for darkening the default
>> background of the windows that have no keyboard focus.
>>
>> However, when I switch themes I have to manually force the recalculation
>> of the "darked" background to adapt it to the new theme. If I had a hook
>> that fires *after* a theme is enabled or disabled, I could automatize
>> the recalculation.
>>
>> I looked at custom.el and the change seems simple enough so I wonder if
>> there is any reason for not implementing such hook.
>
> (I'm going through old bug reports that unfortunately weren't resolved
> at the time.)
>
> If this is for a package, I think it might make more sense to use
> `advice-add' on `enable-theme'?  But I wouldn't mind adding a an
> `enable-theme-hook' here, if that makes things substantially easier for
> your use case.

Currently I've solved my requirement by using defadvice on enable-theme
*and* disable-theme for adapting my custom faces to changes on the
active theme(s). Using a hook would be a little bit cleaner. I'm also
surprised that no hook was implemented for this case, as most changes on
user-visible state has an associated hook.

Whatever you decide, it is fine with me.




This bug report was last modified 2 years and 360 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.