From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii 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: Thu, 19 Sep 2024 08:32:21 +0300 Message-ID: <86a5g49pju.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18378"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72696@debbugs.gnu.org, monnier@iro.umontreal.ca To: Dario Gjorgjevski , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 19 07:35:14 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 1sr9ow-0004cx-4u for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Sep 2024 07:35:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sr9oW-0002Os-KO; Thu, 19 Sep 2024 01:34:48 -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 1sr9oV-0002Ja-9r for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2024 01:34:47 -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 1sr9oU-0004VW-Vc for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2024 01:34:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=U3J2RoSqezmfLc3nWAiLKNj0VtYRYz14JvD2JQOmWlU=; b=MgF0miRT6PrG4gxExIArwYdR2kX35hvFD4hAU77Frs6FjBIEtMh38+FvgQODQcAG/hlq6vExe3MVSvptkmoz0n7M4URocC28IM5VQZezZRFsokGcoho3rMGj81CZqoovyCmb+xiC76tha8B1yTmNf6EcFjbiPEoX7qN/uIxj4azZaC7C6canLW2fhQB3nrSKQJ/f8mYlus7+hEQOfVo0N87PQZ3nJuuFFaktHMxWoby3hOarYnSyCx0cBUl8LXludLlCZEhqF4BOHB+afqZxvLRh27+gsmNkhRfXlQ53+g5cw3xoWax3nzfkLlm70cqbF66MQJd2VOhTAUqr/O2vUQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sr9oj-0006aU-SD for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2024 01:35:01 -0400 X-Loop: help-debbugs@gnu.org 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 Original-Received: via spool by 72696-submit@debbugs.gnu.org id=B72696.172672409925307 (code B ref 72696); Thu, 19 Sep 2024 05:35:01 +0000 Original-Received: (at 72696) by debbugs.gnu.org; 19 Sep 2024 05:34:59 +0000 Original-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 Original-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 Original-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==; In-Reply-To: (message from Dario Gjorgjevski on Thu, 19 Sep 2024 00:02:34 +0200) 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:292028 Archived-At: > 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)