From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#53294: 29.0.50; Indirect font changes incorrectly affecting original buffer Date: Mon, 17 Jan 2022 16:47:08 -0500 Message-ID: References: <835yqkyqzw.fsf@gnu.org> <83lezfybc9.fsf@gnu.org> <83ilujy9fi.fsf@gnu.org> <837dazy2ah.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37932"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: ahyatt@gmail.com, 53294@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 17 22:48:24 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 1n9ZrS-0009bi-0j for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 Jan 2022 22:48:22 +0100 Original-Received: from localhost ([::1]:50714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9ZrQ-0007Ir-S0 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 Jan 2022 16:48:20 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9Zr8-0007IW-I1 for bug-gnu-emacs@gnu.org; Mon, 17 Jan 2022 16:48:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55444) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n9Zr8-0000Xq-8K for bug-gnu-emacs@gnu.org; Mon, 17 Jan 2022 16:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n9Zr7-0007gm-Up for bug-gnu-emacs@gnu.org; Mon, 17 Jan 2022 16:48:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Jan 2022 21:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53294 X-GNU-PR-Package: emacs Original-Received: via spool by 53294-submit@debbugs.gnu.org id=B53294.164245604229403 (code B ref 53294); Mon, 17 Jan 2022 21:48:01 +0000 Original-Received: (at 53294) by debbugs.gnu.org; 17 Jan 2022 21:47:22 +0000 Original-Received: from localhost ([127.0.0.1]:48347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9ZqU-0007eB-Gq for submit@debbugs.gnu.org; Mon, 17 Jan 2022 16:47:22 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:33094) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n9ZqO-0007ds-9j for 53294@debbugs.gnu.org; Mon, 17 Jan 2022 16:47:20 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B826A4424D2; Mon, 17 Jan 2022 16:47:10 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 46DC74424CC; Mon, 17 Jan 2022 16:47:09 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1642456029; bh=bMQIjQndQarwrbKJI3LWE3axHMq826VqGXxn+cXDGV4=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=iw83NEHlwsIdq8S/fwnqBDDb1ayMYAepwbs9o+P2u2rvg5Xcqk0vzr5euiLODneKB 4XjAUg8YIQeQBEJ1SIJsxoPeZA8ZJf2h2Po0DkS3dcEpPZ4jPOxkpi33QEJb0lIMSc Yig9OvspcqJsYaSGJ45vZJ0aC2BhRNJbRuPixmOWlJjFHZdEcdKz4ijhPIw57JANfs saJuOxtIwmQInaBpV6FhVkrkA5wMFch4JPSuP/O8M/E9WaziKoAJzDhnWUrqETNvvq NIupIw0OuimU0B+h333qf2LXb8HjG0VJpxtHonLmmgAzhdSdvx/curSmP3qytygFjt Vt2xix44SPz/Q== Original-Received: from alfajor (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3B1DC1202BE; Mon, 17 Jan 2022 16:47:09 -0500 (EST) In-Reply-To: <837dazy2ah.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 16 Jan 2022 20:16:06 +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:224484 Archived-At: >> - In `face-remap.el`, refrain from modifying the `face-remapping-alist` >> by side-effects (i.e. avoid `delq`, `setcdr`, and friends). >> >> - Add a `make-indirect-buffer-hook` and arrange for `face-remap.el` to >> add a function there that does a deep enough copy of >> `face-remapping-alist`. >> >> - Remember that indirect buffers are an attractive nuisance and should >> be deprecated (but note that I suspect the same bug affects >> `clone-buffer` because it doesn't make a deep enough copy of >> `face-remapping-alist` either). > > The last one tells me we are better with leaving this sleeping dog > lie. Actually, looking back at the code, I see we already have the needed hook (tho called from `clone-indirect-buffer`), so I think the better option is to change `make-indirect-buffer` so it runs `clone-indirect-buffer-hook` (when called with a non-nil `clone` arg) instead of having `clone-indirect-buffer` run it. And then in `face-remap.el` add a function to that hook which copies `face-remapping-alist`. An intermediate option is to change the Org code to use `clone-indirect-buffer` instead of `make-indirect-buffer` (but that still requires the `face-remap.el` addition to the hook). [ Sorry Andrew for not noticing your earlier patch which does something similar to my first suggestion above. ] Andrew, would you be willing to write that patch? Stefan