From: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
To: "Eli Zaretskii" <eliz@gnu.org>,
emacs-devel@gnu.org, "João Távora" <joaotavora@gmail.com>
Subject: Re: Tracking buffer positions across time, without markers (was Re: PL support)
Date: Sun, 10 May 2020 15:27:47 -0400 [thread overview]
Message-ID: <9e98ccbd-6b01-d076-79eb-6bd06ab803fb@gmail.com> (raw)
In-Reply-To: <CB3D2D12-AF86-4C10-BDDF-483C593B2B32@gnu.org>
On 10/05/2020 00.32, Eli Zaretskii wrote:
> On May 10, 2020 6:45:13 AM GMT+03:00, "Clément Pit-Claudel" <cpitclaudel@gmail.com> wrote:
>> On 09/05/2020 19.26, João Távora wrote:
>>> This is done with an idle timer, much the way that Flycheck
>>> works, I believe.
>>
>> Yup, it's a longstanding issue in Flycheck ^^
>>
>>>> A bit. But this works only if the interaction is fast enough,
>> right? (Same for syntax errors: positions may well be outdated by the
>> time the errors come back)
>>
>>> By that time another request is probably already underway.
>>
>> As long as the requests are fast. With slow checkers (typically,
>> proof assistants and automated reasoning tools, a single query can
>> easily take a minute — by that point lots can have changed in a
>> buffer.
>>
>> The APIs that make this work in Visual Studio (spans and snapshots)
>> are described here:
>> https://docs.microsoft.com/en-us/visualstudio/extensibility/inside-the-editor?view=vs-2019
>>
>> I'd love to hear opinions on what the proper implementation of this
>> would for Emacs be.
>
> Can you explain why using markers is not a good solution for this?
Of course: in brief, because we don't know where to put the markers.
The general problem is this: I send the contents of a buffer to a subprocess. Some time later, the subprocess returns a list of positions (offsets from the beginning of the buffer, or line/column pairs, etc). At that point, these positions may be stale, since the contents of the buffer may have changed. I need a way to translate these positions (relative to the old buffer contents) into positions relative to the new buffer contents.
Since we don't know beforehand what positions the subprocess will return, I don't think markers can help; right?
next prev parent reply other threads:[~2020-05-10 19:27 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-09 19:47 Tracking buffer positions across time, without markers (was Re: PL support) Clément Pit-Claudel
2020-05-09 21:38 ` João Távora
2020-05-09 22:22 ` Clément Pit-Claudel
2020-05-09 23:26 ` João Távora
2020-05-10 3:45 ` Clément Pit-Claudel
2020-05-10 4:32 ` Eli Zaretskii
2020-05-10 19:27 ` Clément Pit-Claudel [this message]
2020-05-10 19:42 ` Drew Adams
2020-05-10 19:49 ` Eli Zaretskii
2020-05-10 20:52 ` Clément Pit-Claudel
2020-05-11 14:24 ` Eli Zaretskii
2020-05-11 15:03 ` Clément Pit-Claudel
2020-05-11 15:25 ` Stefan Monnier
2020-05-10 20:46 ` Stefan Monnier
2020-05-11 2:27 ` Eli Zaretskii
2020-05-11 3:19 ` Stefan Monnier
2020-05-11 0:17 ` Vladimir Sedach
2020-05-11 14:18 ` Clément Pit-Claudel
2020-05-11 15:16 ` João Távora
2020-05-11 15:33 ` Clément Pit-Claudel
2020-05-11 15:44 ` João Távora
2020-05-11 16:02 ` Clément Pit-Claudel
2020-05-11 16:11 ` João Távora
2020-05-11 17:20 ` Stefan Monnier
2020-05-11 14:39 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9e98ccbd-6b01-d076-79eb-6bd06ab803fb@gmail.com \
--to=cpitclaudel@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=joaotavora@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.