From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#70077: An easier way to track buffer changes Date: Sat, 30 Mar 2024 09:51:13 +0000 Message-ID: <87sf082gku.fsf@localhost> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13372"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, yantar92@gmail.com, qhong@alum.mit.edu, frederic.bour@lakaban.net, joaotavora@gmail.com, mail@nicolasgoaziou.fr, acm@muc.de, stephen_leake@stephe-leake.org, alan.zimm@gmail.com, monnier@iro.umontreal.ca, phillip.lord@russet.org.uk To: 70077@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 30 10:52:22 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 1rqVNu-0003GN-AR for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Mar 2024 10:52:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqVNb-0001sc-O6; Sat, 30 Mar 2024 05:52: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 1rqVNZ-0001rz-1g for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 05:52:01 -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 1rqVNY-0006fj-QN for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 05:52:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rqVNa-0002ir-AR for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 05:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Mar 2024 09:52: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 X-Debbugs-Original-To: "Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors" X-Debbugs-Original-Cc: Yuan Fu , 70077@debbugs.gnu.org, Ihor Radchenko , 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 , monnier@iro.umontreal.ca, Phillip Lord Original-Received: via spool by submit@debbugs.gnu.org id=B.171179230010396 (code B ref -1); Sat, 30 Mar 2024 09:52:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 Mar 2024 09:51:40 +0000 Original-Received: from localhost ([127.0.0.1]:44020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqVN3-0002gv-5W for submit@debbugs.gnu.org; Sat, 30 Mar 2024 05:51:39 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:44746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqVN1-0002gi-0S for submit@debbugs.gnu.org; Sat, 30 Mar 2024 05:51:27 -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 1rqVMt-0001no-0y for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 05:51:19 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqVMn-0006Ch-UE for bug-gnu-emacs@gnu.org; Sat, 30 Mar 2024 05:51:17 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id E0A2B24002D for ; Sat, 30 Mar 2024 10:51:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1711792266; bh=kYgyL7i/Xnjy/Fx8yCO1vgSbFmBI3BXPCbHoWgqN3iI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=rDCSGP6/l1mL3bMtWWUnGOFi6EHUmKt5R5aLvVsw6foCWV4Ql2Il3N3YgvLub+kV3 gQDGLVtbHWWfjWq7TFMPF1OS1fFAXbH7TyFLY8q+i6Kc0Psp1xT+pnQgSQetC4Sz1I eCTSHov87m26XscbzDux5fmyjPu6HBwIM6V/W66UTabFRCZxbx95TJgx0haSXxark6 DG7j9TzaRLdJ64pIsRSo/YjFaT5aeqRmwmQ7C+USaQBHjwR611NJtIapQ/KPTvpr05 IURJorJ1/qZSnb/5Xo5vAl481PtQtIfRIWJOmNP5Jsvm6kwiyIu9m8d4QheDTw3VeQ NiD/ZGQMmUrmA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4V6CG00yNGz9rxG; Sat, 30 Mar 2024 10:51:03 +0100 (CET) In-Reply-To: Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:282343 Archived-At: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > The driving design was: > > - Try to provide enough info such that it is possible and easy to > maintain a copy of the buffer simply by applying the reported changes. > E.g. for uses such as `eglot.el` or `crdt.el`. > - Make the API less synchronous: take care of combining small changes > into larger ones, and let the clients decide when they react to changes. Before we discuss the API, may you allow me to raise one critical concern: bug#65451. If my reading of the patch is correct, your code is relying upon the buffer changes arriving in the same order the changes are being made. However, it is not always the case, as demonstrated in the linked bug report. I am skeptical that you can achieve the desired patch goals purely relying upon before/after-change-functions, without reaching down to C internals. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at