GNU bug report logs - #70927
30.0.50; track-changes assertion when shutting down eglot

Previous Next

Package: emacs;

Reported by: Steven Allen <steven <at> stebalien.com>

Date: Mon, 13 May 2024 22:22:02 UTC

Severity: normal

Found in version 30.0.50

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: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Steven Allen <steven <at> stebalien.com>
Cc: 70927 <at> debbugs.gnu.org
Subject: bug#70927: Acknowledgement (30.0.50; track-changes assertion when shutting down eglot)
Date: Wed, 15 May 2024 14:49:59 -0400
> A quick fix would be to change `eglot--signal-textDocument/didChange`:
>
> - from: `(eglot--track-changes-fetch eglot--track-changes)`
> - to: `(when eglot--track-changes (eglot--track-changes-fetch eglot--track-changes))`
>
> But I'm guessing there's some underlying problem and this may be masking
> the real issue.

Indeed.  I pushed the patch below to `master` instead which should also
fix the problem.  Please confirm that it fixes it for you as well.
Maybe `eglot-shutdown` shouldn't end up calling
`eglot--signal-textDocument/didChange` at all, but that's a long
standing behavior AFAICT, so I'll leave it for some other time.


        Stefan


diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 57a019e126d..0ba69f66f0d 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -2022,9 +2022,6 @@ eglot--managed-mode
       (eldoc-mode 1))
     (cl-pushnew (current-buffer) (eglot--managed-buffers (eglot-current-server))))
    (t
-    (when eglot--track-changes
-      (track-changes-unregister eglot--track-changes)
-      (setq eglot--track-changes nil))
     (remove-hook 'kill-buffer-hook #'eglot--managed-mode-off t)
     (remove-hook 'kill-buffer-hook #'eglot--signal-textDocument/didClose t)
     (remove-hook 'before-revert-hook #'eglot--signal-textDocument/didClose t)
@@ -2053,7 +2050,10 @@ eglot--managed-mode
               (delq (current-buffer) (eglot--managed-buffers server)))
         (when (and eglot-autoshutdown
                    (null (eglot--managed-buffers server)))
-          (eglot-shutdown server)))))))
+          (eglot-shutdown server))))
+    (when eglot--track-changes
+      (track-changes-unregister eglot--track-changes)
+      (setq eglot--track-changes nil)))))
 
 (defun eglot--managed-mode-off ()
   "Turn off `eglot--managed-mode' unconditionally."





This bug report was last modified 1 year and 6 days ago.

Previous Next


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