From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70077: An easier way to track buffer changes Date: Sat, 30 Mar 2024 09:39:22 -0400 Message-ID: References: <6081fabd1e9e701b1b26848fbe0e403d@russet.org.uk> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1534"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Ihor Radchenko , 70077@debbugs.gnu.org, Yuan Fu , Qiantan Hong , =?UTF-8?Q?Fr=C3=A9d=C3=A9ric?= Bour , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , Nicolas Goaziou , Alan Mackenzie , Stephen Leake , Alan Zimmerman To: phillip.lord@russet.org.uk Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 30 14:40:10 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rqYwL-00009J-TE for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Mar 2024 14:40:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqYwF-0006PW-Ut; Sat, 30 Mar 2024 09:40:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqYwC-0006Op-R2 for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 09:40:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rqYwC-0003WB-8D for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 09:40:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rqYwE-0000S7-3R for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 09:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Mar 2024 13:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70077 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 70077-submit@debbugs.gnu.org id=B70077.17118059761654 (code B ref 70077); Sat, 30 Mar 2024 13:40:02 +0000 Original-Received: (at 70077) by debbugs.gnu.org; 30 Mar 2024 13:39:36 +0000 Original-Received: from localhost ([127.0.0.1]:44232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqYvn-0000Qc-Mc for submit@debbugs.gnu.org; Sat, 30 Mar 2024 09:39:36 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:7589) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqYvl-0000QP-IS for 70077@debbugs.gnu.org; Sat, 30 Mar 2024 09:39:34 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 55FE210004C; Sat, 30 Mar 2024 09:39:25 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1711805964; bh=d545QNFiFMZl8t0CHYjAOALXi3WjXLqTBerIP/ljxf4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=V2wgVtIFBRNPk4yzG2094hC7tjhxbHDUzFLyB12RpizS9Dvkygn7MsOle6GkDGazi Qlzd3l+Lnx5vtqBZjgYq9KYTCpg9//JiDA/zIAgTCA+NPnxDHlEDK4GQk3g7wNJhmQ r8wgvw3MGh/bm1s0TcAK8BU6apHev4Wbl04BKcqeNTPWbHd04oEe8BhXNmZDfOzaAb a2+DJFFunetR7KwxjB44qqS+sG9EKUfTreGue/xtR1E6lnXXylKCYdriqL2aNxGxds I9bLLpuIIlo0BwvO+cSchwZzHAypV9C1kBFemgWwYG4uUjVRW+0PFeT6CjdYOvNi3l 9ukf3ngNd3rkQ== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 67889100046; Sat, 30 Mar 2024 09:39:24 -0400 (EDT) Original-Received: from pastel (unknown [45.72.201.215]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 194A812016C; Sat, 30 Mar 2024 09:39:24 -0400 (EDT) In-Reply-To: <6081fabd1e9e701b1b26848fbe0e403d@russet.org.uk> (phillip lord's message of "Sat, 30 Mar 2024 08:06:03 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:282367 Archived-At: > Ah, yes, you are correct, I had missed that one. As you note, it would > be costly, especially because if you wanted to do anything with that > data, you would probably end up dumping it into a temp buffer. That's indeed what I end up doing in the `eglot.el` case. But if the API wants to tackle the performance issue of combining many small changes into a larger one, I don't know how we can do better. Another idea I considered was to keep a whole buffer as "previous contents" (instead of a string that covers the modified area). In some cases it would be more efficient, but the common case would be a lot more costly. Stefan