From unknown Tue Aug 19 02:58:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) 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-GNU-PR-Keywords: To: 72696@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17239787889106 (code B ref -1); Sun, 18 Aug 2024 11:00:01 +0000 Received: (at submit) by debbugs.gnu.org; 18 Aug 2024 10:59:48 +0000 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 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 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 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 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) MIME-Version: 1.0 From: Dario Gjorgjevski Date: Sun, 18 Aug 2024 12:58:24 +0200 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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 From unknown Tue Aug 19 02:58:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) 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 X-GNU-PR-Keywords: To: Dario Gjorgjevski , Stefan Monnier , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: 72696@debbugs.gnu.org Received: via spool by 72696-submit@debbugs.gnu.org id=B72696.17239791249797 (code B ref 72696); Sun, 18 Aug 2024 11:06:01 +0000 Received: (at 72696) by debbugs.gnu.org; 18 Aug 2024 11:05:24 +0000 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 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 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==; Date: Sun, 18 Aug 2024 14:02:11 +0300 Message-Id: <86ttfiytzg.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Dario Gjorgjevski on Sun, 18 Aug 2024 12:58:24 +0200) References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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. From unknown Tue Aug 19 02:58:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Aug 2024 16:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72696 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dario Gjorgjevski Cc: 72696@debbugs.gnu.org Received: via spool by 72696-submit@debbugs.gnu.org id=B72696.172399748910305 (code B ref 72696); Sun, 18 Aug 2024 16:12:02 +0000 Received: (at 72696) by debbugs.gnu.org; 18 Aug 2024 16:11:29 +0000 Received: from localhost ([127.0.0.1]:56540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sfiV7-0002g9-26 for submit@debbugs.gnu.org; Sun, 18 Aug 2024 12:11:29 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:1267) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sfiV5-0002ft-4k for 72696@debbugs.gnu.org; Sun, 18 Aug 2024 12:11:28 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 352A3442DA9; Sun, 18 Aug 2024 12:10:40 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1723997438; bh=+mb+hHrq11ytrYJmoykByC9hhxM3x0+3dP0UjYWHNJ0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=CAhkbIXeWiYgE09W3AaZI1ne5zpqOPDE4IBdPVDj0K46p/nWYuQRnYeWrNHve7Nxr 0yAV1LRDzRs/kjzCzWQKcZTaMMAR6WxVC+Nl6zLBnJe1rNnfHndLJFMRDdGCKf6p2w e4C65qkFRIcfIaiJ0fMx+j1jBPZhLMXv6s+7WMs8hW0UF1d3zEFAJArg7hf8EbgJbh AZxynqmxh9H7Y54QFFExuhblq4c3kEIaWjy4BUbmzSmNg0RPU3OwLJ1z3G5/69oOch YN3RWiRPhKEDSqOnBfCTbcY8IuwhPnF20pyFps+NtNI6Bb5HC2MPeWnNeDNACP7q0C t9NftbosmQg6Q== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5EA06442DA7; Sun, 18 Aug 2024 12:10:38 -0400 (EDT) Received: from alfajor (unknown [216.154.9.87]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 343D61204B0; Sun, 18 Aug 2024 12:10:38 -0400 (EDT) From: Stefan Monnier In-Reply-To: (Dario Gjorgjevski's message of "Sun, 18 Aug 2024 12:58:24 +0200") Message-ID: References: Date: Sun, 18 Aug 2024 12:10:37 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.136 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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' The above is only a "warning": it just logged the occurrence of something undesired, but track-changes supposedly recovered from that. IOW you describe two problems: - Somehow/somewhere there is a "Missing/incorrect calls to =E2=80=98before/after-change-functions". [ But these problems are sufficiently common that track-changes has code devoted to detecting and handling those cases. ] We want to try and fix the origin of this problem, but it's been with us "for ever", so it's not super extra urgent because there will still be other cases where it can show up. Eglot has had to deal with this problem since its inception, it just used to keep silent about it, contrary to track-changes (because I want to get rid of those problems). - Eglot errors out. This should definitely not happen and seems like a regression. Restarting Eglot should definitely not be needed. Could you clarify what you mean by Eglot erroring out and why restarting it is necessary? > 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) Hmm... assuming the file really started with content "foo =3D 0" (and no terminating newline), "track-changes--after (1 8 0)" looks OK: the revert has changed the file size by 0 chars and the new content spans chars from 1 to 8. So my guess is that revert-buffer failed to call the `before-changes-functions` or that it called it with a smaller region (e.g. only the region that's actually modified (7..8), where "0" is turned into "1"). Will have to dig deeper. BTW, your recipe does not mention enabling auto-revert. Have you confirmed on your side that the problem shows up also in a vanilla config? Stefan From unknown Tue Aug 19 02:58:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) Resent-From: Dario Gjorgjevski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Aug 2024 20:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72696 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 72696@debbugs.gnu.org Received: via spool by 72696-submit@debbugs.gnu.org id=B72696.17240135086915 (code B ref 72696); Sun, 18 Aug 2024 20:39:02 +0000 Received: (at 72696) by debbugs.gnu.org; 18 Aug 2024 20:38:28 +0000 Received: from localhost ([127.0.0.1]:56846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sfmfT-0001nS-Jn for submit@debbugs.gnu.org; Sun, 18 Aug 2024 16:38:27 -0400 Received: from mail-lj1-f180.google.com ([209.85.208.180]:55497) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sfmfR-0001n7-57 for 72696@debbugs.gnu.org; Sun, 18 Aug 2024 16:38:25 -0400 Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2f189a2a7f8so37965941fa.2 for <72696@debbugs.gnu.org>; Sun, 18 Aug 2024 13:37:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724013398; x=1724618198; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=43m00W62Y5INgxzYF1oTO4ORDawtARCemO6QQrUdwys=; b=cxNlL0x0a4xecQ34pn3SsbALzGjQ8gRIzCN6sZysCciDyP2c0Eu2fV/pcBt97eMxGY 3baLYm7fW39yNz61bxVDf7uRBX4THs/yAg/s1+GM6JQgFqN0P6IuNHh9VT7M0I8qqvHw 4R4XPvII3jLjYYSOGsdMjQmweECEQITn8SkE26hbW3yHXgD61mGTWSqP5DAMKP7f04By hXERvYjC2N8uef/1Jmy1PoeP9KQN4c6mibF4AY0SGH5vHh6tbWbNlLxoW1nWMfT556kW AXID1k4EZYxwXiW34vQyCAjVDHQmmoqj3TpHviLXhNdD13VJHYUlv7dYxjad8PhGmM1P 96BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724013398; x=1724618198; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=43m00W62Y5INgxzYF1oTO4ORDawtARCemO6QQrUdwys=; b=eJUmbFNAIp1cz9NO2FFzRDCGNalgjEnjEMgPgi9hWxjcA5zSBt6Yr1k80L9iCIpfrH DcVs1RP7pVMGupuvWHaXLVuZcFXQm479mVP2ZoBC8tBfM72yttiC5rYaj9ILP+bvWyiW Un0rTepD5blbxKsqqeJAL+goIpAtkWQmoB+wURtaud/C/mGQgmmHVcP+n7VBvybP1FvP b2WXlWcFijRJKoxNhM5r87mcL0S0N1HvHeCulh50khvoDlL066XFvomscm+tuZKz5hGR F8Ee7yiT9eRjkhYj8uNm1fCbNUsJKNCKLtWHJIA3ulFUQK6FHz2iLTu3cuVq+dN/86WG 6+JA== X-Gm-Message-State: AOJu0Yymi+JV1XfV0wqw/2Awpb5yQVKviFfaBM9tuCN/pZ8mq5avws4W 1IW/GmS3eC6IwGVYlKfOuLh9E10FvsfnxSmqf9DwPAxtnfhU+v9aHoK2lU59k6EOSWI+MpLyD8F Nqb3yoEyvh1yU7ILJq07cB7zgl3I= X-Google-Smtp-Source: AGHT+IHDfEoOr1LCnagpB28wU3kJcnnPSFzJ8MMZ5/wySiBr9owSjq1bNpJOS8HqM3GCKJaIy1EwuL30JFGnI0wJO9k= X-Received: by 2002:a2e:6102:0:b0:2ec:42db:96a2 with SMTP id 38308e7fff4ca-2f3be5c13e4mr49306421fa.29.1724013397754; Sun, 18 Aug 2024 13:36:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dario Gjorgjevski Date: Sun, 18 Aug 2024 22:36:01 +0200 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Stefan, On Sun, Aug 18, 2024 at 6:10=E2=80=AFPM Stefan Monnier wrote: > > - Eglot errors out. This should definitely not happen and seems like > a regression. Restarting Eglot should definitely not be needed. > > Could you clarify what you mean by Eglot erroring out and why > restarting it is necessary? Eglot gets in a weird state and begins reporting erroneous data to the LSP server. > > Hmm... assuming the file really started with content "foo =3D 0" (and no > terminating newline), "track-changes--after (1 8 0)" looks OK: the > revert has changed the file size by 0 chars and the new content spans > chars from 1 to 8. So my guess is that revert-buffer failed to call the > `before-changes-functions` or that it called it with a smaller region > (e.g. only the region that's actually modified (7..8), where "0" is > turned into "1"). > > Will have to dig deeper. One thing I see is that the buffer becomes empty for a split second, and is then overwritten with the new contents. I don't know how exactly Node.js does the overwriting, but I guess it's worth looking into. > > BTW, your recipe does not mention enabling auto-revert. Have you > confirmed on your side that the problem shows up also in > a vanilla config? You're right, the problem depends on auto-revert-mode being active. Sorry about that. Best regards, Dario From unknown Tue Aug 19 02:58:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Aug 2024 12:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72696 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dario Gjorgjevski Cc: 72696@debbugs.gnu.org Received: via spool by 72696-submit@debbugs.gnu.org id=B72696.1724156203309 (code B ref 72696); Tue, 20 Aug 2024 12:17:02 +0000 Received: (at 72696) by debbugs.gnu.org; 20 Aug 2024 12:16:43 +0000 Received: from localhost ([127.0.0.1]:60003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgNn1-00004u-57 for submit@debbugs.gnu.org; Tue, 20 Aug 2024 08:16:43 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:22816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sgNmz-0008WL-52 for 72696@debbugs.gnu.org; Tue, 20 Aug 2024 08:16:41 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 9FEC7441049; Tue, 20 Aug 2024 08:15:52 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1724156151; bh=rlu2X5wmyyUHESchyjGT11TeiSsXL2OiY0q0eN7OykM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ePmLvVFfTLlK10bp7AHzLT/gFJiEAFWjdRIwRKQ6ylb4h7Qx6RUFf8Mz/0rQ+rsWG 8Pia5ULANYAcjVBrMfLfNA7D92URxB29wHDa4mBB6LW5Jm9OYK9pX1SQD+xgrbb2d/ cZQs/my8xI/ZYcemNbe7ZFLeB7m4XdThShI2QFG01vSVNMrtDpShch9MjWuFCtvspY i5aly518psmloN83elIHRe2QVkgNdDEN//Kgl+pA1QkBA0G1G9JlEBvsMkuGs2uZAz LvEsICwrGhQHwENyGrfGTy1qhjuUK2I6fhwnIr5Vd4Fxetv3Qw8aoCk4aQHfFxLOI+ ME1El0yxqOG+A== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 1CC4B440FEC; Tue, 20 Aug 2024 08:15:51 -0400 (EDT) Received: from pastel (unknown [216.154.9.87]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7EF831200D7; Tue, 20 Aug 2024 08:15:50 -0400 (EDT) From: Stefan Monnier In-Reply-To: (Dario Gjorgjevski's message of "Sun, 18 Aug 2024 22:36:01 +0200") Message-ID: References: Date: Tue, 20 Aug 2024 08:15:49 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.104 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> - Eglot errors out. This should definitely not happen and seems like >> a regression. Restarting Eglot should definitely not be needed. >> Could you clarify what you mean by Eglot erroring out and why >> restarting it is necessary? > Eglot gets in a weird state and begins reporting erroneous data to the > LSP server. Can you give any further details? Stefan From unknown Tue Aug 19 02:58:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) Resent-From: Dario Gjorgjevski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Aug 2024 11:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72696 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 72696@debbugs.gnu.org Received: via spool by 72696-submit@debbugs.gnu.org id=B72696.172432573226934 (code B ref 72696); Thu, 22 Aug 2024 11:23:01 +0000 Received: (at 72696) by debbugs.gnu.org; 22 Aug 2024 11:22:12 +0000 Received: from localhost ([127.0.0.1]:36890 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sh5tL-00070L-VV for submit@debbugs.gnu.org; Thu, 22 Aug 2024 07:22:12 -0400 Received: from mail-lj1-f177.google.com ([209.85.208.177]:50237) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sh5tI-0006zt-Ph for 72696@debbugs.gnu.org; Thu, 22 Aug 2024 07:22:10 -0400 Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2f3ce5bc7d2so7084721fa.0 for <72696@debbugs.gnu.org>; Thu, 22 Aug 2024 04:21:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724325617; x=1724930417; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=WowPsqrkldlD+2VIfy6lY1NsYgS31R4Og6Hipn1AdBo=; b=IFf5yZY0KDLkBbC3PZdFAco6iUB1L/KWFfmhYTB9vIOAtTNSI3gdhj84UHE8d2cal2 Vo156XdjLsXAakH/1Br0g6vcnLW+joMPLgd5376TBnYKDIrmz0baddPFc/mVbjkqikPI 8ahmJjdbv8m3aOacAFwhOD8X9rawb7f2jkxyy795zACb6w6FqUO68YmwkSzeWa4B+VrR KKuseQOywE2pPIKhssYR+y/mN22lcDlwb8fLlDcA288KkYcLST0KAf+K8XFvZDlAeWOe SmSX4jVPez5K7Ss/86rmJRicz3PiS2i/NQ0LjbEutmjmSRvmDR6Bq3jZEVq7Enr201Oj 041A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724325617; x=1724930417; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WowPsqrkldlD+2VIfy6lY1NsYgS31R4Og6Hipn1AdBo=; b=eaAJiX0nbCZo2ngX7NTiHfrx3/4vufVBocLPeB07jknnYVBT3Q99KBGSFvc1B2ONre 5YegnPLAACoQce8syQua8Rl2w4y0kklFf5GVFVQS8TvqDTBlyD9iDebHQOSijTc7rVDn fQFCd9CR9HqyYemF+3Wgc2OSmOKxr4xbpmV5kxMfV0C/zGBRC6gpBGTY4K21u3/a2So6 Dt4clt1XmMdO4TCZyOj8PknJqPFKzWIn1duvvdX1C736AZloR2HYIt+k2pxeuhuVvtaw M+oEOr9KV2Fh5UYD7ABu5hvf40eK4B2aWszIZ25Y64EGAsWPGiZ3PJzgEtuxDpFK22pc jItA== X-Gm-Message-State: AOJu0YzIJm/Giz8Avx2/vV99CYEb/W85V8kr/hp3w1bOpAqf4ssz3GzQ R32oXj4JCd01a7n0SBl2i6SUvtMzYvbhSNj5OdBt+sNAtBEdeemdBS2lctTIRCZ5TULEFJr4cXk JE/lj5G+I1tulvU3ayFBgQ84b0GuVqInE X-Google-Smtp-Source: AGHT+IGN+77qunILaxU4csZESv3KZ4lv+dn10d+etOrB0xvbfOiAe4xjfuJHyHG08WpcF3HkwU1uEt2Xjx0hfIhNq20= X-Received: by 2002:a05:651c:1025:b0:2f3:ee44:c6de with SMTP id 38308e7fff4ca-2f405d9eee5mr8625711fa.27.1724325616118; Thu, 22 Aug 2024 04:20:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dario Gjorgjevski Date: Thu, 22 Aug 2024 13:19:39 +0200 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Stefan, On Tue, Aug 20, 2024 at 2:15=E2=80=AFPM Stefan Monnier wrote: > > >> - Eglot errors out. This should definitely not happen and seems like > >> a regression. Restarting Eglot should definitely not be needed. > >> Could you clarify what you mean by Eglot erroring out and why > >> restarting it is necessary? > > Eglot gets in a weird state and begins reporting erroneous data to the > > LSP server. > > Can you give any further details? Consider a Python file with the following contents (including a trailing newline): from urllib import urlretrieve local_filename, headers =3D urlretrieve('http://python.org/') Using the Pyright LSP server, Eglot correctly reports that: Pyright [reportAttributeAccessIssue]: "urlretrieve" is unknown import s= ymbol Now, rewrite the file using Node.js as instructed above so that its contents become (again, including a trailing newline): from urllib.request import urlretrieve local_filename, headers =3D urlretrieve('http://python.org/') Eglot now weirdly reports that: Pyright [reportMissingImports]: Import "urllib.request.request" could not be resolved Somehow it thinks that the ".request" part appears twice in a row. Here is the relevant communication between Eglot and Pyright: [jsonrpc] e[13:00:21.956] --> textDocument/didOpen { "jsonrpc": "2.0", "method": "textDocument/didOpen", "params": { "textDocument": { "uri": "file:///Volumes/workplace/playground/test.py", "version": 0, "languageId": "python", "text": "from urllib import urlretrieve\nlocal_filename, headers =3D urlretrieve('http://python.org/')\n" } } } [jsonrpc] e[13:00:22.617] <-- textDocument/publishDiagnostics { "jsonrpc": "2.0", "method": "textDocument/publishDiagnostics", "params": { "uri": "file:///Volumes/workplace/playground/test.py", "version": 0, "diagnostics": [ { "range": { "start": { "line": 0, "character": 19 }, "end": { "line": 0, "character": 30 } }, "message": "\"urlretrieve\" is unknown import symbol", "severity": 1, "code": "reportAttributeAccessIssue", "source": "Pyright", "codeDescription": { "href": "https://github.com/microsoft/pyright/blob/main/docs/configuration.md#repor= tAttributeAccessIssue" } } ] } } [jsonrpc] e[13:00:26.362] --> textDocument/didClose { "jsonrpc": "2.0", "method": "textDocument/didClose", "params": { "textDocument": { "uri": "file:///Volumes/workplace/playground/test.py" } } } [jsonrpc] e[13:00:26.364] --> textDocument/didOpen { "jsonrpc": "2.0", "method": "textDocument/didOpen", "params": { "textDocument": { "uri": "file:///Volumes/workplace/playground/test.py", "version": 0, "languageId": "python", "text": "from urllib.request import urlretrieve\nlocal_filename, headers =3D urlretrieve('http://python.org/')\n" } } } [jsonrpc] e[13:00:26.366] --> textDocument/didChange { "jsonrpc": "2.0", "method": "textDocument/didChange", "params": { "textDocument": { "uri": "file:///Volumes/workplace/playground/test.py", "version": 1 }, "contentChanges": [ { "range": { "start": { "line": 0, "character": 11 }, "end": { "line": 0, "character": 11 } }, "rangeLength": 0, "text": ".request" } ] } } [jsonrpc] e[13:00:26.629] <-- textDocument/publishDiagnostics { "jsonrpc": "2.0", "method": "textDocument/publishDiagnostics", "params": { "uri": "file:///Volumes/workplace/playground/test.py", "version": 1, "diagnostics": [ { "range": { "start": { "line": 0, "character": 5 }, "end": { "line": 0, "character": 27 } }, "message": "Import \"urllib.request.request\" could not be resolved", "severity": 1, "code": "reportMissingImports", "source": "Pyright", "codeDescription": { "href": "https://github.com/microsoft/pyright/blob/main/docs/configuration.md#repor= tMissingImports" } } ] } } As far as I can see, the testDocument/didChange request should not be there. The rewrite seems to have triggered a textDocument/didClose followed by a textDocument/didOpen, so the erroneous textDocument/didChange ended up making the LSP server think the ".request" part appears twice in a row. Best regards, Dario From unknown Tue Aug 19 02:58:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) Resent-From: Dario Gjorgjevski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Aug 2024 11:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72696 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 72696@debbugs.gnu.org Received: via spool by 72696-submit@debbugs.gnu.org id=B72696.172432617727755 (code B ref 72696); Thu, 22 Aug 2024 11:30:02 +0000 Received: (at 72696) by debbugs.gnu.org; 22 Aug 2024 11:29:37 +0000 Received: from localhost ([127.0.0.1]:36897 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sh60X-0007DZ-2L for submit@debbugs.gnu.org; Thu, 22 Aug 2024 07:29:37 -0400 Received: from mail-lj1-f172.google.com ([209.85.208.172]:49309) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sh60U-0007DL-RG for 72696@debbugs.gnu.org; Thu, 22 Aug 2024 07:29:35 -0400 Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2f3edb2d908so6817661fa.2 for <72696@debbugs.gnu.org>; Thu, 22 Aug 2024 04:28:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724326063; x=1724930863; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=f4x0DfRpyuMZjb3xeZFARskCJrjNkapIedujaj+jmps=; b=BSi4MVj93tZvdC1ZSHLflVAiMUc8HUu1I234BhwIa5e/lreFP9VbzkoLsMlAUWppKl RCZNcaYDwHR2y8kbdJeP/IKtLCddq4cCCOpOhGNJ3ztKvIdpFwMRfbvGNaMb/5LBU7ia sam36/7eAcd+QoeQa81Efzm6XDJR2hm4wMVHgs2mcurriEHYOLugKcjEzy7TI0gIV8Le u/jS1lux8xSfVv0u7r4+nWxD7AOSk35ruF+BTZsZomFyBq6tkPQWUx74uUgK6eXbN9R9 GRAtHNn6PDo7uXnGnf5iu2cdv0A/rh5HRvGdLe5qoCJ4xdY4kjKRfAMGkoCljZcBsyI2 iafg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724326063; x=1724930863; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=f4x0DfRpyuMZjb3xeZFARskCJrjNkapIedujaj+jmps=; b=EXO2TCDFrM/Idbc1D4uRuhIpXLjt1lLkYqg5dxonCiogS5gYobTvmaUMg/i5PV+W3M PPMzGysTHu0f4U7MnkS7B1h3yvj3su76+2HmNw7gzcI8246VQDCS1zmq6DK+Uzu+xXrq n1pIJckYOpvC5ZZoA3c3FRY6CplCLWdmCCxhTMQafB7F4YqCsubs6jzqysvERzoURSVx hjuNeDCqsEQ7C7UhPMfBXmw/Sbw5yxkLggurjXrXrj/779XTrMA28uNO/XTErGJs5B0h ZuMRQl9/stgBuSn4qamMcc+57CG9PApNymnT3npO91K+oMqL6HVQHwE8xo/dbFBMFSoG o5iw== X-Gm-Message-State: AOJu0YzPxwKnlodzJhYT8uW9//V8xk7BdFAfYGfC9VkIqvaPdoYE8NZt Qql2uPeq3e+9XfWwPxTuITOFJWk3mWU5htxvx+4D4Q638FvFhe2lnjpa2OdXFPmQeNXXBKOtbX8 E5aJ+I5nMhHLUxM6OyTerFC+g/wo= X-Google-Smtp-Source: AGHT+IGEkADRT9ijY5WEL94OON2MBFCHcEF2QE0WHCv9GYb4ZJds7NalMyy47YHcj3rsk9f8udtz688zSDND9VuGAgU= X-Received: by 2002:a2e:9dca:0:b0:2ee:8ea4:d649 with SMTP id 38308e7fff4ca-2f3f886a8b2mr30787051fa.16.1724326062439; Thu, 22 Aug 2024 04:27:42 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dario Gjorgjevski Date: Thu, 22 Aug 2024 13:27:06 +0200 Message-ID: Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) BTW, I am using Python for illustrative purposes only. This issue is particularly annoying when writing JavaScript/TypeScript with a LSP server and ESLint. Running eslint --fix for in-place linting makes ESLint rewrite the files in exactly this way (see https://github.com/eslint/eslint/blob/5dbdd63dc83428447e25f1fc1d05d8a69e3b006a/lib/eslint/eslint.js#L752), which then makes the LSP server exhibit weird diagnostics and necessitates a restart of Eglot. Best regards, Dario From unknown Tue Aug 19 02:58:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Sep 2024 07:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72696 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: monnier@iro.umontreal.ca, Dario Gjorgjevski Cc: 72696@debbugs.gnu.org Received: via spool by 72696-submit@debbugs.gnu.org id=B72696.17256933641007 (code B ref 72696); Sat, 07 Sep 2024 07:17:02 +0000 Received: (at 72696) by debbugs.gnu.org; 7 Sep 2024 07:16:04 +0000 Received: from localhost ([127.0.0.1]:54628 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smpfw-0000G9-3P for submit@debbugs.gnu.org; Sat, 07 Sep 2024 03:16:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smpfu-0000Fc-F2 for 72696@debbugs.gnu.org; Sat, 07 Sep 2024 03:16:03 -0400 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 1smpfn-0004sy-Py; Sat, 07 Sep 2024 03:15:56 -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=nH/dMzxU3X9/UjZbcMGt8esdfFh6DCYY3nUDUJn2xUc=; b=almEYTFHpeEC CXdXEEhpjlYwa7mH9TqLGfhskaMsVB+D5VchjWu6O/0JjjOEo8il5NWrH+lQZFqSFFhi/jYZNykim yfLjsB0Esb7zQvNUWWWwttWF9RQL/do3RTj8Kjfmz0noeRymZGTkjkMxbl6Q8PjQLHPRqhGYmYuHY MXtDNN7qDvT1sJeh05QYEl3SxY8YN3Mp7SHIIzv3yCofvV9kR+KEiZ0YcpAgkI0RAvlv5uPNrysOj UdBq3zaThqHKuWUcY//JZsqYROUJUIH0zR3lTPpnqdtHKWurHV8udi/F18ezlumE7sztas3QrUA5V mE2dszrO52C4XgAhNLu0xw==; Date: Sat, 07 Sep 2024 10:15:20 +0300 Message-Id: <86r09wylx3.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Dario Gjorgjevski on Thu, 22 Aug 2024 13:27:06 +0200) References: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 72696@debbugs.gnu.org > From: Dario Gjorgjevski > Date: Thu, 22 Aug 2024 13:27:06 +0200 > > BTW, I am using Python for illustrative purposes only. This issue is > particularly annoying when writing JavaScript/TypeScript with a LSP > server and ESLint. Running eslint --fix for in-place linting makes > ESLint rewrite the files in exactly this way (see > https://github.com/eslint/eslint/blob/5dbdd63dc83428447e25f1fc1d05d8a69e3b006a/lib/eslint/eslint.js#L752), > which then makes the LSP server exhibit weird diagnostics and > necessitates a restart of Eglot. Stefan, any comments? From unknown Tue Aug 19 02:58:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Sep 2024 23:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72696 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dario Gjorgjevski Cc: 72696@debbugs.gnu.org Received: via spool by 72696-submit@debbugs.gnu.org id=B72696.17258368277197 (code B ref 72696); Sun, 08 Sep 2024 23:08:01 +0000 Received: (at 72696) by debbugs.gnu.org; 8 Sep 2024 23:07:07 +0000 Received: from localhost ([127.0.0.1]:60281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snQzq-0001s1-Tc for submit@debbugs.gnu.org; Sun, 08 Sep 2024 19:07:07 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:5330) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1snQzp-0001rM-CT for 72696@debbugs.gnu.org; Sun, 08 Sep 2024 19:07:05 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 3D7EA100043; Sun, 8 Sep 2024 19:06:57 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1725836816; bh=mrkklYK+I0pTjC9FpVjf0zn0etRjm5RBZNKVfomQt64=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=nnN6jg7lH+cLVMPliIOfgUOuJd3iRG8hb4bd046sfI30fSWCj6Gqk/ao0IUjD2Tk3 U1sOP+h2x8p5VFheaG+SL6kEySsDb/DlSqerD1umAfsK+ttqcIUyG4qs0QL0WORn8X yuYJrEnLvSL1/k+5fteXEgMwNVVn8HldjPRomUlQP6HKuFZBmDrlstgvPOfZAtezES XeJnFesob7D0LFjFk1XbxNt4U/X3KARYFWpqOqPiow6cmHPGa2odhNnSBwlqS6svNP chZY0MUh/6edsDhmtXnua36lhqKY5q3VF6SkJI1fTca38T0JRctYRYLKbAQHHcGzQT g40GbDHv7t62w== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 1FE4310002E; Sun, 8 Sep 2024 19:06:56 -0400 (EDT) Received: from asado (104-195-201-118.cpe.teksavvy.com [104.195.201.118]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E4D80120313; Sun, 8 Sep 2024 19:06:55 -0400 (EDT) From: Stefan Monnier In-Reply-To: (Dario Gjorgjevski's message of "Thu, 22 Aug 2024 13:19:39 +0200") Message-ID: References: Date: Sun, 08 Sep 2024 19:06:55 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.005 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain > As far as I can see, the testDocument/didChange request should not be > there. Either the `didClose/didOpen` should not be there, or the `didChange` should not be there. The problem is that we have both. Can you try the patch below, which I suspect should fix your problem? It should get rid of the `didChange` in your recipe. We could also change Eglot so it doesn't do `didClose/didOpen` upon `revert-buffer` (in which case it should/will do the `didChange`), but that should be a separate concern. Stefan --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=eglot.patch diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 82e99a2c920..a2c9f73fc73 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2813,6 +2813,8 @@ eglot--signal-textDocument/didChange (defun eglot--signal-textDocument/didOpen () "Send textDocument/didOpen to server." + ;; Flush any potential pending change. + (eglot--track-changes-fetch eglot--track-changes) (setq eglot--recent-changes nil eglot--versioned-identifier 0 eglot--TextDocumentIdentifier-cache nil) --=-=-=-- From unknown Tue Aug 19 02:58:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) Resent-From: Dario Gjorgjevski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Sep 2024 22:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72696 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 72696@debbugs.gnu.org Received: via spool by 72696-submit@debbugs.gnu.org id=B72696.172669707828827 (code B ref 72696); Wed, 18 Sep 2024 22:05:01 +0000 Received: (at 72696) by debbugs.gnu.org; 18 Sep 2024 22:04:38 +0000 Received: from localhost ([127.0.0.1]:59339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sr2mr-0007Ut-Lh for submit@debbugs.gnu.org; Wed, 18 Sep 2024 18:04:37 -0400 Received: from mail-lj1-f172.google.com ([209.85.208.172]:45311) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sr2mo-0007Uc-Lt for 72696@debbugs.gnu.org; Wed, 18 Sep 2024 18:04:35 -0400 Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2f75129b3a3so1436421fa.2 for <72696@debbugs.gnu.org>; Wed, 18 Sep 2024 15:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726696992; x=1727301792; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=P28BB4H3L0l5HUQaHnoo2uCSFu5eorwJAhVGbqPH3oc=; b=fC1U1wc5XL3y1ibZ6LfCBQN8k/Qi4UEXs07evejFcUMoURWH8anNQg6ONAbrNNX8tZ xz/GVj/CFpCkh8FFPMKO6QiOge/YPprGqopODr1c5kgbzyrpx+NguDSWx0RpanwNnHob OMTBVZtpGXYLXB3pgUdqGKOOtEO9AcQ+stmA4MQmQKZGG6ZvYSUlxDbP1I2kthuf915O wo2JSpgueDWfQ4SceHM3wlXZho3sPYAsfQ1Ypk95sYXvrfLXDl+xpOr0eswmuyoxz41T VDaoG5SOs3Q1jgI20GDnHtdtVnciIp5vXtO0e+KaFSWS0eIaix3kaYd9E4mBY32stEhR SKig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726696992; x=1727301792; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P28BB4H3L0l5HUQaHnoo2uCSFu5eorwJAhVGbqPH3oc=; b=i1q3aqY2HXCKgYR6TqXREExqz6s6Gcw9qTLiUfWDFzmnyVDcppPhDiPMlUjx0L/w1i dVAA+saXP1nj2i1/ed2ByHzPp3p9Q/GkzpJYFbOZE4eeWKB3BuNcX/paEtZidImRXZzT J9wVT02qVJU8aUne7kEtWkMOxOoDXDG+yBaNT6zX2uuDClotBMHmBNWmRAaOG+8mUY9j qVsbsslqgfFKAxSkIgkiqE3oaF7by6zJ7P7e7rANTl2403oWpbVrY3pjFked2DAJSAZT gbCbECn0Zy77tOua+cw5hWkLg50zzemXqnj/JH//KIb8xVKXCfS42mEPV1689mb5JpIr x8kw== X-Gm-Message-State: AOJu0YzHASsWtmIBObzOuUl/l6LXwTFDUb9bpkjMmqhROf6jPvzt6YBt eweas79g6LRgv0nkoAsniDIGhvDkWoEFSYHW8rY/ppKrE2J8+pXgPbAkvF9RiO8ebnmgJRAQw6n 0ZG6fxOh3MlqxfLZS1bpZrQizhF8= X-Google-Smtp-Source: AGHT+IEx8MeAkwAkKAHtaw6s6YJYQItftX0Gp4BUmoOmyYMwnllhawRJcMc6ApatoVOeH2iLAhDSWEpTShhdFGHq/VE= X-Received: by 2002:a2e:a99d:0:b0:2ee:7a54:3b08 with SMTP id 38308e7fff4ca-2f787dabdd6mr134552171fa.3.1726696991391; Wed, 18 Sep 2024 15:03:11 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dario Gjorgjevski Date: Thu, 19 Sep 2024 00:02:34 +0200 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Stefan, On Mon, Sep 9, 2024 at 1:06=E2=80=AFAM Stefan Monnier wrote: > > > As far as I can see, the testDocument/didChange request should not be > > there. > > Either the `didClose/didOpen` should not be there, or the `didChange` sho= uld > not be there. The problem is that we have both. > > Can you try the patch below, which I suspect should fix your problem? > It should get rid of the `didChange` in your recipe. I gave your patch a try and it indeed fixes the issue. Thank you very much for looking into it! Best regards, Dario From unknown Tue Aug 19 02:58:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Sep 2024 05:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72696 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dario Gjorgjevski , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: 72696@debbugs.gnu.org, monnier@iro.umontreal.ca Received: via spool by 72696-submit@debbugs.gnu.org id=B72696.172672409925307 (code B ref 72696); Thu, 19 Sep 2024 05:35:01 +0000 Received: (at 72696) by debbugs.gnu.org; 19 Sep 2024 05:34:59 +0000 Received: from localhost ([127.0.0.1]:59620 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sr9oh-0006a7-AA for submit@debbugs.gnu.org; Thu, 19 Sep 2024 01:34:59 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sr9of-0006Zr-4g for 72696@debbugs.gnu.org; Thu, 19 Sep 2024 01:34:58 -0400 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 1sr9mD-0004I2-DK; Thu, 19 Sep 2024 01:32:25 -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=U3J2RoSqezmfLc3nWAiLKNj0VtYRYz14JvD2JQOmWlU=; b=i96q5yq3NCY13hSHDZ+p qLJE75f7J4m4DF/vNU3LNKDAA0FHqr0BgEyT4n2kcbr24mNHZPtjGW2jPYFoa0sbfbDY8txGI0DZV +AAAXio26vBcI7gxxtnDHllkznA9r91or2vLxLqbKO5i76+lqtHCOg+tpeF2CqSZXtHnPJk2j75je px+Zd1Ddq99igQn8XGyZ7a+eqyVRpFR6yVbe2Grt4N6DZKyuFehjStQevu5DQWQGwYRZ06Ju51Pwy tPBa/rAks8x6Z2gaU87sIjMU27gUZb583n4b2qUGxQQnajzPbfcZytEA8RFwJBxUwE9wJuZjX+eEB Zh+sChA+L59bXg==; Date: Thu, 19 Sep 2024 08:32:21 +0300 Message-Id: <86a5g49pju.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Dario Gjorgjevski on Thu, 19 Sep 2024 00:02:34 +0200) References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 72696@debbugs.gnu.org > From: Dario Gjorgjevski > Date: Thu, 19 Sep 2024 00:02:34 +0200 > > Hi, Stefan, > > On Mon, Sep 9, 2024 at 1:06 AM Stefan Monnier wrote: > > > > > As far as I can see, the testDocument/didChange request should not be > > > there. > > > > Either the `didClose/didOpen` should not be there, or the `didChange` should > > not be there. The problem is that we have both. > > > > Can you try the patch below, which I suspect should fix your problem? > > It should get rid of the `didChange` in your recipe. > > I gave your patch a try and it indeed fixes the issue. Thank you very > much for looking into it! João, is Stefan's patch okay with you? AFAIU, the same problem exists on the emacs-30 release branch, so I'd like to install the patch there, if you agree. Here's the patch in case you didn't see it (I CC'ed you on the original report, but subsequent discussion omitted you for some reason, sigh): diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 82e99a2c920..a2c9f73fc73 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2813,6 +2813,8 @@ eglot--signal-textDocument/didChange (defun eglot--signal-textDocument/didOpen () "Send textDocument/didOpen to server." + ;; Flush any potential pending change. + (eglot--track-changes-fetch eglot--track-changes) (setq eglot--recent-changes nil eglot--versioned-identifier 0 eglot--TextDocumentIdentifier-cache nil) From unknown Tue Aug 19 02:58:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Sep 2024 12:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72696 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 72696@debbugs.gnu.org, Dario Gjorgjevski , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Received: via spool by 72696-submit@debbugs.gnu.org id=B72696.172675074020865 (code B ref 72696); Thu, 19 Sep 2024 12:59:01 +0000 Received: (at 72696) by debbugs.gnu.org; 19 Sep 2024 12:59:00 +0000 Received: from localhost ([127.0.0.1]:59996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srGkN-0005QT-Sx for submit@debbugs.gnu.org; Thu, 19 Sep 2024 08:59:00 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:49588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srGkK-0005QA-PV for 72696@debbugs.gnu.org; Thu, 19 Sep 2024 08:58:57 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id EE40A100055; Thu, 19 Sep 2024 08:58:32 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1726750711; bh=XtjPeeF4v2mKWeCLte4xHVQtpuZa1xJ2G61h7nMszNo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=L7plHJvBzxxEPyY+1pb9G411cjneDTI09sWJ+/+3ATMlOtp1x1aEsztr/kWnr4YkS 8ty1A6b79G5aSqwirLwlT64iWQetwINCPk/m64NRUhpzU6brm2JSCZNTGKVBTdbM+q +iecrYNt7XNPh7s0Mu2tSG7aK92D5I8mkzY+GJswxVO5DWrWkOvrOXYltKf9znUCi2 5zz5BV6LLzFaaUjJCy05WcnCJwxzPbw+qIxbwgwXICUDsujluufGjYm2uUDQHxI5XD mIwHITC723x1fqWEs+wiu9fayrMXyzmEC8wQPXLQ7Y5+Zo3/Am09clcrzfek2VYSC+ 41OMaubJUyiTQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id D3230100043; Thu, 19 Sep 2024 08:58:31 -0400 (EDT) Received: from pastel (104-195-209-174.cpe.teksavvy.com [104.195.209.174]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A0334120667; Thu, 19 Sep 2024 08:58:31 -0400 (EDT) From: Stefan Monnier In-Reply-To: <86a5g49pju.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 19 Sep 2024 08:32:21 +0300") Message-ID: References: <86a5g49pju.fsf@gnu.org> Date: Thu, 19 Sep 2024 08:58:22 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.192 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Jo=E3o, is Stefan's patch okay with you? AFAIU, the same problem exists > on the emacs-30 release branch, so I'd like to install the patch > there, if you agree. Indeed, it belongs there. It should have been part of the original commit d7a83e23d47c. Stefan From unknown Tue Aug 19 02:58:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Sep 2024 21:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72696 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 72696@debbugs.gnu.org, Eli Zaretskii , Dario Gjorgjevski Received: via spool by 72696-submit@debbugs.gnu.org id=B72696.17267825324121 (code B ref 72696); Thu, 19 Sep 2024 21:49:02 +0000 Received: (at 72696) by debbugs.gnu.org; 19 Sep 2024 21:48:52 +0000 Received: from localhost ([127.0.0.1]:33607 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srP1A-00014P-EM for submit@debbugs.gnu.org; Thu, 19 Sep 2024 17:48:52 -0400 Received: from mail-oi1-f179.google.com ([209.85.167.179]:45188) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srP18-000148-6H for 72696@debbugs.gnu.org; Thu, 19 Sep 2024 17:48:51 -0400 Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-3e03e9d1f8dso828937b6e.2 for <72696@debbugs.gnu.org>; Thu, 19 Sep 2024 14:48:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726782446; x=1727387246; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=emc8Fv3royuVGaO0AddIASzAmKjzkF3of7Bz2hmj4Ao=; b=hiVJxv/a1Z7riAHYkiB1RS6L6tAeGlBfs0xdszzlDNnXrK+WRW3v2F0E+pkon6izQY 35WzWw83O+lAD/3fljfO5muOfJIC46CmYoVVA2VBlqZUNoFiPLgO+j8jfNU7vviUswSS GG7gMdbN8BYtL4IXNobNiwdtAS6L+OdbOvdLJGY26IXBvfDbfmQEJPcNOiT+H5pgSIzY UpPM9aOC7jH70L9dJxdZNeUGfYQWE+bG1NRVRPOvllM1+U2MgDFqdPmbuVfSzzinA3Sm 8CJyVsj/jjr5w2hdX8R12C6wjOhW8C8euAHpYk7FOMK6KXbB5UWDZxL5DfOCXm3yb+/Q 2cwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726782446; x=1727387246; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=emc8Fv3royuVGaO0AddIASzAmKjzkF3of7Bz2hmj4Ao=; b=L9QjShSjMFuWsz9rcCAvDm6ku5tp0fea1mjGaJHZmHaL7/DwSi3BfovdcZFg5CushN 6hkwwHGiYCkwAcTXubje8nXEhspPF2hbGoqxlPBoIBl1tyfZ0/wWu3QS2rW+ojWoF6sR i//DqrRq4ghplQGQRtxeg7+lALm476r2oqNekQaluyq8q40Sk9c35MVAPobNYipL40zt pqq+kMiZB5aHaUT7XLiD2zIiNU/C0oafoV4G1ynN/EPmh/Xg1k44qCk9GIWGJuhPfNvF WzhSrMJd+hlBokLcU4X1Qc0jPd9b8skbOJU5MeP+dnjEXJbOPPfGCQ/VDAwhcvJIpIFf 6DTg== X-Forwarded-Encrypted: i=1; AJvYcCUABgQfmYths2SeJUKE3QeeSOgFNMsKZCFIAskN3h8w6xBdbh4fVYmnUx8BocXb1p/6FmGPuQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0Ywxypf8w7tWbOOquoHpml/Fgp3dkCEi/dSCxEU5k2N/gdDeh4eX z0gZScXxAWaDJwcdpt/sn4A+xJn7aGIY0dRT/KmYO3K1b5XXySkJOSt4m83XXoxPJ0JLK2+bEFu wcrMVf6P1Az29+wN2r2o0DLlmAZs= X-Google-Smtp-Source: AGHT+IEkE3eeHh6fJlFdOr2wE39ghXTx1kvCCEIsq4S519PiQleVXV6bGQNRg1qOdZJGAHMa1l2vHUKiY8yoxxpcI4w= X-Received: by 2002:a05:6808:1886:b0:3e0:3aa5:2b88 with SMTP id 5614622812f47-3e271cd223dmr692485b6e.44.1726782446154; Thu, 19 Sep 2024 14:47:26 -0700 (PDT) MIME-Version: 1.0 References: <86a5g49pju.fsf@gnu.org> In-Reply-To: From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Date: Thu, 19 Sep 2024 22:47:14 +0100 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Thu, Sep 19, 2024 at 1:58=E2=80=AFPM Stefan Monnier wrote: > > > Jo=C3=A3o, is Stefan's patch okay with you? AFAIU, the same problem ex= ists > > on the emacs-30 release branch, so I'd like to install the patch > > there, if you agree. > > Indeed, it belongs there. > It should have been part of the original commit d7a83e23d47c. You can go ahead and merge it. I dont' know what it does but i trust Stefan. Although I have to say that on the topic of synchronization failures between Eglot and servers, I'm not sure that things have improved much since this new layer of abstraction was added. By "I'm not sure" I really mean that. Maybe pre-existing failures are just more visible right now (because the new code warns and logs them), but I have a nagging feeling that there are more of them. No hard proof though. I also half-expected things to get fixed in Emacs proper, using Eglot as testing bed, but I'm not sure that has happened either. Anyway this is just a comment. Jo=C3=A3o From unknown Tue Aug 19 02:58:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Sep 2024 06:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72696 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: 72696@debbugs.gnu.org, dario.gjorgjevski@gmail.com, monnier@iro.umontreal.ca Received: via spool by 72696-submit@debbugs.gnu.org id=B72696.172681334615810 (code B ref 72696); Fri, 20 Sep 2024 06:23:02 +0000 Received: (at 72696) by debbugs.gnu.org; 20 Sep 2024 06:22:26 +0000 Received: from localhost ([127.0.0.1]:33898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srX2A-00046w-DF for submit@debbugs.gnu.org; Fri, 20 Sep 2024 02:22:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51098) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srX27-00046U-Pm for 72696@debbugs.gnu.org; Fri, 20 Sep 2024 02:22:24 -0400 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 1srX1k-0005Jh-0U; Fri, 20 Sep 2024 02:22:00 -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=hvp7HHUwSk+hF0vzOPkz9ZG3IGO0fGBj8ajMwfeZ7xU=; b=bcMiBGptT7V5S/a4Nz5Q qfTXCr03oP2ktIXoAP/8CLuCNTpuPcjUo9s8lEz8dfOdW5hvgOBN8f0HUfDGRoK9ikxxlhV4qmq6L dycjVKvoghfVXK+zHW5ovJmdusaW6XGIXRfHvpf3W5jidjhdadjGobPEIa8XiNH8BnoJ/Zyrcx8Ec dZhTjtNmbtpPEfHcq/kQ15b4bxxMaVh5GAsZSXelVyAqei/sgnywyqTvrWNY7MuD3imfzKlTd3rNU I/kzM22rqX54KrLR9oin9y3P51NrsCgHNUS7QnfHNmLD5+ltExPBEurarlUDjvx0ZD8HdgSjEQJ5D XSqvO/ANlQ5Ltw==; Date: Fri, 20 Sep 2024 09:21:57 +0300 Message-Id: <86ttea7sl6.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= on Thu, 19 Sep 2024 22:47:14 +0100) References: <86a5g49pju.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: João Távora > Date: Thu, 19 Sep 2024 22:47:14 +0100 > Cc: Eli Zaretskii , Dario Gjorgjevski , 72696@debbugs.gnu.org > > On Thu, Sep 19, 2024 at 1:58 PM Stefan Monnier wrote: > > > > > João, is Stefan's patch okay with you? AFAIU, the same problem exists > > > on the emacs-30 release branch, so I'd like to install the patch > > > there, if you agree. > > > > Indeed, it belongs there. > > It should have been part of the original commit d7a83e23d47c. > > You can go ahead and merge it. I dont' know what it does > but i trust Stefan. Thanks. Stefan, please install on the emacs-30 branch. > Although I have to say that on the topic of synchronization failures > between Eglot and servers, I'm not sure that things have improved > much since this new layer of abstraction was added. By "I'm not > sure" I really mean that. Maybe pre-existing failures are just more > visible right now (because the new code warns and logs them), but > I have a nagging feeling that there are more of them. No hard > proof though. > > I also half-expected things to get fixed in Emacs proper, using > Eglot as testing bed, but I'm not sure that has happened either. > Anyway this is just a comment. I agree with your general feeling, and I think this case might belong to those pre-existing failures which track-changes uncovers. From unknown Tue Aug 19 02:58:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Sep 2024 18:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72696 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 72696@debbugs.gnu.org, dario.gjorgjevski@gmail.com, =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Received: via spool by 72696-submit@debbugs.gnu.org id=B72696.172685803419359 (code B ref 72696); Fri, 20 Sep 2024 18:48:02 +0000 Received: (at 72696) by debbugs.gnu.org; 20 Sep 2024 18:47:14 +0000 Received: from localhost ([127.0.0.1]:36346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sriev-00052A-J8 for submit@debbugs.gnu.org; Fri, 20 Sep 2024 14:47:13 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:33273) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sries-00051s-TY for 72696@debbugs.gnu.org; Fri, 20 Sep 2024 14:47:11 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id CB697100044; Fri, 20 Sep 2024 14:46:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1726858004; bh=xlMk84si/Z7fgum+zndAcRV8guNnj6+f7b5b5eWe4p4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=oH6aLmBqgnehCTf/IGtiq2uBICNF0RbK0J4F6N80F2I/H6Wp8ynpofmY1TCvtO5o6 CCaJz6e4rreeCRkKmd8AZA+Mx8VbjV+aldhO8q56n97WsLtcwSoQKVZaB3fm/LA+bJ FbhwQLepzPSV34maynLE/Io5uTQNYvZdfO+zbtmyXMTsZgIlpxytZo3GWasPylHOJ4 4xeLrQiquiNb9dklSmPvI2zN/hn0om1bd0Jl6ZTrJ4zOiDlfBc0KKYmFpuNk5kmNYi e7sT1g0XtS8C4pF9pcTPW9k/FS8l4dpsubseKjIFixh+wcZyuR8vK4YTEY+bigPguG II++OQ9mjKFbA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A31F8100035; Fri, 20 Sep 2024 14:46:44 -0400 (EDT) Received: from asado (modemcable031.210-178-173.mc.videotron.ca [173.178.210.31]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 75DF912022A; Fri, 20 Sep 2024 14:46:44 -0400 (EDT) From: Stefan Monnier In-Reply-To: <86ttea7sl6.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 20 Sep 2024 09:21:57 +0300") Message-ID: References: <86a5g49pju.fsf@gnu.org> <86ttea7sl6.fsf@gnu.org> Date: Fri, 20 Sep 2024 14:46:43 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> You can go ahead and merge it. I dont' know what it does >> but i trust Stefan. > Thanks. Stefan, please install on the emacs-30 branch. Thanks, done. > I agree with your general feeling, and I think this case might belong > to those pre-existing failures which track-changes uncovers. FWIW, I think this bug was one that I introduced when changing Eglot to use track-changes (basically, because track-changes does its own "buffering" in addition to the one Eglot does in `eglot--recent-changes`, and I forgot to flush that buffer when `eglot--recent-changes` is flushed). Stefan From unknown Tue Aug 19 02:58:11 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Dario Gjorgjevski Subject: bug#72696: closed (Re: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS)) Message-ID: References: X-Gnu-PR-Message: they-closed 72696 X-Gnu-PR-Package: emacs Reply-To: 72696@debbugs.gnu.org Date: Tue, 24 Sep 2024 17:53:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1727200382-13195-1" This is a multi-part message in MIME format... ------------=_1727200382-13195-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #72696: Track-changes errors out when file is overwritten using Node.js's f= s.writeFile (at least on macOS) which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 72696@debbugs.gnu.org. --=20 72696: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D72696 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1727200382-13195-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 72696-done) by debbugs.gnu.org; 24 Sep 2024 17:52:30 +0000 Received: from localhost ([127.0.0.1]:60318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1st9iA-0003Pv-6F for submit@debbugs.gnu.org; Tue, 24 Sep 2024 13:52:30 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:42401) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1st9i8-0003Pb-PM for 72696-done@debbugs.gnu.org; Tue, 24 Sep 2024 13:52:29 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id C4EDA100046; Tue, 24 Sep 2024 13:51:58 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1727200318; bh=2JZZDQRBzLIVoVqtjZ1/lTqEMwPGYRC7z8+krNCZmFM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=hrUl6G6OjqmHAseovcpxRdMB4ukNuIZfLWnuB/KfVjDweG41bdvsA+1OjFD7yqKlJ iW2rUgPvoa1RosQwkxX0p27wTEC5h49RlSpDa8OltaVIKj1GXF4EOfsZhmRWG2+7ry vbGe0EgHIuTAjCTJST29bnl7eoypTIKpNaJeEqhMgqaJNCSu3XR+7b+vOTX/LKlgx4 0Z7r/j1ncK/vJxSgTluI/PO3ZsGdn1XgsipC41mgoJDvpOtYxTS3LTCG2EhSq8hj8j jQcCqKPQfaT9KJskMC/JrxdoS8aqBMjhCNKHEDoPIUCYHq/0BMi8Ana8aAynxlFLyy lB9ByJicJaJ1A== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 2994510002E; Tue, 24 Sep 2024 13:51:58 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1C567120837; Tue, 24 Sep 2024 13:51:58 -0400 (EDT) From: Stefan Monnier To: 72696-done@debbugs.gnu.org Subject: Re: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) In-Reply-To: (Stefan Monnier's message of "Fri, 20 Sep 2024 14:46:43 -0400") Message-ID: References: <86a5g49pju.fsf@gnu.org> <86ttea7sl6.fsf@gnu.org> Date: Tue, 24 Sep 2024 13:51:57 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.160 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72696-done Cc: , dario.gjorgjevski@gmail.com, =?windows-1252?B?Sm/jbyBU4XZvcmE=?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >>> You can go ahead and merge it. I dont' know what it does >>> but i trust Stefan. >> Thanks. Stefan, please install on the emacs-30 branch. > Thanks, done. Closing, Stefan ------------=_1727200382-13195-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 18 Aug 2024 10:59:48 +0000 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 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 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 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 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) MIME-Version: 1.0 From: Dario Gjorgjevski Date: Sun, 18 Aug 2024 12:58:24 +0200 Message-ID: Subject: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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 ------------=_1727200382-13195-1--