From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dario Gjorgjevski 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: Sun, 18 Aug 2024 22:36:01 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22061"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72696@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 18 22:38:51 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 1sfmfq-0005aO-9n for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Aug 2024 22:38:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sfmfV-0003xw-PX; Sun, 18 Aug 2024 16:38:29 -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 1sfmfT-0003xe-Pd for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2024 16:38:27 -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 1sfmfO-0001JE-9M for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2024 16:38:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=43m00W62Y5INgxzYF1oTO4ORDawtARCemO6QQrUdwys=; b=CFBJKhP5Uk0L8QV+TkpuXI/iGlOm75CSGe4UmRLw2nv46+oD2RcPiBBS7se67ga2ZVzINddxOToLGUU2joqRrvfgskLEiwWAv3XzqGXU8Ja1PNDq90HFSRPWAqaLdCUiwudy3GRrpFK1zztVB5sS0MsXR8TYYhI4MR2G6gnXV1TSousHN8krJXlVWUT8Tk1ihdjVlr2arxlR+8iVdkhCAWJPcmLWKsV1OMepFmCVcMiESzFfFwKScqIkUbqJGH2uD3SMpW8se+Q52H3Lc40Elj0XPsuRjTqSj2UM7iyFLTCI1rBxp0T3n0MaYLUixbkMw84O+d5PnvNLDItTAXseNQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sfmg2-0001oV-IQ for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2024 16:39:02 -0400 X-Loop: help-debbugs@gnu.org 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 Original-Received: via spool by 72696-submit@debbugs.gnu.org id=B72696.17240135086915 (code B ref 72696); Sun, 18 Aug 2024 20:39:02 +0000 Original-Received: (at 72696) by debbugs.gnu.org; 18 Aug 2024 20:38:28 +0000 Original-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 Original-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 Original-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) In-Reply-To: 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:290355 Archived-At: 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