From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?=C3=93scar?= Fuentes Newsgroups: gmane.emacs.bugs Subject: bug#37802: 27.0.50; Feature request: hook for theme enabling/disabling Date: Fri, 20 May 2022 16:51:35 +0200 Message-ID: <87fsl45kaw.fsf@telefonica.net> References: <87d0euopzw.fsf@telefonica.net> <87fsl44gji.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28066"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 37802@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 20 16:53:02 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ns3zv-000726-C8 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 May 2022 16:52:59 +0200 Original-Received: from localhost ([::1]:33552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ns3zt-00071g-W0 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 May 2022 10:52:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54210) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ns3z0-0006o8-IJ for bug-gnu-emacs@gnu.org; Fri, 20 May 2022 10:52:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45950) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ns3z0-0008Ul-9T for bug-gnu-emacs@gnu.org; Fri, 20 May 2022 10:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ns3z0-0003FK-5Z for bug-gnu-emacs@gnu.org; Fri, 20 May 2022 10:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=C3=93scar?= Fuentes Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 May 2022 14:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37802 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 37802-submit@debbugs.gnu.org id=B37802.165305830812460 (code B ref 37802); Fri, 20 May 2022 14:52:02 +0000 Original-Received: (at 37802) by debbugs.gnu.org; 20 May 2022 14:51:48 +0000 Original-Received: from localhost ([127.0.0.1]:39847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ns3ym-0003Eu-Fo for submit@debbugs.gnu.org; Fri, 20 May 2022 10:51:48 -0400 Original-Received: from relayout01.e.movistar.es ([86.109.101.201]:59261 helo=relayout01-redir.e.movistar.es) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ns3yh-0003EV-SH for 37802@debbugs.gnu.org; Fri, 20 May 2022 10:51:47 -0400 Original-Received: from sky (104.red-81-39-17.dynamicip.rima-tde.net [81.39.17.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 981711563@telefonica.net) by relayout01.e.movistar.es (Postfix) with ESMTPSA id 4L4V6c0CBszfb43; Fri, 20 May 2022 16:51:35 +0200 (CEST) In-Reply-To: <87fsl44gji.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 20 May 2022 12:58:09 +0200") X-TnetOut-Country: IP: 81.39.17.104 | Country: ES X-TnetOut-Information: AntiSPAM and AntiVIRUS on relayout01 X-TnetOut-MsgID: 4L4V6c0CBszfb43.A1558 X-TnetOut-SpamCheck: no es spam, clean X-TnetOut-From: ofv@wanadoo.es X-TnetOut-Watermark: 1653663096.25482@5zijhJ3BlN40G5AhIQOFJQ X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:232775 Archived-At: Lars Ingebrigtsen writes: > =C3=93scar Fuentes 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.