emacs-devel
[Top][All Lists]
Advanced

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

Re: Tracking buffer positions across time, without markers (was Re: PL s


From: Clément Pit-Claudel
Subject: Re: Tracking buffer positions across time, without markers (was Re: PL support)
Date: Mon, 11 May 2020 10:18:09 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

On 10/05/2020 20.17, Vladimir Sedach wrote:
> 
> Clément Pit-Claudel <address@hidden> writes:
>> Since we don't know beforehand what positions the subprocess will
>> return, I don't think markers can help; right?
> 
> It sounds like the fundamental thing you need here is a function from
> the integers 1 to point-max of the buffer as it was when you sent
> its contents to the sub-process, to the integers 1 to point-max of
> the buffer as it is when the sub-process returns some results.

Yes, eactly, that's what I meant when I wrote "Visual Studio has a nice API for 
this: there is a way to snapshot a buffer, and to translate positions between 
two snapshots.  In my example, this allows you to translate 0:3 in the original 
buffer to 7:10 in the new one."

> Another refinement is to use Stefan's idea of delimiting unmodified
> intervals and only add properties in the modified interval.

Yes, I need to think more about that one :)

> A refinement would be to put the text property on tokens. Sticky text
> properties would do the right thing when changing identifier names.

Interesting idea.  At first I worried that this would be too costly, but 
font-lock uses text properties and is quite fast…
But wouldn't the process of mapping back from properties to spans of text be 
very costly?



reply via email to

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