From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70724: 29.2.50; eglot-reconnect errors when the project is deleted Date: Thu, 21 Nov 2024 14:46:18 -0500 Message-ID: References: <8634qffrly.fsf@gnu.org> Reply-To: Spencer Baugh Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38932"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , app-emacs-dev@janestreet.com, =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , 70724@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 21 20:47:26 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 1tED9A-0009sg-Nj for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 Nov 2024 20:47:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tED8r-0003wf-6k; Thu, 21 Nov 2024 14:47:05 -0500 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 1tED8p-0003wT-2N for bug-gnu-emacs@gnu.org; Thu, 21 Nov 2024 14:47:03 -0500 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 1tED8o-0007Lk-Ok for bug-gnu-emacs@gnu.org; Thu, 21 Nov 2024 14:47:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=poBgIEoTPN87vxv5NB5ITC0ubj/eaglt+RlphDk9TvE=; b=gqV2qNko043WTm+3o2TRV7WWYNTepG67AQoTFeklNIAMWr/KLBdexXjZYlw2QezRmhEnX8Yw2QVZ1XppSikYoQ0iE/aO/VRkaGaSysB81rwH8I0TqYtP1/D9PYdpsbKDMS3lWK4eic83xtfk6gL3STqn4C614WVM3jHm+SqO4e5TLr3t75dC3Drx1v0Q3v7Gqzg33ErtEbbh+IYSX0GnXp55RHLJJTdnANAX32Hp5XGHT65pd6Fpz6PqNROChQClfWBenMIJcu4Iy+g36OmwxYXiT6kNlBMQgK4q3eyzDkABfa/tYXNrPrQGqXVMSutEzsUAGatNerzWKOP1oRyfzQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tED8o-0003c9-Bj for bug-gnu-emacs@gnu.org; Thu, 21 Nov 2024 14:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Nov 2024 19:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70724 X-GNU-PR-Package: emacs Original-Received: via spool by 70724-submit@debbugs.gnu.org id=B70724.173221838613833 (code B ref 70724); Thu, 21 Nov 2024 19:47:02 +0000 Original-Received: (at 70724) by debbugs.gnu.org; 21 Nov 2024 19:46:26 +0000 Original-Received: from localhost ([127.0.0.1]:51803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tED8E-0003b3-AU for submit@debbugs.gnu.org; Thu, 21 Nov 2024 14:46:26 -0500 Original-Received: from mxout2.mail.janestreet.com ([38.105.200.79]:59445) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tED8C-0003ap-Ex for 70724@debbugs.gnu.org; Thu, 21 Nov 2024 14:46:25 -0500 In-Reply-To: (Dmitry Gutov's message of "Sun, 19 May 2024 18:08:15 +0300") DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1732218378; bh=poBgIEoTPN87vxv5NB5ITC0ubj/eaglt+RlphDk9TvE=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=MV4OmdNPyd+FYKy9KrxS88oid6cMyqqL5PDRTkBulEMaBmwppw7A/5v+MpG/9h6i1 ookdXyXHEfX/B2B1H6XleQ6/4/s3WqFgQT2EiUW6FvDZmbiUN2pokeCDR1d8xWIHTs A0Yusklp20kOaSTEpPZdgkhQfCJLzy0Ifh/G9tGch+YEuTyMbHk9mvVXh/GwSjJ3Dt VCytr7tq2hdQyYBdgIXDcAJEV7wzqhyy5h04o4TS97+I7XxusBKbqCQ0U6IiUxTITc J9iS6xClWtsLbWLYffzU0HZu8WLc6NUH1ThX7NehDz45uTpBliikddJ4Ixxd24TSZo 1C+ngwpNmVXgw== 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:295746 Archived-At: (Sending again after unarchiving the bug...) Unfortunately the revised patch pushed by Joao is still broken for me, because fetching project-name isn't guaranteed to work if the project doesn't exist. How about this instead? diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 092a9c6b9a5..502cb7bbb24 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1518,13 +1518,13 @@ eglot--connect "Connect to MANAGED-MODES, LANGUAGE-IDS, PROJECT, CLASS and CONTACT. This docstring appeases checkdoc, that's all." (let* ((default-directory (project-root project)) - (nickname (project-name project)) - (readable-name + (nickname (progn (unless (file-exists-p default-directory) ;; could happen because of bug#70724 or just because - (eglot--error "Project '%s' is gone!" nickname)) - (format "EGLOT (%s/%s)" nickname managed-modes))) + (eglot--error "Project '%s' is gone!" default-directory)) + (project-name project))) + (readable-name (format "EGLOT (%s/%s)" nickname managed-modes)) server-info (contact (if (functionp contact) (funcall contact) contact)) (initargs