From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs 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 Organization: LINKOV.NET Message-ID: <86o7tojda2.fsf@mail.linkov.net> References: <87sfj8umwb.fsf@posteo.net> <87ilk2x1si.fsf@gmail.com> <871qqq7l9p.fsf@posteo.net> <87eduqwekz.fsf@gmail.com> <87wn8invbx.fsf@posteo.net> <877d0iw8iq.fsf@gmail.com> <837d0hhlke.fsf@gnu.org> <46ff0065-5645-ef1e-2621-242fb6a73f98@yandex.ru> <87v8o0uxn5.fsf@gmail.com> <787a4362-7ff5-7dbb-9118-16e4bee5f328@yandex.ru> <87edunvhf2.fsf@gmail.com> <6d4d9e72-1bae-4d64-b7c1-c2b9c11e396f@yandex.ru> <6c9811d7-ad05-2d2d-0c34-9b4c1fa09305@yandex.ru> <87a659u7vo.fsf@gmail.com> <8735b1bvnz.fsf@posteo.net> <87mt99spsk.fsf@gmail.com> <87r0ylafdl.fsf@posteo.net> <87cza5sbfx.fsf@gmail.com> <87r0ylh0y4.fsf@posteo.net> <86mt991dst.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23414"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , Dmitry Gutov To: 58839@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 03 18:40:37 2022 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 1oqeCi-0005w0-Gy for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 03 Nov 2022 18:40:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqeCB-0005fy-WE; Thu, 03 Nov 2022 13:40:04 -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 1oqeCA-0005fi-4I for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2022 13:40:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqeC9-0005AM-RK for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2022 13:40:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oqeC9-0003fN-Mo for bug-gnu-emacs@gnu.org; Thu, 03 Nov 2022 13:40:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Nov 2022 17:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58839 X-GNU-PR-Package: emacs Original-Received: via spool by 58839-submit@debbugs.gnu.org id=B58839.166749718614049 (code B ref 58839); Thu, 03 Nov 2022 17:40:01 +0000 Original-Received: (at 58839) by debbugs.gnu.org; 3 Nov 2022 17:39:46 +0000 Original-Received: from localhost ([127.0.0.1]:50402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqeBu-0003eP-5J for submit@debbugs.gnu.org; Thu, 03 Nov 2022 13:39:46 -0400 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:39305) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqeBq-0003e8-L7 for 58839@debbugs.gnu.org; Thu, 03 Nov 2022 13:39:44 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 6FCBE60006; Thu, 3 Nov 2022 17:39:33 +0000 (UTC) In-Reply-To: <86mt991dst.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 02 Nov 2022 19:32:02 +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: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246995 Archived-At: > 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(#) > 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))))