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


Message #35 received at 72696 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dario Gjorgjevski <dario.gjorgjevski <at> gmail.com>,
 João Távora <joaotavora <at> gmail.com>
Cc: 72696 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: Re: bug#72696: Track-changes errors out when file is overwritten using
 Node.js's fs.writeFile (at least on macOS)
Date: Thu, 19 Sep 2024 08:32:21 +0300
> Cc: 72696 <at> debbugs.gnu.org
> From: Dario Gjorgjevski <dario.gjorgjevski <at> gmail.com>
> Date: Thu, 19 Sep 2024 00:02:34 +0200
> 
> Hi, Stefan,
> 
> On Mon, Sep 9, 2024 at 1:06 AM Stefan Monnier <monnier <at> iro.umontreal.ca> 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)




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.