From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#53636: 29.0.50; face-remapping broken on master Date: Sat, 05 Feb 2022 23:27:36 +0100 Message-ID: <871r0haqzr.fsf@gnus.org> References: <87o83tib13.fsf@gnu.org> <871r0p9l4f.fsf@gnus.org> <83ee4p9izg.fsf@gnu.org> <87mtjd8485.fsf@gnus.org> <83a6fd9glm.fsf@gnu.org> <835yq19dk1.fsf@gnu.org> <87czk97yt6.fsf@gnus.org> <8335l49jwu.fsf@gnu.org> <835ypz8zbm.fsf@gnu.org> <87fsp2v0ky.fsf@gnus.org> <83leyu73i8.fsf@gnu.org> <87k0edrvxm.fsf@gnus.org> <83sft15egx.fsf@gnu.org> <871r0loxr9.fsf@gnus.org> <83mtj85tm1.fsf@gnu.org> <87wnibn48c.fsf@gnus.org> <8335kz4tgu.fsf@gnu.org> <87ee4hg7g6.fsf@gnus.org> <83y22p21na.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4293"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 53636@debbugs.gnu.org, tsdh@gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 05 23:28:16 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 1nGTXU-0000wc-Jo for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Feb 2022 23:28:16 +0100 Original-Received: from localhost ([::1]:43746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGTXR-0001mO-Oo for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Feb 2022 17:28:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGTXG-0001mG-Us for bug-gnu-emacs@gnu.org; Sat, 05 Feb 2022 17:28:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41897) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nGTXG-0002mD-HQ for bug-gnu-emacs@gnu.org; Sat, 05 Feb 2022 17:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nGTXG-0003Y0-Ee for bug-gnu-emacs@gnu.org; Sat, 05 Feb 2022 17:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Feb 2022 22:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53636 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 53636-submit@debbugs.gnu.org id=B53636.164410007213617 (code B ref 53636); Sat, 05 Feb 2022 22:28:02 +0000 Original-Received: (at 53636) by debbugs.gnu.org; 5 Feb 2022 22:27:52 +0000 Original-Received: from localhost ([127.0.0.1]:35794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGTX6-0003XZ-C0 for submit@debbugs.gnu.org; Sat, 05 Feb 2022 17:27:52 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:49744) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGTX5-0003XM-8G for 53636@debbugs.gnu.org; Sat, 05 Feb 2022 17:27:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=XXGl9x2lNUpBiwZtbd1XEDQlw+JxqWYsk8xE8thaOaI=; b=FmIKRQE7SYyofBWfzum5GCExUz 7zFNDePal61tyZUCKRK7IasJgwqOYT4UMTWEajemTzTfhgTdqObnvLdSAy7wrq9Z8xEKmiSp7u9LI EVFWHLyyDbvEoxur6WFyTdrEocy3fXpn8XwLJcd2bdCtnkQCXtEVreH4l93VNJ2dngJU=; Original-Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nGTWs-0004TB-RA; Sat, 05 Feb 2022 23:27:44 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAIVBMVEX78dv9/e/S1dvG vre3x9iBgXagpaCLhnhfaGAxLiX///9a+C/aAAAAAWJLR0QKaND0VgAAAAd0SU1FB+YCBRYNAgLc Mc4AAAGjSURBVDjLndTPT8IwFAfwbvPgcTA08aYdAbk5qgWuSIxHMRmZN02zpzuqifHoj1C6m4mJ rv+thQ19AzTq99hP+95rFyAkj1VBcfO1yqq4C3t/BZX/gU2/EmCoD2bp9yn1h4swXTVpXC/BdNn3 +WkO1ifk+8XBMwabFnAsOqGFSvmkno/Uhc59gICTtRxi4OoClWqT4iYAPELgOsTuF9CIgjLM1hlA U1UwWM5MhAQuS0DIdp1uO0JO+AmCqm05gabNGzGW3RcMzo4fvNOtV5CTdAHshqReeisnVy/l5l4v o46+vZvsPsxuVgAh1Z5+8nSkxs1HdGJTOCLRKtU6zUqlNlSbJRpGOkv1GQaPcUj0CLRUSpemopR3 dRym93MomlcZY7sZQAIA0XAJDtutJ/NeO6hUbcBYL2Os9Wp2BOhEzZQwU0HyxjkUQOaglJKRZIyX wJSah5dKDcyn4+aYWOxxxIF1VawEh/gcT7Vvrh6FYWgaqQfXmrbIgcfqM/jZNxTKI4L172BzZOqP YJrLEL/VivwZ3JXgta3Vv3Nvz/rpL+ObfACVHLLUhFTUewAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAy Mi0wMi0wNVQyMjoxMzowMiswMDowMBA1cJkAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDItMDVU MjI6MTM6MDIrMDA6MDBhaMglAAAAAElFTkSuQmCC X-Now-Playing: Pink Floyd's _Wish You Were Here_: "Shine On You Crazy Diamond (Part 2)" In-Reply-To: <83y22p21na.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 05 Feb 2022 09:50:01 +0200") 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:226102 Archived-At: Eli Zaretskii writes: >> Sorry, I don't follow -- examples of what that had hundreds of faces? > > People reported they have hundreds of faces defined in their Emacs > sessions. See this message, for example: > > https://lists.gnu.org/archive/html/emacs-devel/2021-05/msg01031.html > > It reports to have 600 to 800 faces defined (with 129 in "emacs -Q"). But people aren't remapping all those faces, so the number of faces in total doesn't seem to matter that much here. (And looping over 800 faces to pick out dependencies is probably not very expensive.) > You'd need to loop through all those hundreds of faces for each change > in face-remapping-alist. Imagine what this will do to "C-x C-=" and > its ilk. It would have no impact on those ilks, because the looping will be done in `face-remap-add-relative' and nowhere else? >> If it's not, then extending defface to keep track of this >> information would be simple enough, too. > > Still a major complication, since inheritance is recursive. > > All that just to have one face that mode-line-* and header-line > etc. can inherit from? Doesn't this look like a tail wagging the dog? Well, fixing bugs is nice anyway. :-) So here's a reproducer for the first problem: These two forms, both from "emacs -Q", have different effects on the new frame: (progn (face-remap-add-relative 'mode-line 'link-visited) (make-frame)) vs (progn (face-remap-add-relative 'mode-line 'link-visited) (switch-to-buffer "*Messages*") (make-frame)) In the first case, the new frame will have mode-line remapped to link-visited in all windows, while in the latter it won't. So it looks like a pretty simple bug -- `make-frame' (when computing the faces for the new frame) is using the buffer-local value of `face-remapping-alist' instead of the global one. But after poking at the code for a couple minutes, I'm not sure where the computation for faces is done for new faces. Hm... is it `face-spec-recalc'? Hm... but that doesn't access `face-remapping-alist'... Is this done at a lower level? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no