[Top][All Lists]

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

Re: How to add pseudo vector types

From: Stephen Leake
Subject: Re: How to add pseudo vector types
Date: Thu, 29 Jul 2021 16:01:59 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (windows-nt)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Yuan Fu <casouri@gmail.com>
>> Date: Wed, 28 Jul 2021 13:47:42 -0400
>> Cc: Stephen Leake <stephen_leake@stephe-leake.org>,
>>  cpitclaudel@gmail.com,
>>  monnier@iro.umontreal.ca,
>>  emacs-devel@gnu.org
>> Could you describe the desired effect on tree-sitter when the buffer is 
>> narrowed?
> The behavior should be the same as if the text before and after the
> narrowed region didn't exist.

That would be true for the multi-major-mode use case, but not for the
temporarily narrow-to-defun case.

In other words, this should be up to the major mode to determine; the
low-level code should support either case (there are probably other use
cases out there).

>> If we just deny accessibility of the hidden region from tree-sitter,
>> tree-sitter is still aware of the hidden text, because it has
>> previously parsed the hidden text and stored the result in the parse
>> tree.
> The adherence to narrowing is for the use cases where TS is _always_
> invoked on the same narrowed region.  

right; the multi-major-mode case.

> You seem to be thinking about changes in the narrowing while TS is
> parsing, or between consecutive re-parsing calls, but I see no
> interesting/important use cases which would need to do that. And if
> there are some tricky cases which do need this, the respective Lisp
> programs will have to deal with the problem.


-- Stephe

reply via email to

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