From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Vladimir Sedach Newsgroups: gmane.emacs.devel Subject: Re: Tracking buffer positions across time, without markers (was Re: PL support) Date: Sun, 10 May 2020 17:17:10 -0700 Message-ID: <87ftc71g1l.fsf@t510.orion.oneofus.la> 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: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="101949"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.3.10; emacs 26.2 Cc: Eli Zaretskii , =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= , emacs-devel@gnu.org To: =?utf-8?Q?Cl=C3=A9ment?= Pit-Claudel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 11 02:25:27 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 1jXwG7-000QPN-9T for ged-emacs-devel@m.gmane-mx.org; Mon, 11 May 2020 02:25:27 +0200 Original-Received: from localhost ([::1]:35308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXwG6-0008Gl-8f for ged-emacs-devel@m.gmane-mx.org; Sun, 10 May 2020 20:25:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXwFS-0007pz-Bi for emacs-devel@gnu.org; Sun, 10 May 2020 20:24:46 -0400 Original-Received: from forward102o.mail.yandex.net ([2a02:6b8:0:1a2d::602]:40470) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXwFR-0001Sd-1W; Sun, 10 May 2020 20:24:46 -0400 Original-Received: from forward100q.mail.yandex.net (forward100q.mail.yandex.net [IPv6:2a02:6b8:c0e:4b:0:640:4012:bb97]) by forward102o.mail.yandex.net (Yandex) with ESMTP id 88774668023D; Mon, 11 May 2020 03:24:37 +0300 (MSK) Original-Received: from mxback2q.mail.yandex.net (mxback2q.mail.yandex.net [IPv6:2a02:6b8:c0e:40:0:640:9c8c:4946]) by forward100q.mail.yandex.net (Yandex) with ESMTP id 84DEC7080002; Mon, 11 May 2020 03:24:37 +0300 (MSK) Original-Received: from vla1-ee05250d997a.qloud-c.yandex.net (vla1-ee05250d997a.qloud-c.yandex.net [2a02:6b8:c0d:3495:0:640:ee05:250d]) by mxback2q.mail.yandex.net (mxback/Yandex) with ESMTP id 7lGhmhXLZH-ObMeIgXw; Mon, 11 May 2020 03:24:37 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oneofus.la; s=mail; t=1589156677; bh=xDn6AWBqffawfElB0efUiA7F/l1W3A6vvrAXwY5Z1S4=; h=In-reply-to:Subject:Cc:To:From:Date:References:Message-ID; b=2rJHrphbMVUcUkvuWmz2OyhiEtX3rdlYxGj6w/IbBCHIzN1gehBADOKDnejOtoj0S ov/I2sOYCGq/Sgo7HRVsxwbAsGwObGSiaMxlIiYkiObzucP32HoLeYS4zcheAosG/u bppwh/sjldrco0DBSlowsaHJ7r0E/ibw+AstwLR0= Authentication-Results: mxback2q.mail.yandex.net; dkim=pass header.i=@oneofus.la Original-Received: by vla1-ee05250d997a.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id xwjVkEiwYk-OZ2ep3HM; Mon, 11 May 2020 03:24:36 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) In-reply-to: <9e98ccbd-6b01-d076-79eb-6bd06ab803fb@gmail.com> Received-SPF: pass client-ip=2a02:6b8:0:1a2d::602; envelope-from=vas@oneofus.la; helo=forward102o.mail.yandex.net X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=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:249726 Archived-At: Cl=C3=A9ment Pit-Claudel 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. One naive way to obtain this function is to "snapshot" the buffer by assigning every character in the buffer a text property with the value of its position at the time of the snapshot. A refinement would be to put the text property on tokens. Sticky text properties would do the right thing when changing identifier names. Another refinement is to use Stefan's idea of delimiting unmodified intervals and only add properties in the modified interval. Text properties are nice because they follow kill/yank. Markers do not. A problem is that text properties are wiped away by replace-string and similar. I can see this displaying confusing and nonsensical results if there are a lot of edits in the time it take the sub-process to return. -- Vladimir Sedach Software engineering services in Los Angeles https://oneofus.la