emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reliable after-change-functions (via: Using incremental parsing in E


From: Dmitry Gutov
Subject: Re: Reliable after-change-functions (via: Using incremental parsing in Emacs)
Date: Thu, 2 Apr 2020 00:21:36 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 01.04.2020 19:03, Eli Zaretskii wrote:
Cc:address@hidden,address@hidden,address@hidden,
  address@hidden
From: Dmitry Gutov<address@hidden>
Date: Wed, 1 Apr 2020 18:27:43 +0300

On 01.04.2020 17:10, Eli Zaretskii wrote:
But in any case, it should be trivially obvious that avoiding to parse
the entire buffer will make redisplay faster.  We should try doing
that instead of giving up, even if we think the current fontification
machinery is slow enough to make the parsing delay not so visible.
I think it's pointless to argue against the current design of TreeSitter
here, where none of its developers can read it.
If by TreeSitter you mean the parser (not the Emacs package which
interfaces it), then what I proposed is not against their design,
AFAIU.  They provide an API through which we can let the parser access
the buffer text directly, and they explicitly say that the parser is
tolerant to invalid/incomplete syntax trees.  And I don't see how it
could be any different, since when you start writing code, it takes
quite some time before it becomes syntactically complete and valid.

That makes sense, at least in theory. But I'd rather not break the usage assumptions of the authors of this library right away. And we'll likely want to adopt existing addons which use the result of the parse, which likely depend on the same assumptions.

Anyway, here's a (short) discussion on the topic of large files: https://github.com/tree-sitter/tree-sitter/issues/222



reply via email to

[Prev in Thread] Current Thread [Next in Thread]