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

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Yuan Fu <casouri <at> gmail.com>, 78402 <at> debbugs.gnu.org
Subject: bug#78402: treesit after-change-functions
Date: Mon, 19 May 2025 09:38:40 +0300
>> 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).

> +  (if backward
> +      (treesit-update-ranges bound (point))
> +    (treesit-update-ranges (point) bound))

This also requires turning markers into integers before:

  (when (markerp bound) (setq bound (marker-position bound)))




This bug report was last modified 10 days ago.

Previous Next


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