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: Tue, 22 Aug 2023 15:58:31 +0300 Message-ID: <834jkrters.fsf@gnu.org> References: <871qfv2zlk.fsf@localhost> <83a5ujtgfo.fsf@gnu.org> <87jztn1c5x.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2084"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65451@debbugs.gnu.org To: Ihor Radchenko , Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 22 14:59:16 2023 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 1qYQya-0000J9-7R for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Aug 2023 14:59:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYQyP-0005fT-Bu; Tue, 22 Aug 2023 08:59: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 1qYQyK-0005Fe-Gh for bug-gnu-emacs@gnu.org; Tue, 22 Aug 2023 08:59:00 -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 1qYQyJ-0003Yh-KB for bug-gnu-emacs@gnu.org; Tue, 22 Aug 2023 08:59:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qYQyM-0006Wg-Be for bug-gnu-emacs@gnu.org; Tue, 22 Aug 2023 08:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Aug 2023 12:59: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.169270911025046 (code B ref 65451); Tue, 22 Aug 2023 12:59:02 +0000 Original-Received: (at 65451) by debbugs.gnu.org; 22 Aug 2023 12:58:30 +0000 Original-Received: from localhost ([127.0.0.1]:58731 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYQxp-0006Vt-Jm for submit@debbugs.gnu.org; Tue, 22 Aug 2023 08:58:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51164) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYQxo-0006Vg-8M for 65451@debbugs.gnu.org; Tue, 22 Aug 2023 08:58:29 -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 1qYQxg-0003Ub-4L; Tue, 22 Aug 2023 08:58:20 -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=jtKuBnTiqmm/KuzD/SfB+7r+n+fZ8C8abeAWF37rcI8=; b=TcGPdCTRdegv wjEeUkcu3inx9zYn+Y/oMjQpWQCsC8G4LrkQozpRU9SkgxNxLpzJHfgPcr4t3NxicHLjrqm1ME1Gm BjWtqFmPl2hafHvP1/vT4CWpKqetv86xtR9zapqCYdrt69eHBgrS5GxO6k4VkBb0UwJ4pAl5lPy0Y xrEWMEuETHDfq9CubFxRXsjIdMN+f8fQTR8dG/ygJYeQ7V+TlxoanHAof6u6fuJ+VZ9/TaPgZCgyQ JTUGDJCUYKizrGsDoiOIreBR3pli7cnkwDeIb+fWiycGi2ExFSrBGn2h/J4SRLM2sdXpzEtG79OoK Azgq1U4Ij4JgqBqf1JKM7Q==; In-Reply-To: <87jztn1c5x.fsf@localhost> (message from Ihor Radchenko on Tue, 22 Aug 2023 12:42:18 +0000) 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:268168 Archived-At: > From: Ihor Radchenko > Cc: 65451@debbugs.gnu.org > Date: Tue, 22 Aug 2023 12:42:18 +0000 > > Eli Zaretskii writes: > > >> The order of after-change notifications thus do not correspond to the > >> order of buffer changes. Org mode is relying upon the correct change > >> order to update parser cache with buffer modifications. > > > > I think Org mode is relying on something it should not. > > Then, I'd like to point back to the previous discussion where I asked to > expose to Elisp information about buffer changes available to > tree-sitter. > https://yhetil.org/emacs-devel/83tu8jq2vl.fsf@gnu.org/ I don't want to do that, sorry. Not without a good understanding of what exactly do you need from that and in what way. If we will expose anything, it will have to be the minimum possible exposure, not the maximum, so I would like to understand this very well before I agree to any change in this direction. > If there is no guarantee that buffer modifications are not signaled in > order, on-the-fly updates of the parsed AST will become impossible for > Org, even if using markers (as you suggested in the linked thread). > > In fact, I am not sure if tree-sitter will behave correctly if it is > signaled changes in incorrect order. I will defer to Yuan, but tree-sitter doesn't use these hooks, we call its functions directly from insdel.c where needed. This makes sense for a library to which we link and whose interface code we control, but giving such access to Lisp (and Org on top of that) is out of the question. We don't even give such access to modules.