From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrew Hyatt Newsgroups: gmane.emacs.bugs Subject: bug#53294: 29.0.50; Indirect font changes incorrectly affecting original buffer Date: Sun, 16 Jan 2022 09:43:16 -0500 Message-ID: References: <835yqkyqzw.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2455"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 53294@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 16 15:44:11 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 1n96lP-0000Ub-In for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Jan 2022 15:44:11 +0100 Original-Received: from localhost ([::1]:35576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n96lO-0006hd-Jr for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 Jan 2022 09:44:10 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n96lG-0006eQ-Nm for bug-gnu-emacs@gnu.org; Sun, 16 Jan 2022 09:44:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49835) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n96lG-0001M6-E0 for bug-gnu-emacs@gnu.org; Sun, 16 Jan 2022 09:44:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n96lG-0007A3-DO for bug-gnu-emacs@gnu.org; Sun, 16 Jan 2022 09:44:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrew Hyatt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Jan 2022 14:44:02 +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.164234420527477 (code B ref 53294); Sun, 16 Jan 2022 14:44:02 +0000 Original-Received: (at 53294) by debbugs.gnu.org; 16 Jan 2022 14:43:25 +0000 Original-Received: from localhost ([127.0.0.1]:42738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n96ke-000796-MO for submit@debbugs.gnu.org; Sun, 16 Jan 2022 09:43:24 -0500 Original-Received: from mail-qk1-f181.google.com ([209.85.222.181]:35352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n96kd-00078q-Sw for 53294@debbugs.gnu.org; Sun, 16 Jan 2022 09:43:24 -0500 Original-Received: by mail-qk1-f181.google.com with SMTP id j85so16434607qke.2 for <53294@debbugs.gnu.org>; Sun, 16 Jan 2022 06:43:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=rrM+YT3U5PVUvfuTGHcVpHYur+r1JJipxXtjqMXGJrA=; b=DEZU38tQqvX6XmnxntLJuSLhsvJLl5xcm60mewYYPKPNcimrc6R+LOjTFGjIInwFMh tys/pQLl8xFyO4inYUp95fbv+JQTpLiu6XQwyed1nqxqqTVeSRK3f88cPzqqaaR0snV9 ogtpD6e9Z/GQ6qw65H9LtF+LKoPLysx2UzrflrwPH20HdIUT+q/J8d9UFkQWJ4vmFipK a02fLHz8X4xNu71aw2jMRrW/fmHiYbquIpG2dDOjMOycGjiiS7SaNlWcaKINR+AWkAdl VpEXX4ud/BNg0pGRQzegq8KGMhjWLZLAAfTwXYU1xaiGV28lMU/N9mgRctzOvpi4EZ/m C4zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=rrM+YT3U5PVUvfuTGHcVpHYur+r1JJipxXtjqMXGJrA=; b=RiAC9xfJbU8NREET2DraI3gKanRvrFxWrpRBbDdJGHil3dWkkTNCsF1jfrPd+Wn6FF i6LkUr1f2noVdcOje/MSC2+A/ZQx1uV1VI24SMQDdsqaqj3vDJ64xBReeOHJa7GBQ32V xG5jpiA5r2hm13VMOGq7e4BojxbBHGN5LVcQ2IQmhGO4nLAgkm4gbKxGmqr2bwTMLqXI EnSldXMdBa6ZF6CPCiibK+TuR4dEQAftK3YPK5h24Tty649RG4TSkrvnJZ4zL8KuvZbP RaW96ggs3P+pJOG5rs4rJ0XoXJIr/1TWhDxz3HCzHj7j+9kAITq7mmiF86fAtBb/fmmK 4eSQ== X-Gm-Message-State: AOAM531h1xRB7IDyhKZ9mZhu3FbhbsAcoHlxYwVPtduuoCEhSUQkLPsl GbGc0F40szsIjIgM4DmHCLIwmJQ8S5o= X-Google-Smtp-Source: ABdhPJzPVk+mmkRmV+KhYSAQjQ0tX1mNBJvKWKLmLRuSv/nmo2LpYxp2oWDRo959fbOqhda0hfvaaQ== X-Received: by 2002:a05:620a:1a97:: with SMTP id bl23mr12276965qkb.621.1642344197731; Sun, 16 Jan 2022 06:43:17 -0800 (PST) Original-Received: from andrews-mbp.lan (pool-173-56-75-166.nycmny.fios.verizon.net. [173.56.75.166]) by smtp.gmail.com with ESMTPSA id u9sm7688982qkp.116.2022.01.16.06.43.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jan 2022 06:43:17 -0800 (PST) In-Reply-To: <835yqkyqzw.fsf@gnu.org> 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:224387 Archived-At: On Sun, Jan 16, 2022 at 11:22 AM Eli Zaretskii wrote: >> From: Andrew Hyatt Date: Sun, 16 Jan 2022 >> 00:13:26 -0500 I noticed a bug recently where if I scale up >> fonts in an org capture buffer, it affects the original >> buffer, which keeps getting bigger and bigger every time >> org-capture is run. However, you don't need org to reproduce >> this. Here's a quick way to reproduce, which works with emacs >> -Q: (require 'face-remap) (defun ash/big-font () >> "Creates a font that is big enough for about 20 lines of >> text." (interactive) (let ((text-scale-mode-amount (/ >> (frame-height) 20))) >> (text-scale-mode 1))) >> >> (defun ash/reproduce-with-indirect-buffer () >> (interactive) (let ((buf (get-buffer-create "*Orig >> buffer*"))) >> (set-buffer buf) (variable-pitch-mode 1) ;; same way org >> mode creates indirect buffer (set-buffer >> (make-indirect-buffer buf "*Indirect buffer*" 'clone)) >> (ash/big-font-new) (kill-buffer (current-buffer)))) >> Running ash/reproduce-with-indirect-buffer will increase the >> indirect buffer in size each time. If you look at >> face-remapping-alist, it's clear that the original buffer's >> value is being altered by the indirect buffer. > > I don't think I understand what I should see and pay attention > to with this recipe (and it includes several errors that took me > some time to fix, before I could run it), but isn't this because > you used non-nil CLONE argument to make-indirect-buffer? Sorry for any errors, I simplified it a bit before I sent it out and perhaps made a few mistakes. What you should see, if you go the *Orig Buffer*, is that the font scale keeps increasing. If you look at the face-remapping-alist of that buffer, it will be growing with duplicate height specs, one for every time you called the ash/reproduce-with-indirect-buffer. Yes, the non-nil CLONE argument is essential to reproduce. But that just means the indirect buffer will inherit the state from the direct buffer. It doesn't imply that changes made to the indirect buffer's state will affect the original buffer, which is what is happening here.