From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#65451: 30.0.50; `after-change-functions' are not triggered in the same order the changes are made Date: Sat, 30 Mar 2024 17:11:02 +0300 Message-ID: <86frw7dd3d.fsf@gnu.org> References: <871qfv2zlk.fsf@localhost> <83a5ujtgfo.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32791"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, yantar92@posteo.net, 65451@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 30 15:12:18 2024 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 1rqZRR-0008IC-So for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Mar 2024 15:12:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqZRF-0003o5-C8; Sat, 30 Mar 2024 10:12:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqZRB-0003nn-Jm for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 10:12:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rqZRB-0000t2-BZ for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 10:12:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rqZRD-0002Zt-45 for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 10:12:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Mar 2024 14:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65451 X-GNU-PR-Package: emacs Original-Received: via spool by 65451-submit@debbugs.gnu.org id=B65451.17118078809740 (code B ref 65451); Sat, 30 Mar 2024 14:12:02 +0000 Original-Received: (at 65451) by debbugs.gnu.org; 30 Mar 2024 14:11:20 +0000 Original-Received: from localhost ([127.0.0.1]:45926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqZQV-0002X2-GZ for submit@debbugs.gnu.org; Sat, 30 Mar 2024 10:11:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqZQS-0002Wm-OX for 65451@debbugs.gnu.org; Sat, 30 Mar 2024 10:11:17 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqZQK-0000pZ-4v; Sat, 30 Mar 2024 10:11:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=wxMiB2NK6HWmQgrwQXEms5BLgkBaRAQN9+BTMOoeZ+U=; b=BdgU+y3qDU6O UXcFKcCIq+WF2ExH+cicmmzhnJjQkd0cBVHELrSpVe9dpyLdly4Mn32SMPVBaOzXtP5iOuLycSOGC 2Jp4OtmUD5NyR4+f18XdJj7nXttjw3b/YAtWFehwUEQZ4gIYH10Q8NWUQDzF1QhTobiGl3XxVjUqF wSpXdf+UgS0r1Co40H6ecBBuAt8W+TkU10hlUz9qDD0MyvVHUKhOViXEgDLPC8MwXyKX81218f29d D6EwLDwMbdW4VVrVoB0IVCeQUCButt1rWj4EVjq8mm90qciL13ioftbx1gcbK3IWES0bH6SGkxshu w4llKfvM7ACOT7QZ/NmQjg==; In-Reply-To: (message from Stefan Monnier on Sat, 30 Mar 2024 09:51:59 -0400) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:282371 Archived-At: > From: Stefan Monnier > Cc: Ihor Radchenko , 65451@debbugs.gnu.org, Alan > Mackenzie > Date: Sat, 30 Mar 2024 09:51:59 -0400 > > > I think Org mode is relying on something it should not. This > > particular use case aside, Emacs is allowed to call a function that > > changes the buffer from a function that itself changes the buffer, and > > it is allowed to call that inner function _before_ it did all the > > changes it intended to do. > > AFAIK the above sequences breaks the promise we make about > `before-change-functions` and `after-change-functions`. > > Almost all the non-trivial users of those hooks (i.e. basically those > that need to use both hooks) have extra sanity and raise the heads up in > despair when faced with things like the above (my `track-changes.el` > lacks such sanity checks, but that's because it's a PoC). I still stand by my opinion: Org is relying on something it cannot rely upon, not as long as a function that changes a buffer can be called from another function which changes the same buffer. I don't see how we can avoid breaking code which relies on such assumptions, not in general anyway.