all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Óscar Fuentes" <ofv@wanadoo.es>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 37802@debbugs.gnu.org
Subject: bug#37802: 27.0.50; Feature request: hook for theme enabling/disabling
Date: Fri, 20 May 2022 16:51:35 +0200	[thread overview]
Message-ID: <87fsl45kaw.fsf@telefonica.net> (raw)
In-Reply-To: <87fsl44gji.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 20 May 2022 12:58:09 +0200")

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Óscar Fuentes <ofv@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.





  reply	other threads:[~2022-05-20 14:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-18  0:29 bug#37802: 27.0.50; Feature request: hook for theme enabling/disabling Óscar Fuentes
2022-05-20 10:58 ` Lars Ingebrigtsen
2022-05-20 14:51   ` Óscar Fuentes [this message]
2022-05-21 12:56     ` Lars Ingebrigtsen
2022-05-21 13:07       ` Eli Zaretskii
2022-05-21 13:21         ` Lars Ingebrigtsen
2022-05-21 13:25           ` Eli Zaretskii
2022-05-21 13:26             ` Lars Ingebrigtsen
2022-05-21 16:49       ` Óscar Fuentes

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

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

  git send-email \
    --in-reply-to=87fsl45kaw.fsf@telefonica.net \
    --to=ofv@wanadoo.es \
    --cc=37802@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.