From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: Tracking buffer positions across time, without markers (was Re: PL support) Date: Sun, 10 May 2020 16:52:23 -0400 Message-ID: <0e1c224f-e3d8-0259-0fa9-b952dfbc6da7@gmail.com> References: <6a2c7d18-344e-fefb-63d5-79a99d0532fc@gmail.com> <942a8cb1-0382-cf83-5ff9-4e776c2660f0@gmail.com> <7f8bdd43-f4d7-e0a8-dcfa-6679215f9d44@gmail.com> <9e98ccbd-6b01-d076-79eb-6bd06ab803fb@gmail.com> <838shzd0zt.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="41801"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 Cc: joaotavora@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 10 22:53:11 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jXswh-000AkS-9p for ged-emacs-devel@m.gmane-mx.org; Sun, 10 May 2020 22:53:11 +0200 Original-Received: from localhost ([::1]:40818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXswg-0003K5-BZ for ged-emacs-devel@m.gmane-mx.org; Sun, 10 May 2020 16:53:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXsvz-0002tx-PX for emacs-devel@gnu.org; Sun, 10 May 2020 16:52:27 -0400 Original-Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]:43471) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXsvy-0006TF-1L; Sun, 10 May 2020 16:52:27 -0400 Original-Received: by mail-qk1-x732.google.com with SMTP id i14so6660376qka.10; Sun, 10 May 2020 13:52:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=xbwhkAOy0RKkNjxCo97CGeDyih2wzr4Sirk0VrcO7zU=; b=PTjHhnKS9bWGg2nAgIiRbY1FvqULGq/x/fmX689dchC8dzwghv/85FN/uAnjSQIs7C Y5USnTn0zQr5h9fs74UcASbEpuakNKy720LCPxtWCM5R5f2/9EgA66qxtqicSiF5AxbE SemwPtOxwKL8/cqSjHVwhZLq55i0bKslW5k9AnK5rzqmhdzouZp6EPn2I5yVnrK228sE pEw0oMJO/FPY9XgBaupBjUK1z/20WS/i1gbtPg4Rah/dY4RWRjm2zSGagTR2KdjIvWMB UP02Lo/pdUkERueExR9AMy7LJf50OzZn2BNQKyR7sTJ4aKqu0jLtN83YDaGUomWIJ9YJ 3tEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xbwhkAOy0RKkNjxCo97CGeDyih2wzr4Sirk0VrcO7zU=; b=alk0tgxXLzvM35vRwc2S49YVDSshFpQeHX17hImPwdZsTxxV/ba01EA2HMMGFE2dao rjJgOlk52v5SNP/7e5uqTi0MtC8NTl6TErcQdZwZkbnQ2QUmC4HAOxyftDSK2uVxQ6JM +bTPM12mqJmRqQkZqYd69mO0tJcQG6rpfFvp4JUqcM4Y+UtH1w9XZEPq2ZMaWibveN/G bINGM9uYUEqvStzrDuRR5nl4i4K+odJbDndL7YiqNz4FyIADRn8pPLxc/vwf9Yuf4fsP ygx2JJPtRmEoQPe1ERPlewADQp8AFMwvEG3VF9/ZapcpVOvXyvqU1mfjuA2aGLxQfrI3 SvQg== X-Gm-Message-State: AGi0PuZStIKDLIAu+W2hkFv1d6Jda5x1BhAZgGG2AeJrP19gLFy+Qllg c7fURzD1yKTizZWmmUZfh8s= X-Google-Smtp-Source: APiQypKp56jU/VMIKIEB5EIWHSq8yYvaX+TBoTrtZxyiXKeK2GNRhN77MRTMOyinUEUnLWQG7e2FlQ== X-Received: by 2002:a37:aa82:: with SMTP id t124mr12077542qke.3.1589143944629; Sun, 10 May 2020 13:52:24 -0700 (PDT) Original-Received: from ?IPv6:2601:184:4180:66e7:4d17:b25e:8d9:2188? ([2601:184:4180:66e7:4d17:b25e:8d9:2188]) by smtp.googlemail.com with ESMTPSA id l8sm7580372qtl.86.2020.05.10.13.52.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 10 May 2020 13:52:24 -0700 (PDT) In-Reply-To: <838shzd0zt.fsf@gnu.org> Content-Language: en-GB Received-SPF: pass client-ip=2607:f8b0:4864:20::732; envelope-from=cpitclaudel@gmail.com; helo=mail-qk1-x732.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:249722 Archived-At: On 10/05/2020 15.49, Eli Zaretskii wrote: >> From: Clément Pit-Claudel Date: Sun, 10 May >> 2020 15:27:47 -0400 >> >> 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. > > If by the time the output arrives the user have edited the buffer, > you will have to throw the output away, and send a new request. No, it's quite acceptable to use the old output in my case, as long as it can be displayed in the right place. > Rinse, repeat. Eventually, the user will stop typing, at least for a > short time, and the output that arrives after that could be used for > fontifying because no changes have been done. But if this never > happens, i.e. the user keeps being ahead of the subprocess, it would > mean the buffer will not be fontified for a time that is long enough > to be an annoyance. Which means the solution is not workable. > Right? My use case is not fontification, it's showing errors and hints from a compiler. It's not unusual for compilation cycles or checking to take up to a minute, and resending the query doesn't help. > IOW, the process of sending whatever you need to send and receiving > the output should be fast enough to be completed before the user > types a lot, or at least short enough to hold off buffer > modifications, or else this is simply not going to work. It works OK currently, although often the highlights are not exactly in the right place.