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#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) Date: Sun, 18 Aug 2024 14:02:11 +0300 Message-ID: <86ttfiytzg.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13856"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72696@debbugs.gnu.org To: Dario Gjorgjevski , Stefan Monnier , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 18 13:05:50 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 1sfdjJ-0003Vn-Vr for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Aug 2024 13:05:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sfdj5-0004MG-6j; Sun, 18 Aug 2024 07:05:35 -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 1sfdiv-0004Li-6z for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2024 07:05:32 -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 1sfdir-0004bj-PT for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2024 07:05:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=93bgPGTDet4qc0SQsUABCariASZCE+7rfvl2Iib56us=; b=Vn+WtaSsze1kD4+4RL7W2E4Z5IgPcNYVi7nrtmu51INMgT0zhOmk7tyzP2S/oo9EoU6VgyIUwO0c49gN21CT6bnoUbZCU2m7JRDmLcK42RZFPqRFZ/YwNsH4uDeDYrf5xXa+dy9l9xWFQfx5N/gBEBEJaJRcMtGxJURPcP1x9lv+9lz7fghcqAKvo0jz9qDEMmyXuRw5UeHWt4gtGMT3zBcsb9PeKvfzqEpVwEw8wDBM9HfIoIbHNPw9ypyNsozqEwXfsJW65KonipFuKKGMlo7Uf86XxMzpSA9bOHg68QiMBV756mcvhd33vluTqpesgY0PpAPeKEsGIiAoUklBwQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sfdjV-0002Z0-TH for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2024 07:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Aug 2024 11:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72696 X-GNU-PR-Package: emacs Original-Received: via spool by 72696-submit@debbugs.gnu.org id=B72696.17239791249797 (code B ref 72696); Sun, 18 Aug 2024 11:06:01 +0000 Original-Received: (at 72696) by debbugs.gnu.org; 18 Aug 2024 11:05:24 +0000 Original-Received: from localhost ([127.0.0.1]:55504 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sfdit-0002Xv-QZ for submit@debbugs.gnu.org; Sun, 18 Aug 2024 07:05:24 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sfdis-0002Xg-EC for 72696@debbugs.gnu.org; Sun, 18 Aug 2024 07:05:23 -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 1sfdg3-0003tR-Ic; Sun, 18 Aug 2024 07:02:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=93bgPGTDet4qc0SQsUABCariASZCE+7rfvl2Iib56us=; b=jJsm6kl0t+PKgFl18veF BCdMilbG3zG5GQb6QpmkJ0VcXy/zga6snGETivFBLQHzh4zXrkmT9+gbpM3+5/oh+3+ImdHKXlduD DEX4oN6woEkcmw90qUcm/7kzO7ojlYQzhR8T7wUS71T40igGxTgPnqlFHlW8nXHjPpCw3vvyAbK3v h0t2CHhuy4ZCzxiAXlxgRkZ2qhTATbwoKkFWoiwCkJyUnDD2M0aNAHsbZn+0x+uGE1Ykt9NsgKEdM 19sGvUyTmcpn/d2x/A7ywYjgQUG6N21U4Ld+N53y6pno9Ok+WcmL+YOZp+DGsRVsjLP08aO1M5FRC JSHHEefkQtzBow==; In-Reply-To: (message from Dario Gjorgjevski on Sun, 18 Aug 2024 12:58:24 +0200) 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:290312 Archived-At: > From: Dario Gjorgjevski > Date: Sun, 18 Aug 2024 12:58:24 +0200 > > How to reproduce: > > 1. In one shell, fire up GNU Emacs, open a file, and start something > that uses track-changes; e.g., Eglot. In my case it was a Python file > called test.py with contents foo = 0. Everything is happy so far. > 2. In another shell, fire up a Node.js interpreter and execute const > fs = require("node:fs/promises") followed by await > fs.writeFile("test.py", "foo = 1"). This will overwrite the file. > 3. Track-changes (and by extension Eglot) will error out. Restarting > Eglot makes everything go back to normal. > > The *Warnings* buffer now contains: > > Warning (emacs): Missing/incorrect calls to > ‘before/after-change-functions’!! > Details logged to `track-changes--error-log' > > And `track-changes--error-log' contains: > > (("test.py" #1=(unexpected-after 1 8 0) > ((t track-changes--recover-from-error (#1#) nil) > (t track-changes--after (1 8 0) nil) > (t revert-buffer-insert-file-contents--default-function > ("/path/to/test.py" > nil) > nil) > (t revert-buffer--default (ignore-auto dont-ask) nil) > (t revert-buffer (ignore-auto dont-ask preserve-modes) nil) > (t auto-revert-handler nil nil) > (t auto-revert-buffer (#) nil) > (t # nil nil) > (t auto-revert-buffers@buffer-list-filter > (#) nil) > (t apply > (auto-revert-buffers@buffer-list-filter # auto-revert-buffers> nil) > nil) > (t auto-revert-buffers nil nil) > (t apply (auto-revert-buffers nil) nil) > (t timer-event-handler > ([nil 26305 53479 773611 5 auto-revert-buffers nil nil 0 nil]) > nil)) > [(nil . minibuffer-complete-and-exit) 5 (nil . move-end-of-line) 127 > (nil . python-indent-dedent-line-backspace) 48 > (nil . self-insert-command) 24 24 19 (nil . save-buffer) 27 91 79 > 27 91 73 27 91 79])) > > Despite `python-indent-dedent-line-backspace' being present in the > backtrace, the error is not limited to `python-mode'. > > My GNU Emacs is built from: > > Repository revision: 40eecd594ac60f38b6729fd9cf3474a8b9d133b9 > Repository branch: master > System Description: macOS 14.5 > Configured using: > 'configure --without-x --without-ns --with-mailutils > --with-kerberos5 --with-json --with-tree-sitter > --with-native-compilation Adding Stefan and João.