GNU bug report logs - #58839
29.0.50; project-kill-buffer fails when Eglot is running

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Fri, 28 Oct 2022 12:58:01 UTC

Severity: normal

Found in version 29.0.50

Full log


View this message in rfc822 format

From: João Távora <joaotavora <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: 58839 <at> debbugs.gnu.org, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: bug#58839: [Patch] Re: bug#58839: 29.0.50; project-kill-buffer fails when Eglot is running
Date: Thu, 3 Nov 2022 18:19:20 +0000
[Message part 1 (text/plain, inline)]
Juri, this doesn't seem right. Eglot shouldn't be turning itself on in
hidden buffers to start with: It's totally useless there.

So you have to explain an Emacs -Q recipe that demonstrates how Eglot
reached this nonsensical state. You haven't done that (or have you and i
have missed it?).

I tried project-find-regexp with Eglot-managed files with no problems, but
I have no idea what you're doing.

Also, this problem is totally off-topic here: this is about
project-kill-buffers. Please start as new issue of you haven't already.

João

On Thu, Nov 3, 2022, 17:39 Juri Linkov <juri <at> linkov.net> wrote:

> > 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))))
>
[Message part 2 (text/html, inline)]

This bug report was last modified 2 years and 279 days ago.

Previous Next


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