[Top][All Lists]

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

Re: How to add pseudo vector types

From: Eli Zaretskii
Subject: Re: How to add pseudo vector types
Date: Tue, 27 Jul 2021 16:59:37 +0300

> From: chad <yandros@gmail.com>
> Date: Mon, 26 Jul 2021 12:48:00 -0700
> Cc: Yuan Fu <casouri@gmail.com>, Clément Pit-Claudel <cpitclaudel@gmail.com>, 
>       Stephen Leake <stephen_leake@stephe-leake.org>, Stefan Monnier 
> <monnier@iro.umontreal.ca>, 
>       EMACS development team <emacs-devel@gnu.org>
> I think I understand your point, and I agree that it would be ill-advised to 
> remove the ability to change the
> "scope" in question from lisp's control. What I'm trying to say (and I think 
> Yuan Fu is also suggesting) is that
> while emacs necessarily has *one* view of the buffer, narrowed or not, 
> tree-sitter might want to maintain
> multiple trees of that buffer, with the default being the same as emacs' 
> widened view, and narrowed views
> being separate parse trees created as needed.

Lisp programs which use TS in a way that causes TS to store such
multiple views will have to widen the buffer at strategic places (when
TS needs access to buffer text).

> I'm suggesting this as an alternative to having emacs+ts
> effectively throw away most of the parse tree every time the user narrows, 
> then have to re-build it on each
> widen.

No one says that when Emacs narrows a buffer for some reason, we need
to communicate that immediately to TS.  If the restriction is
ephemeral, it will most probably be lifted by the time we need to
update TS with the editing changes.

reply via email to

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