[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: Fri, 30 Jul 2021 09:47:07 +0300

> From: Yuan Fu <casouri@gmail.com>
> Date: Thu, 29 Jul 2021 14:57:19 -0400
> Cc: Stephen Leake <stephen_leake@stephe-leake.org>,
>  Clément Pit-Claudel <cpitclaudel@gmail.com>,
>  Stefan Monnier <monnier@iro.umontreal.ca>,
>  emacs-devel@gnu.org
> >> Actually, that sounds like how it works in my code right now. After the 
> >> last few exchanges, I still have the feeling that we are not on the same 
> >> page. Could you have a look at the code in ts_ensure_parsed and 
> >> ts_record_change, and see if it aligns with what you consider to be the 
> >> right thing? If you have read them already and think you understand what 
> >> are they doing, could you tell me how exactly should these two functions 
> >> behave, in your opinion? Thanks.
> > 
> > Where do I find the latest version of the code?
> A few messages back I attached a patch, ts.5.patch. Actually I can just 
> attach it again, here.

That's not the whole code, that's a patch against some previous
version of the code.  So I cannot answer your questions with 100%
certainty, until I see the entire code of the TS support.  For
example, I'm not sure I have a clear idea when are the two functions
ts_ensure_parsed and ts_record_change called.

That said, it looks like the code is correct: you should record the
changes in the entire buffer, but only pass to TS the changes inside
the restriction BEGV..ZV that is in effect at the time of the re-parse
call.  Btw, I don't see the code that filters changes reported to TS
by their positions against the restriction; did I miss something?

And one more question: I understand that ts_read_buffer doesn't check
against BUF_BEGV_BYTE because TS never reads before the "visible beg"
position, is that right?  But if so, why do we need the similar test
for BUF_ZV_BYTE? could TS attempt to read beyond the "visible end"?


reply via email to

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