From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#65451: 30.0.50; `after-change-functions' are not triggered in the same order the changes are made Date: Fri, 25 Aug 2023 09:37:49 +0300 Message-ID: <83pm3bocea.fsf@gnu.org> References: <871qfv2zlk.fsf@localhost> <83a5ujtgfo.fsf@gnu.org> <87jztn1c5x.fsf@localhost> <834jkrters.fsf@gnu.org> <87v8d7i48y.fsf@localhost> <83ttsrrroo.fsf@gnu.org> <874jkq87jl.fsf@localhost> <83y1i1r689.fsf@gnu.org> <87fs487uip.fsf@localhost> <83zg2gq2vj.fsf@gnu.org> <871qfsel8q.fsf@localhost> <83r0nsprrk.fsf@gnu.org> <87cyzck1uh.fsf@localhost> <83il94pk49.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24453"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, 65451@debbugs.gnu.org To: yantar92@posteo.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 25 08:38:13 2023 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 1qZQST-0006Ay-6W for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 25 Aug 2023 08:38:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZQSP-0002XI-4J; Fri, 25 Aug 2023 02:38:09 -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 1qZQSG-0002Wj-DM for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2023 02:38:03 -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 1qZQSD-0003xD-Nr for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2023 02:37:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qZQSI-0003aG-4B for bug-gnu-emacs@gnu.org; Fri, 25 Aug 2023 02:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Aug 2023 06:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65451 X-GNU-PR-Package: emacs Original-Received: via spool by 65451-submit@debbugs.gnu.org id=B65451.169294546213747 (code B ref 65451); Fri, 25 Aug 2023 06:38:02 +0000 Original-Received: (at 65451) by debbugs.gnu.org; 25 Aug 2023 06:37:42 +0000 Original-Received: from localhost ([127.0.0.1]:39057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZQRy-0003Zf-0N for submit@debbugs.gnu.org; Fri, 25 Aug 2023 02:37:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZQRw-0003ZT-NY for 65451@debbugs.gnu.org; Fri, 25 Aug 2023 02:37:41 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZQRl-0003w9-In; Fri, 25 Aug 2023 02:37:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=fazkZSeEk47Kefhampl1NFO/Tb9Ba3soVbflv7zveyE=; b=dn2CzPUsUCu5 zmEZvwT5iG1B4QaNnXuy4uIbKUB5QQ7MU2wNF3W+JgQCl7w1I6KxCNcQRd8G6aHQKONTk+OnZPepH sO5aATeGXopGh0R23riTR9RGQSD2of1NsAWElFKtdb9fU+WjXvu+inHgfW+C5FZ4TgCWEod6VMOvQ 6zhipCvbAl4eqnM19EqeG1ap85ow5kH8eoryya1EwkEXYZ2hYf6TPBSjlL+MQlpgq8Rfic7XjucF/ xwzetkqSbyT5y5+6KTQA+eld7WUPCr+Y0Dw8R7n8snCgYqcg/hRmsqVk19cPdH1UKiYzQk4vjBU9/ UdyOSWhUFRQW96r4HeT5SA==; In-Reply-To: <83il94pk49.fsf@gnu.org> (message from Eli Zaretskii on Thu, 24 Aug 2023 17:53:26 +0300) 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:268396 Archived-At: > Cc: casouri@gmail.com, 65451@debbugs.gnu.org > Date: Thu, 24 Aug 2023 17:53:26 +0300 > From: Eli Zaretskii > > If you need that from timers, then yes, all you need is access from > the timer function to a data structure that holds the accumulated > transactions. Timers run approximately at the same time and under the > same conditions as redisplay, so this mechanism will indeed ensure > this data is accessed when Emacs is in a consistent state, and it is > safe to access and use this data. > > > Elements of the list will be like > > [:buffer-chars-modified-tick :region-beginning :region-end-before-edit :region-end-after-edit] > > If you really need buffer-chars-modified-tick, you will have to verify > that it is updated before calling the function which updates the > "transactions list". Thinking about this some more, we will need to consider whether this list of accumulated transactions is ever compacted by deleting old transactions, or we let it grow indefinitely. If the former, we should consider the case where more than one feature wants to track buffer edits (so it is impossible to remove entries once they have been processed by a single consumer).