all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dario Gjorgjevski <dario.gjorgjevski@gmail.com>
To: 72696@debbugs.gnu.org
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	[thread overview]
Message-ID: <CAJm4QYP7j_yo5R6sb__NJNzmV1w1Vmht8R=23VUEr9FQVs=BQg@mail.gmail.com> (raw)

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@buffer-list-filter
          (#<subr auto-revert-buffers>) nil)
       (t apply
          (auto-revert-buffers@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





             reply	other threads:[~2024-08-18 10:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-18 10:58 Dario Gjorgjevski [this message]
2024-08-18 11:02 ` bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) Eli Zaretskii
2024-08-18 16:10 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-18 20:36   ` Dario Gjorgjevski
2024-08-20 12:15     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-22 11:19       ` Dario Gjorgjevski
2024-08-22 11:27         ` Dario Gjorgjevski
2024-09-07  7:15           ` Eli Zaretskii
2024-09-08 23:06         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-18 22:02           ` Dario Gjorgjevski
2024-09-19  5:32             ` Eli Zaretskii
2024-09-19 12:58               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJm4QYP7j_yo5R6sb__NJNzmV1w1Vmht8R=23VUEr9FQVs=BQg@mail.gmail.com' \
    --to=dario.gjorgjevski@gmail.com \
    --cc=72696@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.