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: Mon, 11 May 2020 10:18:09 -0400 Message-ID: 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> <87ftc71g1l.fsf@t510.orion.oneofus.la> 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="118367"; 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: Eli Zaretskii , =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= , emacs-devel@gnu.org To: Vladimir Sedach Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 11 16:19:38 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 1jY9HN-000UfE-7D for ged-emacs-devel@m.gmane-mx.org; Mon, 11 May 2020 16:19:37 +0200 Original-Received: from localhost ([::1]:47800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jY9HH-0002wb-3r for ged-emacs-devel@m.gmane-mx.org; Mon, 11 May 2020 10:19:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jY9G2-0001Uq-7G for emacs-devel@gnu.org; Mon, 11 May 2020 10:18:14 -0400 Original-Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]:36153) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jY9G1-0006Ox-9H; Mon, 11 May 2020 10:18:13 -0400 Original-Received: by mail-qt1-x830.google.com with SMTP id v4so7083180qte.3; Mon, 11 May 2020 07:18:12 -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=yyFbgfqLscNh/9mjD3sgSZal1E+11dmgXkyuhbVbKbw=; b=fLyfMcbyKDk6XWt37dyWx462cEvEI5uWrYY/P2p8ixHnWzH+KuXyvG7JAv7iToefxc YdPY9hCW/0YbJnUwxDwclEZgRNy2DsQJpjjQnYmV1NO4AxC1P0vh0yofUm7TVinDZPLW XAKEUA1zQsiIVGXoZtvn4vDoKOZiuDHmZg9shPSp+5ONoipoasdnk1Mp4G6M738+nxby HYloWD6xAILdYuXsYtm1aYXZhLl/VnK+xaNguCGUkBSEFU4zyhURmhIIr6vB9PAD5FYd oTqyAjAmrVUyLP06dwSTWR3KCITShjv97zM2onG/cFPBbKmDJO8pzUGyLewWJYlhRqtZ TaOA== 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=yyFbgfqLscNh/9mjD3sgSZal1E+11dmgXkyuhbVbKbw=; b=Y09FAkyf3LpcSiugm8m+uMJm3Ap2ebMxJIaRIVp/OhHIj5U1vpYHqygUI2sjl4HvlM 6pyWHEvRjmuCllAOnlo3SAhF44sKUfFBCoJVbRzvZYInyJA3ARfo53JJaFkerHzbnwcQ FZiY5JCYfNyuJk19tMmTQX3Dyz9TuQwawTothPEXpcx5kZuTzD8PiN8xh6nNqQTYRgA8 IPqLPH42mAqSUepDDhYsOx9ZhrrTLlBCoDPuye3i4j+H7cX55EaszWHeGmVVnh0eiCSS HrNqCypKoTYUNrSK6oRR0duJusIna9MqQnozSIivnruHcDLMEqKH14MSANU58D1IcLPM 4kCQ== X-Gm-Message-State: AGi0PuZy0IU6Gwd+S6sr1yUlwqFc8sjo7/ffasy/bdyt8OMAeDOux7IA gikHddom5Wnhri50A8bfWOwP+MpN X-Google-Smtp-Source: APiQypKQEp1Ri7+7y83Hsv/JtQ7s8halpjzC/Wse3+MyOnZFECdIAMCaNPDczIJ3loaD43gDYLKh9Q== X-Received: by 2002:ac8:2dbc:: with SMTP id p57mr10029665qta.280.1589206691473; Mon, 11 May 2020 07:18:11 -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 o3sm9152439qtt.56.2020.05.11.07.18.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 May 2020 07:18:10 -0700 (PDT) In-Reply-To: <87ftc71g1l.fsf@t510.orion.oneofus.la> Content-Language: en-GB Received-SPF: pass client-ip=2607:f8b0:4864:20::830; envelope-from=cpitclaudel@gmail.com; helo=mail-qt1-x830.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:249785 Archived-At: On 10/05/2020 20.17, Vladimir Sedach wrote: > > Clément 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. Yes, eactly, that's what I meant when I wrote "Visual Studio has a nice API for this: there is a way to snapshot a buffer, and to translate positions between two snapshots. In my example, this allows you to translate 0:3 in the original buffer to 7:10 in the new one." > Another refinement is to use Stefan's idea of delimiting unmodified > intervals and only add properties in the modified interval. Yes, I need to think more about that one :) > A refinement would be to put the text property on tokens. Sticky text > properties would do the right thing when changing identifier names. Interesting idea. At first I worried that this would be too costly, but font-lock uses text properties and is quite fast… But wouldn't the process of mapping back from properties to spans of text be very costly?