GNU bug report logs - #72696
Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS)

Previous Next

Package: emacs;

Reported by: Dario Gjorgjevski <dario.gjorgjevski <at> gmail.com>

Date: Sun, 18 Aug 2024 11:00:01 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#72696: closed (Track-changes errors out when file is
 overwritten using Node.js's fs.writeFile (at least on macOS))
Date: Tue, 24 Sep 2024 17:53:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 24 Sep 2024 13:51:57 -0400
with message-id <jwva5fxj5yq.fsf-monnier+emacs <at> gnu.org>
and subject line Re: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS)
has caused the debbugs.gnu.org bug report #72696,
regarding Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS)
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
72696: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=72696
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Dario Gjorgjevski <dario.gjorgjevski <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 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
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 (#<buffer test.py>) nil)
       (t #<subr auto-revert-buffers> nil nil)
       (t auto-revert-buffers <at> buffer-list-filter
          (#<subr auto-revert-buffers>) nil)
       (t apply
          (auto-revert-buffers <at> buffer-list-filter #<subr
                              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

Best regards,
Dario


[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 72696-done <at> debbugs.gnu.org
Cc: , dario.gjorgjevski <at> gmail.com,
 João Távora <joaotavora <at> gmail.com>
Subject: Re: bug#72696: Track-changes errors out when file is overwritten
 using Node.js's fs.writeFile (at least on macOS)
Date: Tue, 24 Sep 2024 13:51:57 -0400
>>> 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



This bug report was last modified 299 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.