emacs-devel
[Top][All Lists]
Advanced

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

Re: How to add pseudo vector types


From: Yuan Fu
Subject: Re: How to add pseudo vector types
Date: Mon, 26 Jul 2021 15:45:56 -0400

>>>>> If we let TS look where it wants, we will lose the ability to restrict
>>>>> it to a certain part of the buffer text.  This is needed at least for
>>>>> some specialized modes, and is generally desirable, as it gives Lisp
>>>>> programs an easy way to impose such restrictions whenever they need.
>>>> 
>>>> Tree-sitter lets you set ranges for a parser to limit it self within, in 
>>>> order to support multi-language files.
>>> 
>>> That's okay, but why would we want to expose this to Lisp as the means
>>> to restrict the accessible portion, when we already have such a means?
>> 
>> Tree-sitter lets you set multiple discontinuous ranges, whereas narrowing 
>> can only narrow to a single continuous range. Multiple discontinuous range 
>> is much more useful for HTML+CSS+JS, or PHP + HML.
> 
> I understand.  But forcing various Emacs features to use these ranges
> where a simple restriction will do makes little sense.
> 
> Last time something like these discontinuous ranges was discussed as a
> general feature in Emacs, we couldn't come up with an agreed-upon
> design and implementation.  So adding something like that to Emacs is
> not an easy job.

We can provide both. Those who needs the more powerful ranges could use that, 
and those who don’t can use narrowing.

Yuan


reply via email to

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