[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 19:59:51 +0300

> Date: Tue, 27 Jul 2021 18:50:40 +0200
> From: Ergus <spacibba@aol.com>
> Cc: Eli Zaretskii <eliz@gnu.org>,
>       Clément Pit-Claudel <cpitclaudel@gmail.com>,
>       Stephen Leake <stephen_leake@stephe-leake.org>,
>       Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
> On Tue, Jul 27, 2021 at 10:49:44AM -0400, Yuan Fu wrote:
> >You mean adding syntactic information to the text as text properties?
> >That’s an interesting idea, maybe that’s easier to use than using
> >tree-sitter’s api.
> >
> I think that was the initial Eli's idea when this topic came out. But
> maybe I understood it wrongly.
> Theoretically in a re-parse doing ts_tree_get_changed_ranges will give
> the list of changes needed in the whole text, so updating properties
> there may be simpler and cheap (even when they are not in the visible
> part of the buffer).
> Also, any action that doesn't modify the text (scrolling, moving the
> cursor, windows split/resize) won't call any tree-sitter and redisplay
> could handle almost everything easily on the beginning.
> The only concern here may be that adding properties to the entire text
> may be memory consuming. Or maybe that this could overlap part of the
> font-lock functionality.
> But probably Eli can make a more accurate critic of this idea..

Storing the syntactic information as text properties has definite
advantages: easy access, use of well-known Emacs Lisp features, etc.
I don't feel I know enough about this use of the properties to have a
definitive opinion, though.  We should probably try that.

reply via email to

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