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#46982: 28.0.50; after-change-functions in an indirect buffer are not called if the change is done while base buffer is active (and vice versa) Date: Thu, 16 Jun 2022 22:36:29 -0400 Message-ID: References: <87h7lnk2by.fsf@localhost> 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="2070"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 46982@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 17 04:37:21 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 1o21rL-0000IK-AM for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Jun 2022 04:37:19 +0200 Original-Received: from localhost ([::1]:41914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o21rJ-0004Io-RK for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 16 Jun 2022 22:37:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o21r3-0004Id-Ul for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2022 22:37:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49551) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o21r3-0007TA-Lf for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2022 22:37:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o21r3-00066C-Ii for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2022 22:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Jun 2022 02:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46982 X-GNU-PR-Package: emacs Original-Received: via spool by 46982-submit@debbugs.gnu.org id=B46982.165543340123399 (code B ref 46982); Fri, 17 Jun 2022 02:37:01 +0000 Original-Received: (at 46982) by debbugs.gnu.org; 17 Jun 2022 02:36:41 +0000 Original-Received: from localhost ([127.0.0.1]:43439 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o21qi-00065L-OK for submit@debbugs.gnu.org; Thu, 16 Jun 2022 22:36:40 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:35915) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o21qg-000657-02 for 46982@debbugs.gnu.org; Thu, 16 Jun 2022 22:36:39 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2E0D48077C; Thu, 16 Jun 2022 22:36:32 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id DB44A8051A; Thu, 16 Jun 2022 22:36:30 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1655433390; bh=5G+8fMteqrEaOVP2JOEZOQLv0y9x7MvTV3lmLeMgLmU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=NeNvG7H77XeSx/AtrBRAQQgUl10hiTzddHPugw1Eh/M+3Aiz/5HvxHgcWYDfuMiP0 5S7UM6iYE91i3F0Ee5e3e4Uh2ZMV+vIbZefkJ1eQP9wdtmaQpaZ2Uv18RghTqGX02J ABH34g/z/VyXDgV0G9atgtx6xXXc7CmfTD+g1eyOq1Hup277wtHo7fU+DKDTXaMNuy 8/LEbl3N5V0wxrfPJSfNhpkdCi6lc5+WTlQde9i8ydXHoJOWgnbsXYHwk77dqMJnnG vtzG8wLGfCpfvUKVDQsh7MqlIgFsH3dNFahGxvPRnzqzB9DQJzjBgNxeM/LX+GIRQM mlmQ7+FM5wrzw== Original-Received: from alfajor (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8EEB312045A; Thu, 16 Jun 2022 22:36:30 -0400 (EDT) In-Reply-To: <87h7lnk2by.fsf@localhost> (Ihor Radchenko's message of "Sun, 07 Mar 2021 12:36:01 +0800") 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:234665 Archived-At: > 1. emacs -Q > 2. M-x clone-indirect-buffer > 3. M-: (setq-local after-change-functions (append after-change-functions > '((lambda (&rest _) (message "Buffer 1"))))) > 4. C-x o > 5. M-: (setq-local after-change-functions (append after-change-functions > '((lambda (&rest _) (message "Buffer 2"))))) > 6. Type something. "Buffer 2" message is displayed. "Buffer 1" message > is _not_ displayed. > 7. C-x o > 8. Type something. "Buffer 1" message is displayed. "Buffer 2" message > is _not_ displayed. That's on purpose, yes. > The current behaviour can potentially break major modes using > after-change-functions if base buffer and indirect buffer do not have > the same major mode. It's currently the responsibility of the code that sets up the indirect buffer(s) to setup a `before/after-change-functions` in the base buffer that runs (some of) the `before/after-change-functions` in the indirect buffer(s) where they are needed. Stefan