GNU bug report logs - #78402
treesit after-change-functions

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Tue, 13 May 2025 06:34:02 UTC

Severity: normal

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 78402 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 78402 <at> debbugs.gnu.org
Subject: Re: bug#78402: treesit after-change-functions
Date: Wed, 21 May 2025 00:21:39 -0700

> On May 20, 2025, at 11:35 PM, Juri Linkov <juri <at> linkov.net> wrote:
> 
>>>> Btw, what’s the issue we’re trying to fix here? If some lisp want to have
>>>> up-to-date ranges, it can just call treesit--pre-redisplay or
>>>> treesit-update-ranges. Why do we get the node-outdated error?
>>> 
>>> Hmm... so what you're saying is that we should do something like the
>>> patch below?
>> 
>> Maybe Yuan could confirm if `treesit-update-ranges`
>> is already optimized for frequent calls on overlapping ranges
>> that don't need updating and where 'beg' and 'end' fall back
>> to (point-min) and (point-max).
> 
> It seems not optimized since in my tests outline-minor-mode
> is much slower with this change.

Hey, sorry for the delay. I've been busy with real life. As you said, `treesit-update-ranges` doesn’t have any optimization for repeated calls. OTOH, `treesit--pre-redisplay` has optimization for repeated calls while buffer content doesn’t change. Maybe the patch can use that instead?

Yuan



This bug report was last modified 2 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.