From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Tracking buffer positions across time, without markers (was Re: PL support) Date: Mon, 11 May 2020 05:27:31 +0300 Message-ID: <837dxjcijw.fsf@gnu.org> 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> 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="62232"; mail-complaints-to="usenet@ciao.gmane.io" Cc: cpitclaudel@gmail.com, joaotavora@gmail.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 11 04:28:10 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 1jXyAp-000G3X-Ue for ged-emacs-devel@m.gmane-mx.org; Mon, 11 May 2020 04:28:07 +0200 Original-Received: from localhost ([::1]:43672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXyAo-0001bO-WD for ged-emacs-devel@m.gmane-mx.org; Sun, 10 May 2020 22:28:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXyAM-0001Az-GV for emacs-devel@gnu.org; Sun, 10 May 2020 22:27:38 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54229) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXyAM-0007aH-25; Sun, 10 May 2020 22:27:38 -0400 Original-Received: from [176.228.60.248] (port=2345 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jXyAL-0003zW-Do; Sun, 10 May 2020 22:27:37 -0400 In-Reply-To: (message from Stefan Monnier on Sun, 10 May 2020 16:46:29 -0400) 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:249734 Archived-At: > From: Stefan Monnier > Cc: Eli Zaretskii , emacs-devel@gnu.org, > João Távora > > Date: Sun, 10 May 2020 16:46:29 -0400 > > If you have the option to ask for a more up-to-date version of the data > to be sent, you can obviously throw the data away, but even in that case > you should be able to do better with fairly little work: use an > after-change-function to keep track of just 2 markers that indicate the > beginning and end of the part of the buffer that's been modified. > Then you can easily translate all the positions before the first and > after the second marker and only discard the data between the two. This is all possible, of course, but I don't (yet) see why it would be necessary. We survive without this complexity when using JIT font-lock, and any alternative back-end for the same job should be able to reuse the same basic architecture.