From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko 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 13:41:17 +0000 Message-ID: <87v8d7i48y.fsf@localhost> References: <871qfv2zlk.fsf@localhost> <83a5ujtgfo.fsf@gnu.org> <87jztn1c5x.fsf@localhost> <834jkrters.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29978"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Yuan Fu , 65451@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 22 15:41:24 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 1qYRdK-0007co-QS for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Aug 2023 15:41:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYRd2-00063e-1Z; Tue, 22 Aug 2023 09:41:04 -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 1qYRcz-0005yr-0f for bug-gnu-emacs@gnu.org; Tue, 22 Aug 2023 09:41:02 -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 1qYRcx-0006jA-GD for bug-gnu-emacs@gnu.org; Tue, 22 Aug 2023 09:41:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qYRd0-0007ZS-9k for bug-gnu-emacs@gnu.org; Tue, 22 Aug 2023 09:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Aug 2023 13:41: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.169271166029087 (code B ref 65451); Tue, 22 Aug 2023 13:41:02 +0000 Original-Received: (at 65451) by debbugs.gnu.org; 22 Aug 2023 13:41:00 +0000 Original-Received: from localhost ([127.0.0.1]:58771 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYRcx-0007Z4-Ms for submit@debbugs.gnu.org; Tue, 22 Aug 2023 09:41:00 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:45021) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYRcu-0007Yq-NY for 65451@debbugs.gnu.org; Tue, 22 Aug 2023 09:40:57 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id EB658240101 for <65451@debbugs.gnu.org>; Tue, 22 Aug 2023 15:40:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1692711648; bh=BURI7u/uy+X+xSSYTVB9f3QwLoyLrQcrWfLwsuVQNDc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=WxInbUb1IX5UeYhI5F3YtU2lU+mYelxZmkj78DFf77n2hj+aG3i/OWGERycVsdgbO 4YJgniFrDzatzLUb5Slp7WODOdNP5WHlq8SpAghbT/FriHZ1x2rwOi5/IPlVDcM56j rHsSmz5XgWy2QkhASH1nkfCegLVvvr3ZUb4wkOC1ztdDE/r3IcpJnTqUEnKPWhvGbq wHGiyeMZgdiBJUtek5zeWh8AZMGU3/oG2a6IA6v7vq0hMXVESErvZX67U9NLJ9NzZ1 dVtW/GD5W5hXbbXqkX1/v2L8KEUdbrReXIK81bgoJK0SfunR/ao145QRM7beg2eTfq uYRJ5IJk+2qkw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RVVq30l2zz6tm4; Tue, 22 Aug 2023 15:40:46 +0200 (CEST) In-Reply-To: <834jkrters.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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:268174 Archived-At: Eli Zaretskii writes: >> 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. Org wants to do the same thing tree-sitter does - keep parsed AST in sync with buffer modifications without having to re-parse the whole buffer. So, we basically need the same information tree-sitter needs - the sequence of buffer text changes, in their order. Note that the markers discussed in the thread I linked are not sufficient. When editing near AST node boundaries, even if the boundaries are represented by markers, we have to re-parse the AST around to account for the possible structural changes. So, information about buffer edits is still required. >> 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. I hope that we can solve this issue one way or another. This currently breaks the very core functionality of Org. Every part of Org relies on it to obtain reasonable performance. Prior to using cache, we had orders of magnitude slowdowns. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at