From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#70724: 29.2.50; eglot-reconnect errors when the project is deleted Date: Thu, 21 Nov 2024 19:49:13 +0000 Message-ID: References: <8634qffrly.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14764"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Dmitry Gutov , Eli Zaretskii , app-emacs-dev@janestreet.com, 70724@debbugs.gnu.org To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 21 20:51:20 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 1tEDCy-0003gl-3H for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 Nov 2024 20:51:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tEDCj-000698-AL; Thu, 21 Nov 2024 14:51: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 1tEDCg-000688-Ol for bug-gnu-emacs@gnu.org; Thu, 21 Nov 2024 14:51:02 -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 1tEDCg-00083y-GD for bug-gnu-emacs@gnu.org; Thu, 21 Nov 2024 14:51:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=0v5JqnqqaXGwcAbF4gc/qH9ZdrfPPlK+BIZjUIjYXN4=; b=UMn5Ncuj9VTCJJZMzbO7j5TAL77OldS45YjSdx7jBhBLoyFnEPOppbBX3D/aX/u7zJnzAZOXRm2TNcUw1q75iizkF9V1tyYFzOEVUTPDNS6mMv9ACfscPhR/2nIHfe24lW/pMpwqxzTfcdzUu3cwFvaBMJuzFedGEbdIXudhue3tRFYaLPhzZWmu6myOqVHM5Qi6Pe5jH+4QBfmp1Pr/mDEBj1iRWbCh7X/gz0VcuBHSbOVg1yWh1xEmNgAzGj29HfSYq2l3sL0JhFwFSfLQ3htkWGNVtA78vOKBqhhJG2O2cgLVVEbNxrR2jHG332q4KFv7OE1cMGumZMirgoDn4g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tEDCg-0003o4-Ax for bug-gnu-emacs@gnu.org; Thu, 21 Nov 2024 14:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Nov 2024 19:51: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.173221862614589 (code B ref 70724); Thu, 21 Nov 2024 19:51:02 +0000 Original-Received: (at 70724) by debbugs.gnu.org; 21 Nov 2024 19:50:26 +0000 Original-Received: from localhost ([127.0.0.1]:51811 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEDC6-0003nE-6V for submit@debbugs.gnu.org; Thu, 21 Nov 2024 14:50:26 -0500 Original-Received: from mail-ot1-f47.google.com ([209.85.210.47]:54719) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEDC4-0003n6-GI for 70724@debbugs.gnu.org; Thu, 21 Nov 2024 14:50:25 -0500 Original-Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-71a4210bcfeso655991a34.1 for <70724@debbugs.gnu.org>; Thu, 21 Nov 2024 11:50:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732218564; x=1732823364; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=0v5JqnqqaXGwcAbF4gc/qH9ZdrfPPlK+BIZjUIjYXN4=; b=VUQctnGoHO3nI+3a+mSsJaX+WL554ZF8AuOPLw2VFm4ONWbLPHJ4/cO6eFsBIiYr+o U3q+PoswXDwM/XTzA6mRg2OWhCqExopaf8Im5qrCB6PvVIRBSUBh7ciopB/RELGgBS/k Dn18rUK902Hf4cqi4y/0ssn5seusgzp34xZ9HQkfwpyv9UeQlcnjsN/8abqzkL+cRMja caUAzpKq1kGA54ZvPy2fr/HoHXDm1+l1e2IGxZzQ5lJDrzSR6OXixycM6maH2TZ3lZBE 8tkcQ22lENO77SBShnrgfv9dovXDVuDFYhgPCeH/mUbWm73l0u8Jvx+JtF2PJtVkSw3r mNTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732218564; x=1732823364; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0v5JqnqqaXGwcAbF4gc/qH9ZdrfPPlK+BIZjUIjYXN4=; b=PafJKDIgmOtcW0q2sIQy0mCQwX3xKI8WvPsOMplWNzJS1kz4u3EYgpKVXJKE6aRFB+ Oibzh7i2hzXCOj8Hw59/c6AnzjxwHAlaHvtc/OYuEuohyGrnr8oGMVP0gcA6dNAyvoav No4071ACh35gwnTOEjky02wj567cLZTYindizbYAQl/oT/y7/wEulCdLz/D1qNOFNyfc Q4l27PLFKB0mCiu4S+S40XERuiwftFPsRuDS4txLwE04eJs6g12A+8f7Sl2ZqCTtK5H7 /IU+8tW0vr7eW6br9iGwOZYPmCy2sgkaqvAM0yJBY6gdbyFUj4t/MxM6COJkie3QKCk0 OB6A== X-Forwarded-Encrypted: i=1; AJvYcCVDFON0/5Q3hJFoQoNe3yuaNuUHB0y/+Y06tvbmfHMFHebkv5eftb6LZ4DTycBPlj83RQblkg==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yw98QM19Qpyet/8+UTFBC0Q0FasLvGNJv5iy6z3mrB3T7t3g4rG sDxben5tksZSoEE5Y3cDKdd8jIZTKjU80yx40JkkKOuPgF76Wp+28SmC2VqJfDVK0Hu6/kgauwz fgufrkEkAZbjxW/IUZBp/HDB8387umU00 X-Gm-Gg: ASbGncvvM9YpnE5ht13MLfewlFPzhU0y93CDDuT7kXqaSrz9HfeuGlheU8qi3IjRwIT z/n5OVgWWhCg/u1fRx5/bQVwzE59eDg== X-Google-Smtp-Source: AGHT+IFqK2QmXrvPHemx/ZqGcjndAd1jHh6b3C9Tnmts6AHFkQBShIO3aaS92YUelmE8lYMeRxZItel1GKcEyDpg13Q= X-Received: by 2002:a05:6830:61c7:b0:718:a1b:b2dc with SMTP id 46e09a7af769-71c04b7092fmr53080a34.4.1732218563797; Thu, 21 Nov 2024 11:49:23 -0800 (PST) In-Reply-To: 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:295747 Archived-At: On Thu, Nov 21, 2024 at 7:19=E2=80=AFPM Spencer Baugh wrote: > > > 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. project was passed non-nil to eglot-connect, yes? A non-nil project should still be able to identify itself even if its support in the filesyst= em is missing, IMHO. Anyway, this patch is slightly simpler (same idea) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index e5c27de81fc..1e9a8a36343 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1518,13 +1518,11 @@ 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 - (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))) + (nickname (if (file-exists-p default-directory) + (project-name project) + ;; could happen because of bug#70724 or just because + (eglot--error "Project at `%s' is gone!" default-directory))) + (readable-name (format "EGLOT (%s/%s)" nickname managed-modes)) server-info (contact (if (functionp contact) (funcall contact) contact)) (initargs > > 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 --=20 Jo=C3=A3o T=C3=A1vora