[Top][All Lists]

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

Re: [SPAM UNSURE] Re: How to add pseudo vector types

From: Eli Zaretskii
Subject: Re: [SPAM UNSURE] Re: How to add pseudo vector types
Date: Thu, 22 Jul 2021 09:44:45 +0300

> Cc: emacs-devel@gnu.org
> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
> Date: Thu, 22 Jul 2021 01:09:13 -0400
> > But how would the "launched parse" access the buffer text if it runs
> > in parallel to normal editing?  We've discussed the difficulties with
> > that, and you seem to ignore them here?
> Lots of magic handwaving:

Hand-waving always works, of course.

> > Which means the results will many times be slightly wrong, because the
> > parse info you use is outdated?
> Maybe.  In practice if the delay between requesting the info and getting it 
> is perceptible, then displaying outdated info is better than freezing until 
> you get up-to-date info, no?  Either you're getting info so fast that the 
> user doesn't realize that you're outdated by 1ms; or you're getting info so 
> slowly that the user realizes that you're running one second behind — but 
> it's much better than freezing for one second.

The time doesn't matter here: the amount of changes does.

IME, display based on outdated information is NOT okay.  The
discrepancy between the actual stuff on the screen and its
fontification based on outdated buffer context could be quite
annoying, for example.

> This is a problem we have all the time with Flycheck btw: you send the text 
> of the buffer to a compiler, it returns 3 seconds later, and you want to 
> display errors as reported by the compiler.  By the time we get errors to 
> display, the locations they come with are outdated.  We don't have a good 
> solution.
> Visual Studio in the old days had a really beautiful solution for this.  
> There was a (basically) free API you could call to snapshot a buffer at a 
> point in time; then there was a function that translated positions in that 
> snapshot to position in the current buffer (think of it as magically putting 
> a marker into the past buffer when the snapshot was taken, and then querying 
> its current position).  So positions returned by the compiler or any other 
> tools were still relevant if they referred to a three-seconds old buffer, 
> since you could translate them to the current buffer.

We can do that as well.  It's again something very similar to the
undo-list info we already collect.

reply via email to

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