bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#58839: [Patch] Re: bug#58839: 29.0.50; project-kill-buffer fails whe


From: Juri Linkov
Subject: bug#58839: [Patch] Re: bug#58839: 29.0.50; project-kill-buffer fails when Eglot is running
Date: Thu, 03 Nov 2022 19:30:13 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

> OTOH I completely support the request to make Eglot more resilient
> to unforeseeable situations.  Currently it's so brittle, so I get a lot
> of such errors all the time:
>
> Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
>   file-truename(nil)
>   eglot--path-to-uri(nil)
>   eglot--TextDocumentIdentifier()
>   eglot--signal-textDocument/didClose()
>   kill-buffer(#<buffer  *xref-temp*>)
>   xref--convert-hits(...)
>   xref-matches-in-files("word" ...)
>   project--find-regexp-in-files("word" ...)
>   apply(project--find-regexp-in-files ("word" ...))
>   xref--show-xref-buffer(...)
>   xref--show-xrefs(...)
>   xref-show-xrefs(...)
>   project-find-regexp("word")
>   funcall-interactively(project-find-regexp "word")
>   command-execute(project-find-regexp)

Here's a patch that fixes this:

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index c5870618372..5b05f84c63c 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -1792,7 +1792,9 @@ eglot--maybe-activate-editing-mode
   (unless eglot--managed-mode
     ;; Called when `revert-buffer-in-progress-p' is t but
     ;; `revert-buffer-preserve-modes' is nil.
-    (when (and buffer-file-name (eglot-current-server))
+    (when (and buffer-file-name
+               (not (string-match-p "\\` " (buffer-name)))
+               (eglot-current-server))
       (setq eglot--diagnostics nil)
       (eglot--managed-mode)
       (eglot--signal-textDocument/didOpen))))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]