emacs-devel
[Top][All Lists]
Advanced

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

Re: emacs-tree-sitter and Emacs


From: Stefan Monnier
Subject: Re: emacs-tree-sitter and Emacs
Date: Mon, 30 Mar 2020 10:00:48 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>> I have gone through th0rex's pull request[2] and nothing suggests that
>> hooks are being used in order to do
>> the fontification of buffers, the only hook we have is
>> `tree-sitter--after-change', it does re-parsing and keeps
>> the tree updated
>
> Can you explain why an after-change hook is at all needed?

IIUC `tree-sitter--after-change` is not a function placed on
`after-change-function` but a hook which tree-sitter runs after its
parse tree has been changed.  The "tree-sitter-highlight" feature uses
this hook to be informed which parts of the buffer need to be
re-fontified after a change (which can be much more than just the part
of the buffer that was changed).


        Stefan




reply via email to

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