From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dario Gjorgjevski 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 12:58:24 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34144"; mail-complaints-to="usenet@ciao.gmane.io" To: 72696@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 18 13:00:04 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 1sfddk-0008j7-Ke for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Aug 2024 13:00:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sfdd8-0003NA-Ht; Sun, 18 Aug 2024 06:59: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 1sfdd5-0003LX-FQ for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2024 06:59:23 -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 1sfdd4-0003Rj-UL for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2024 06:59:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:MIME-Version:To:Subject; bh=yVClpBuUNOXdAFkYhL4Nq9PHuzJWIoEp1qtydayEU4s=; b=TvbEmP5a/4qxrRh80aMv/kZfIHdqwHFarWrINbA21RhoOOEeGjg+9PGzxU3gsgs7qsxohFNgZ2d/P9EhA2TQWdEcAkZcuBK5DImWs/fGvpWl91xOxny9ON9jz34Kf/3ZqT9HRE3Yn68lqn8QEVu0xOyL+KVgkJ2IJ0E/Nn6NhyHZboNACqHjp/lXENAIx3v54ETxN5yUsNtzgwva1kcFIVkHYqxc+M+rvp8mNmNa28o7E+jTCMPSltYdisve3iainZxnjqGEpLAlHf2+hhwVcKKewpT5X4R60/t/gYKn8IP8gGojoOtjyB6q5Hw//USSz4XPczM/mEsasq7GHbkuhw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sfddi-0002Nj-1F for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2024 07:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dario Gjorgjevski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Aug 2024 11:00:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72696 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17239787889106 (code B ref -1); Sun, 18 Aug 2024 11:00:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Aug 2024 10:59:48 +0000 Original-Received: from localhost ([127.0.0.1]:55498 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sfddT-0002Mo-TE for submit@debbugs.gnu.org; Sun, 18 Aug 2024 06:59:48 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:43822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sfddR-0002Mc-6Q for submit@debbugs.gnu.org; Sun, 18 Aug 2024 06:59:46 -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 1sfdcm-0003Bx-I2 for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2024 06:59:04 -0400 Original-Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sfdck-0003Qa-Rp for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2024 06:59:04 -0400 Original-Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2f16d2f2b68so49727151fa.3 for ; Sun, 18 Aug 2024 03:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723978741; x=1724583541; darn=gnu.org; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yVClpBuUNOXdAFkYhL4Nq9PHuzJWIoEp1qtydayEU4s=; b=B4uwV73D605zfwf55SU31z/IfvrVupvHrtXVXMsyo0if66HuSBH9dDOC4KL+lmdjR+ BJGmNXOjoG/a7QiNzC2nbTKrzAm1umrpy/pgbv4ghX/LNQQsmIh7JO2D3/7DpuBNcrSj /5RHEKXvTmWYfXihx1iyHoKSqcqlk2FHGqwdB65WCwtg/t9liR+k8l4XjOs6J4hbgsU4 vpcDZBN3fWpEyHwwJniua1mqcoRDTR6sfcH3/Od1UMF+O2wg5dCS4J6jf4aFibaamHev cxNl5gUi1btcsOp7wBH4f0DPTz7sit8mF2+z21qyjcDMl/+wUy5I7DsiitE/+pqqMFH0 sn1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723978741; x=1724583541; h=content-transfer-encoding:to:subject:message-id:date:from :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yVClpBuUNOXdAFkYhL4Nq9PHuzJWIoEp1qtydayEU4s=; b=UI4O9T9fAylzEXt06i6AFiZK2UMBHaiN7wK8wjdlafsxJWHwmZ4CUfFG5GX+Dzy8g9 qi6+j/tfia8u5bi7IB8Y4pYNvqqredMu9YL8YJHHNA2TR/Tu4UqNem7uqvOxHWjiA/uH aAFr9A4VXbjsu7/V7lf+RI7nUfGzzpAFRc7WenFtvqzNQZsgKVym1gG17XNXv3ae9ADG dp6hV/gaZ1Be7KVROwbMFKmdq/mrBnVGvkU1Mg7DHMUDR+xE2WZciwU9Z+gcY0jFpOnj C759zvcaWbYzCu81sdNBFWVhd9h4L+H9LmiTM+ln5L6/4fVlzvL6tn6AKBRh1Syz7KBo aRLw== X-Gm-Message-State: AOJu0YyEkXjfb5z79w+ZIMgwylLWSWmgTKR3D2lDJpS6sGlf4Q+4DRzb kQk5w6dmdU3fJIGum0ypewI/XPDDLMNPB3oELZv+lgqvg/p9AO0mvl0cBRbzzKuhZunaU3/UeWh PzYXltoDmIJzT5BZndrynlT6SV6gwOPXl X-Google-Smtp-Source: AGHT+IEpMYPN3Jcdfi4HD6B+S7DyMgy55OAcrfm3yDSnvzUd2cVcWlnf8UZ6s3Ovz9EOuZry/w2oWD/kBf6cn/NcFac= X-Received: by 2002:a2e:a7ca:0:b0:2f3:c384:71ee with SMTP id 38308e7fff4ca-2f3c384724dmr57034251fa.33.1723978740130; Sun, 18 Aug 2024 03:59:00 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::22a; envelope-from=dario.gjorgjevski@gmail.com; helo=mail-lj1-x22a.google.com 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_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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:290311 Archived-At: 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 =3D 0. Everything is happy so far. 2. In another shell, fire up a Node.js interpreter and execute const fs =3D require("node:fs/promises") followed by await fs.writeFile("test.py", "foo =3D 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 =E2=80=98before/after-change-functions=E2=80=99!! Details logged to `track-changes--error-log' And `track-changes--error-log' contains: (("test.py" #1=3D(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 # 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 Best regards, Dario