From unknown Mon Jun 23 04:14:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70724: 29.2.50; eglot-reconnect errors when the project is deleted Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 May 2024 19:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70724 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 70724@debbugs.gnu.org Cc: dmity@gutov.dev, app-emacs-dev@janestreet.com X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.171467866325913 (code B ref -1); Thu, 02 May 2024 19:38:01 +0000 Received: (at submit) by debbugs.gnu.org; 2 May 2024 19:37:43 +0000 Received: from localhost ([127.0.0.1]:45566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2cFS-0006jt-J7 for submit@debbugs.gnu.org; Thu, 02 May 2024 15:37:43 -0400 Received: from lists.gnu.org ([2001:470:142::17]:39044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2cFP-0006jn-SA for submit@debbugs.gnu.org; Thu, 02 May 2024 15:37:41 -0400 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 1s2cEx-00031a-Qo for bug-gnu-emacs@gnu.org; Thu, 02 May 2024 15:37:12 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s2cEr-0002lP-2x for bug-gnu-emacs@gnu.org; Thu, 02 May 2024 15:37:10 -0400 From: Spencer Baugh Date: Thu, 02 May 2024 15:37:03 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1714678623; bh=HsRotOPpaHWjrXzxXabxrWnURS6qeU7SqBW9Ncv/+r4=; h=From:To:Cc:Subject:Date; b=Z6Wp+E/kyH86Ai5tdudXbRqk1spKOqA3n7xPBf3h7HCG8MGEcWiJfDuqAgffpveJY QSuTogNzcA3uKkBeSC6+G8tqR185iQcJeS1NPK8u9vJ3uQYnUi6lWnjz1nqR/CzTmC iVrCGIrYVU+BMaZZpESkA4j/6MqwU8HwyZHVzC8b+86mlxf8KKhD4ksSQgVKTgEKBY sS2j52cuuJHMXHOtt7y7tdoaVz85/1VbLHHH+AjnQLqFshCMRwmnN6qhfSeuWXcfOm uROkRw3RVojcQAyXtZPcnf42w2cdTRaRlyRVz1gLWNonvFEGGV4HJjMZGyTnhb4pH0 uX+jbCCXFpPlA== Received-SPF: pass client-ip=64.215.233.18; envelope-from=sbaugh@janestreet.com; helo=mxout5.mail.janestreet.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) In some project /home/foo/proj, with pretty much any LSP server: 1. In /home/foo/proj, M-x eglot, starting some LSP server 2. Delete the directory /home/foo/proj 3. The LSP server will crash/exit 4. The process sentinel for the server will run, running eglot--on-shutdown which by default will call eglot-reconnect 5. eglot-reconnect extracts the saved project instance out of the server, which has a root directory which no longer exists, and calls eglot--connect with it 6. eglot--connect calls project-name on a nonexistent project instance, which may fail with an error depending on the project implementation (I have a custom project implementation, but I think this can happen with project-vc too) 7. This causes the process sentinel to error. I think the right fix is probably for eglot--on-shutdown (or maybe eglot-reconnect) to call (project-current nil (project-root pr)) to find the new project instance. If that returns nil, the project has disappeared, and eglot should just not try to reconnect. This also would make eglot behave better if the project layout changes (e.g. if there are nested projects). Alternatively, maybe eglot--on-shutdown shouldn't automatically reconnect in the first place? Maybe reconnection should happen automatically only when some specific buffer tries to interact with the LSP - then it can run project-current in the context of that specific buffer, and see there's no project, and fail. Plus, if the user kills all the buffers in the project (possibly with project-kill-buffers) before deleting it, this approach would entirely avoid the unnecessary eglot reconnection attempt. In GNU Emacs 29.2.50 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.12, Xaw scroll bars) of 2024-04-25 built on igm-qws-u22796a Repository revision: d07451c1f8053fa355d091351a614f232995ab8c Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Rocky Linux 8.9 (Green Obsidian) Configured using: 'configure -C --with-x-toolkit=lucid --with-gif=ifavailable' Configured features: CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM LUCID ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: ELisp/l Minor modes in effect: repeat-mode: t delete-selection-mode: t global-so-long-mode: t pixel-scroll-precision-mode: t jane-fe-minor-mode: t jane-fe-jenga-minor-mode: t editorconfig-mode: t dired-omit-mode: t which-function-mode: t global-git-commit-mode: t magit-auto-revert-mode: t shell-dirtrack-mode: t server-mode: t savehist-mode: t save-place-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tab-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t context-menu-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Features: (magit-patch make-mode doctor texinfo texinfo-loaddefs completion emacs-news-mode latexenc mode-local minibuf-eldef ...) Memory information: ((conses 16 4170589 532507) (symbols 48 67528 55) (strings 32 645610 32608) (string-bytes 1 31944500) (vectors 16 203742) (vector-slots 8 4053669 619438) (floats 8 1045 1428) (intervals 56 410065 1774) (buffers 976 767)) From unknown Mon Jun 23 04:14:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70724: 29.2.50; eglot-reconnect errors when the project is deleted Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 May 2024 01:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70724 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Spencer Baugh , 70724@debbugs.gnu.org Cc: app-emacs-dev@janestreet.com Received: via spool by 70724-submit@debbugs.gnu.org id=B70724.171478502831744 (code B ref 70724); Sat, 04 May 2024 01:11:02 +0000 Received: (at 70724) by debbugs.gnu.org; 4 May 2024 01:10:28 +0000 Received: from localhost ([127.0.0.1]:50257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s33v1-0008Fw-PU for submit@debbugs.gnu.org; Fri, 03 May 2024 21:10:28 -0400 Received: from wfout8-smtp.messagingengine.com ([64.147.123.151]:57181) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s33uw-0008Fm-Kc for 70724@debbugs.gnu.org; Fri, 03 May 2024 21:10:26 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfout.west.internal (Postfix) with ESMTP id 9551C1C0008D; Fri, 3 May 2024 21:09:53 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Fri, 03 May 2024 21:09:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1714784993; x=1714871393; bh=WeH2tSAPkcnEzOjFQnscZUyfcwtixcbalfXJgcZdHI8=; b= A1xAgLSWk1Eh4SWBMlVbKHoQZ8z+MnVLTxZ67zXqLeFdb0HvNG2mSl7FMNKVxMd4 8EY265Hkey2QlKZ6+0teJOF+bfpuvFnGBC1LOl7sTr9JsHeSxSYmaMoPN50BVwwx 9NdIfJTtN2dHhRscnq1PilRWzscSIpNNTxmnL8L0VQ0ayCr5LcSlKWzAC7o8hQRW pn7cHsJJ/rr+LtRKaC1b4tiTsLhWiYOUnZ53PWRisI2Agsf0u7Fq0zaBWOEcSBze 4FOnbyYewefkbsCjk5GkOb9mZ6hZdBswfQ6gmOnIOukuK5+Ud50oJBMhTmKaJF3i RvTDhveyHgvWHuM7yK8yqg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1714784993; x= 1714871393; bh=WeH2tSAPkcnEzOjFQnscZUyfcwtixcbalfXJgcZdHI8=; b=l JFr4jieXyU/wj6+IuJDfMK0T7PjmR7UmpKq9zrtznZFgK8+q0p3f1ch+KcP3wKKW Xh/MxOEbdtRG3WjMFRRAHaM0XA9jAWHkCBkjCit3DddO11l7xWUpKq3l8CxLqmXD SC3FoaHdwSWAgJNPSEUBvrT86ILM8NmbL9xUhG1Zj9w+Gg/1oG/PAVhmqvf5oFiW oq3JfPUJFeH+wks/DQGBZ+6pM8QqxxnN57SZUoc+cheBRphdaQraV1QtgQ13E9xL CXHo8WTLViUN5J71MI4tvycdVykdSjWU38rDe90fQaUwIUGKsc2kwkg/WBjMDd7B NSuX8Y7uFgC/OVN/1hvCA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvddvuddggeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedu jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 May 2024 21:09:51 -0400 (EDT) Message-ID: Date: Sat, 4 May 2024 04:09:48 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird References: Content-Language: en-US From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Spencer, On 02/05/2024 22:37, Spencer Baugh wrote: > > In some project /home/foo/proj, with pretty much any LSP server: > > 1. In /home/foo/proj, M-x eglot, starting some LSP server > > 2. Delete the directory /home/foo/proj > > 3. The LSP server will crash/exit > > 4. The process sentinel for the server will run, running > eglot--on-shutdown which by default will call eglot-reconnect > > 5. eglot-reconnect extracts the saved project instance out of the > server, which has a root directory which no longer exists, and calls > eglot--connect with it > > 6. eglot--connect calls project-name on a nonexistent project instance, > which may fail with an error depending on the project implementation > (I have a custom project implementation, but I think this can happen > with project-vc too) > > 7. This causes the process sentinel to error. > > I think the right fix is probably for eglot--on-shutdown (or maybe > eglot-reconnect) to call (project-current nil (project-root pr)) to find > the new project instance. If that returns nil, the project has > disappeared, and eglot should just not try to reconnect. This also > would make eglot behave better if the project layout changes (e.g. if > there are nested projects). I think I like this solution (as long as the nil value returned by project-current on this step is appropriately handled). Something like: diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 6896baf30ce..7b2461c3ce6 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1426,11 +1426,15 @@ eglot-reconnect (interactive (list (eglot--current-server-or-lose) t)) (when (jsonrpc-running-p server) (ignore-errors (eglot-shutdown server interactive nil 'preserve-buffers))) - (eglot--connect (eglot--major-modes server) - (eglot--project server) - (eieio-object-class-name server) - (eglot--saved-initargs server) - (eglot--language-ids server)) + (let* ((root (project-root (eglot--project server))) + (project (project-current nil root))) + (if (not project) + (eglot--error "Project in `%s' is gone!" root) + (eglot--connect (eglot--major-modes server) + project + (eieio-object-class-name server) + (eglot--saved-initargs server) + (eglot--language-ids server)))) (eglot--message "Reconnected!")) (defvar eglot--managed-mode) ; forward decl Though it also raises a question about the caching strategy for VC-Aware project backend. At the moment is associates a project with a directory more or less indefinitely, and this is a case to watch out for. > Alternatively, maybe eglot--on-shutdown shouldn't automatically > reconnect in the first place? Maybe reconnection should happen > automatically only when some specific buffer tries to interact with the > LSP - then it can run project-current in the context of that specific > buffer, and see there's no project, and fail. Plus, if the user kills > all the buffers in the project (possibly with project-kill-buffers) > before deleting it, this approach would entirely avoid the unnecessary > eglot reconnection attempt. This also sounds good, though it'd probably require more changes overall. Additionally, perhaps I'd change the association from (server -> project) to (server -> project-root), relying on the project backends' internal caches to fetch the project value whenever it's needed. That might be the most reliable approach. Perhaps the slowest in theory, but hopefully not noticeably so. From unknown Mon Jun 23 04:14:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70724: 29.2.50; eglot-reconnect errors when the project is deleted Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 May 2024 08:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70724 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: sbaugh@janestreet.com, Dmitry Gutov Cc: app-emacs-dev@janestreet.com, 70724@debbugs.gnu.org Received: via spool by 70724-submit@debbugs.gnu.org id=B70724.171602113328977 (code B ref 70724); Sat, 18 May 2024 08:33:01 +0000 Received: (at 70724) by debbugs.gnu.org; 18 May 2024 08:32:13 +0000 Received: from localhost ([127.0.0.1]:60291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s8FUC-0007XJ-FA for submit@debbugs.gnu.org; Sat, 18 May 2024 04:32:12 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s8FUA-0007XD-Bk for 70724@debbugs.gnu.org; Sat, 18 May 2024 04:32:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s8FTy-00037s-JW; Sat, 18 May 2024 04:31:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=MkdSCZlip2xfXqoDkn3O9hCxFEwgfk3vhhTacP5G0NU=; b=nMZMxrpqrwqp JC7v+GU6KyYwS0q5phCdqhfEkNu4uNSC9dJ7bIfQWuzc7bqO1ldoO2tX+LGXsj1YxG40VaAcT59Wg Ky8Lwm9GDwQpb9RXbve4Zk/F1jyt+U6iA+sSRIkU4+zx5LAaniFqTM2Xlkr1QcLwgHp4jDT/+hTff firuYoluOLkG0vZN3Wmy35cq4mDMNotcYOT9wJZzw3VrkxYlL6wIfx9njLW2PuvfGdtxj+11KVY1U DO+BdAy9PlEAf1B8HglhKU24ylGZDFHQiUnBvR+F7oxEbfM31BCWTPVuxS4tbcworp4J2TmDjpJxK fyqO6E/0xLRn3a1LgcleTw==; Date: Sat, 18 May 2024 11:31:53 +0300 Message-Id: <8634qffrly.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Dmitry Gutov on Sat, 4 May 2024 04:09:48 +0300) References: X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) Ping! Can we make some progress here? > Cc: app-emacs-dev@janestreet.com > Date: Sat, 4 May 2024 04:09:48 +0300 > From: Dmitry Gutov > > Hi Spencer, > > On 02/05/2024 22:37, Spencer Baugh wrote: > > > > In some project /home/foo/proj, with pretty much any LSP server: > > > > 1. In /home/foo/proj, M-x eglot, starting some LSP server > > > > 2. Delete the directory /home/foo/proj > > > > 3. The LSP server will crash/exit > > > > 4. The process sentinel for the server will run, running > > eglot--on-shutdown which by default will call eglot-reconnect > > > > 5. eglot-reconnect extracts the saved project instance out of the > > server, which has a root directory which no longer exists, and calls > > eglot--connect with it > > > > 6. eglot--connect calls project-name on a nonexistent project instance, > > which may fail with an error depending on the project implementation > > (I have a custom project implementation, but I think this can happen > > with project-vc too) > > > > 7. This causes the process sentinel to error. > > > > I think the right fix is probably for eglot--on-shutdown (or maybe > > eglot-reconnect) to call (project-current nil (project-root pr)) to find > > the new project instance. If that returns nil, the project has > > disappeared, and eglot should just not try to reconnect. This also > > would make eglot behave better if the project layout changes (e.g. if > > there are nested projects). > > I think I like this solution (as long as the nil value returned by > project-current on this step is appropriately handled). > > Something like: > > diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el > index 6896baf30ce..7b2461c3ce6 100644 > --- a/lisp/progmodes/eglot.el > +++ b/lisp/progmodes/eglot.el > @@ -1426,11 +1426,15 @@ eglot-reconnect > (interactive (list (eglot--current-server-or-lose) t)) > (when (jsonrpc-running-p server) > (ignore-errors (eglot-shutdown server interactive nil > 'preserve-buffers))) > - (eglot--connect (eglot--major-modes server) > - (eglot--project server) > - (eieio-object-class-name server) > - (eglot--saved-initargs server) > - (eglot--language-ids server)) > + (let* ((root (project-root (eglot--project server))) > + (project (project-current nil root))) > + (if (not project) > + (eglot--error "Project in `%s' is gone!" root) > + (eglot--connect (eglot--major-modes server) > + project > + (eieio-object-class-name server) > + (eglot--saved-initargs server) > + (eglot--language-ids server)))) > (eglot--message "Reconnected!")) > > (defvar eglot--managed-mode) ; forward decl > > > Though it also raises a question about the caching strategy for VC-Aware > project backend. At the moment is associates a project with a directory > more or less indefinitely, and this is a case to watch out for. > > > Alternatively, maybe eglot--on-shutdown shouldn't automatically > > reconnect in the first place? Maybe reconnection should happen > > automatically only when some specific buffer tries to interact with the > > LSP - then it can run project-current in the context of that specific > > buffer, and see there's no project, and fail. Plus, if the user kills > > all the buffers in the project (possibly with project-kill-buffers) > > before deleting it, this approach would entirely avoid the unnecessary > > eglot reconnection attempt. > > This also sounds good, though it'd probably require more changes > overall. Additionally, perhaps I'd change the association from (server > -> project) to (server -> project-root), relying on the project > backends' internal caches to fetch the project value whenever it's > needed. That might be the most reliable approach. Perhaps the slowest in > theory, but hopefully not noticeably so. > > > > From unknown Mon Jun 23 04:14:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70724: 29.2.50; eglot-reconnect errors when the project is deleted Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 May 2024 15:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70724 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii , sbaugh@janestreet.com, =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: app-emacs-dev@janestreet.com, 70724@debbugs.gnu.org Received: via spool by 70724-submit@debbugs.gnu.org id=B70724.17161313099307 (code B ref 70724); Sun, 19 May 2024 15:09:01 +0000 Received: (at 70724) by debbugs.gnu.org; 19 May 2024 15:08:29 +0000 Received: from localhost ([127.0.0.1]:36621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s8i9F-0002Q3-9p for submit@debbugs.gnu.org; Sun, 19 May 2024 11:08:29 -0400 Received: from fhigh3-smtp.messagingengine.com ([103.168.172.154]:40503) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s8i9D-0002Pv-W5 for 70724@debbugs.gnu.org; Sun, 19 May 2024 11:08:28 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfhigh.nyi.internal (Postfix) with ESMTP id BC0B71140065; Sun, 19 May 2024 11:08:18 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 19 May 2024 11:08:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1716131298; x=1716217698; bh=VkOS/OjQ0hb/JiR0jEEx1sD605SfVz5GWpVnjWpVS2o=; b= pw+/qw/xxJ8qJfc+SY+AzX0LfYq2SxKgbe1ThSNDslGZS0UO+jXgGpA35ho2slUF ZlugStHoK4cDAVZIRSOb9Jj7oDyatXY33G6BzIMhJlbf76k/GPpHx2vX1JLFPWXI +mr+kJKdEU+vWSlCG/obaAWnzKpy+E1nkyKZi97qjwZrUQIIxobx5cT+VcXoUCvx VSwVpBQRPI+datF1xdGmZUsNE3dMycfJnKxFMc1k8tgHR6p9bQwKiQ0AX7eIRiBo icse+9OQOHYsWTqvLcdYkefzPZZ6C3gDEFs6eKcm8svF27s/V14BESqalQKqs1s8 83VK7cE1wATVDGEhvRYJNw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1716131298; x= 1716217698; bh=VkOS/OjQ0hb/JiR0jEEx1sD605SfVz5GWpVnjWpVS2o=; b=N i9nitn93dn/pB0/dP7qoCY/mxmJhaHKIJ72mE2tsrKh24ENDwJ9D6s7OqzfqyFtA knFaY6hCZr5FqSKtppMtSYx+/19UAJWCpUilJ5ib1PH+amlNodX5+0JvmVqxX/Xr xjlkSlzXCpJDVFZtznxyRY10kcfBuAwF4Ov5pQugQYbOpqt09/gxFrdqtsnChmQW 9VuEamDC0Df4fPB49O98VxHUvkVd/NL4dasbBmlJ9pOULurX3MfQ3tihREF+nZIg wL8sOQh7VD8PY5RPMyvVeyD6OwjKZrVDVrto36ZS325HrKJugqj+FXFiYsCEVeVH /UK1JYvK9TR5/hq0rDcOg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdehkedgkedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedu jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 19 May 2024 11:08:16 -0400 (EDT) Message-ID: Date: Sun, 19 May 2024 18:08:15 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird References: <8634qffrly.fsf@gnu.org> Content-Language: en-US From: Dmitry Gutov In-Reply-To: <8634qffrly.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Seems like we could use Eglot's maintainer's input. On 18/05/2024 11:31, Eli Zaretskii wrote: > Ping! Can we make some progress here? > >> Cc: app-emacs-dev@janestreet.com >> Date: Sat, 4 May 2024 04:09:48 +0300 >> From: Dmitry Gutov >> >> Hi Spencer, >> >> On 02/05/2024 22:37, Spencer Baugh wrote: >> > >> > In some project /home/foo/proj, with pretty much any LSP server: >> > >> > 1. In /home/foo/proj, M-x eglot, starting some LSP server >> > >> > 2. Delete the directory /home/foo/proj >> > >> > 3. The LSP server will crash/exit >> > >> > 4. The process sentinel for the server will run, running >> > eglot--on-shutdown which by default will call eglot-reconnect >> > >> > 5. eglot-reconnect extracts the saved project instance out of the >> > server, which has a root directory which no longer exists, and calls >> > eglot--connect with it >> > >> > 6. eglot--connect calls project-name on a nonexistent project instance, >> > which may fail with an error depending on the project implementation >> > (I have a custom project implementation, but I think this can happen >> > with project-vc too) >> > >> > 7. This causes the process sentinel to error. >> > >> > I think the right fix is probably for eglot--on-shutdown (or maybe >> > eglot-reconnect) to call (project-current nil (project-root pr)) to find >> > the new project instance. If that returns nil, the project has >> > disappeared, and eglot should just not try to reconnect. This also >> > would make eglot behave better if the project layout changes (e.g. if >> > there are nested projects). >> >> I think I like this solution (as long as the nil value returned by >> project-current on this step is appropriately handled). >> >> Something like: >> >> diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el >> index 6896baf30ce..7b2461c3ce6 100644 >> --- a/lisp/progmodes/eglot.el >> +++ b/lisp/progmodes/eglot.el >> @@ -1426,11 +1426,15 @@ eglot-reconnect >> (interactive (list (eglot--current-server-or-lose) t)) >> (when (jsonrpc-running-p server) >> (ignore-errors (eglot-shutdown server interactive nil >> 'preserve-buffers))) >> - (eglot--connect (eglot--major-modes server) >> - (eglot--project server) >> - (eieio-object-class-name server) >> - (eglot--saved-initargs server) >> - (eglot--language-ids server)) >> + (let* ((root (project-root (eglot--project server))) >> + (project (project-current nil root))) >> + (if (not project) >> + (eglot--error "Project in `%s' is gone!" root) >> + (eglot--connect (eglot--major-modes server) >> + project >> + (eieio-object-class-name server) >> + (eglot--saved-initargs server) >> + (eglot--language-ids server)))) >> (eglot--message "Reconnected!")) >> >> (defvar eglot--managed-mode) ; forward decl >> >> >> Though it also raises a question about the caching strategy for VC-Aware >> project backend. At the moment is associates a project with a directory >> more or less indefinitely, and this is a case to watch out for. >> >> > Alternatively, maybe eglot--on-shutdown shouldn't automatically >> > reconnect in the first place? Maybe reconnection should happen >> > automatically only when some specific buffer tries to interact with the >> > LSP - then it can run project-current in the context of that specific >> > buffer, and see there's no project, and fail. Plus, if the user kills >> > all the buffers in the project (possibly with project-kill-buffers) >> > before deleting it, this approach would entirely avoid the unnecessary >> > eglot reconnection attempt. >> >> This also sounds good, though it'd probably require more changes >> overall. Additionally, perhaps I'd change the association from (server >> -> project) to (server -> project-root), relying on the project >> backends' internal caches to fetch the project value whenever it's >> needed. That might be the most reliable approach. Perhaps the slowest in >> theory, but hopefully not noticeably so. From unknown Mon Jun 23 04:14:36 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Spencer Baugh Subject: bug#70724: closed (Re: bug#70724: 29.2.50; eglot-reconnect errors when the project is deleted) Message-ID: References: <8c915fa2-227f-475b-a380-b4f4d83e525f@gutov.dev> X-Gnu-PR-Message: they-closed 70724 X-Gnu-PR-Package: emacs Reply-To: 70724@debbugs.gnu.org Date: Thu, 06 Jun 2024 20:37:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1717706222-22363-1" This is a multi-part message in MIME format... ------------=_1717706222-22363-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #70724: 29.2.50; eglot-reconnect errors when the project is deleted which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 70724@debbugs.gnu.org. --=20 70724: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D70724 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1717706222-22363-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 70724-done) by debbugs.gnu.org; 6 Jun 2024 20:36:38 +0000 Received: from localhost ([127.0.0.1]:39843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFJqg-0005nT-1n for submit@debbugs.gnu.org; Thu, 06 Jun 2024 16:36:38 -0400 Received: from wfhigh2-smtp.messagingengine.com ([64.147.123.153]:59059) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFJqd-0005n6-OI for 70724-done@debbugs.gnu.org; Thu, 06 Jun 2024 16:36:36 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfhigh.west.internal (Postfix) with ESMTP id C058C18001A6; Thu, 6 Jun 2024 16:36:14 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Thu, 06 Jun 2024 16:36:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1717706174; x=1717792574; bh=2mmKrATIDq5LMB8V3jTEVWCbD94g9d1DLF2NhVD5zHo=; b= bcPu8VVcUSQ7WP/c+jCa9C9DzQxS3Gz51RjIH6rz74JVGTCQYpOyd4/8L8qaxzJM NVFXMrYXfDUDrxHIehZxQ6xl6caaPwuUySG3Kp/xcwJkqu9G+3oOEle+vE8fBGb9 /XWu/5Bo5Ekyldv7+w8wBfnV3OCxnU/Fz5oKxq+NgR442M36uBctYNVZgU1cDSvp 7v0mmSWan1LxTaNqTtiRkyTdo8XMcr8oiXNYTW47X7YiQgxEXrJsMrOi7Ue5ajeu rnDksel9b8Hsq0TXTedP46EZrL1nB+quhPezwGjJicGV1ywObdunNWSC8CzmI6JZ L7o8YrHLVNLzTtA6TK7sAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717706174; x= 1717792574; bh=2mmKrATIDq5LMB8V3jTEVWCbD94g9d1DLF2NhVD5zHo=; b=C a3RyjCyWT1qo8wBTBfJ9zgMtHHFm/YYNo6jN/9VnmY8CCFTHhDO5YMd+E5qou9UX qKcNrr7YtcI60Ng6Alkh/rq0ryXZoY4iOeTHGNvKSQ7nwSkxIPl9yhlx8L0zcB9d wsmRchUjvKsNF0RYLKb+PAGrwK8/s0R96u+BVbsYoiY5ajJlOD+eoRzt2AC9zSCb iYT3bndManX0xDnG0FCEOnc4w3z0VrWXQk0/by862nwi2I20hkLiF3cQcea0cvY0 gzUyVQ+co8UP0BF+5eZ7RlApZyivyjr7FA7QJm8wiU41Qp4GMTVs/GLTtFBVMAe5 vKf5HBb2ImfdAm8AY9CQg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdelkedgudehtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuhffvvehfjggtgfesthekredttddvjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpedvleeijeevkeejleffgeduiedujeffhfevudduffdvveetkeegveffjefg ffelueenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 6 Jun 2024 16:36:12 -0400 (EDT) Message-ID: <8c915fa2-227f-475b-a380-b4f4d83e525f@gutov.dev> Date: Thu, 6 Jun 2024 23:36:11 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#70724: 29.2.50; eglot-reconnect errors when the project is deleted From: Dmitry Gutov To: Spencer Baugh , 70724-done@debbugs.gnu.org References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 70724-done Cc: app-emacs-dev@janestreet.com, =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 04/05/2024 04:09, Dmitry Gutov wrote: > > I think I like this solution (as long as the nil value returned by > project-current on this step is appropriately handled). > > Something like: > > diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el > index 6896baf30ce..7b2461c3ce6 100644 > --- a/lisp/progmodes/eglot.el > +++ b/lisp/progmodes/eglot.el > @@ -1426,11 +1426,15 @@ eglot-reconnect >    (interactive (list (eglot--current-server-or-lose) t)) >    (when (jsonrpc-running-p server) >      (ignore-errors (eglot-shutdown server interactive nil > 'preserve-buffers))) > -  (eglot--connect (eglot--major-modes server) > -                  (eglot--project server) > -                  (eieio-object-class-name server) > -                  (eglot--saved-initargs server) > -                  (eglot--language-ids server)) > +  (let* ((root (project-root (eglot--project server))) > +         (project (project-current nil root))) > +    (if (not project) > +        (eglot--error "Project in `%s' is gone!" root) > +      (eglot--connect (eglot--major-modes server) > +                      project > +                      (eieio-object-class-name server) > +                      (eglot--saved-initargs server) > +                      (eglot--language-ids server)))) >    (eglot--message "Reconnected!")) > >  (defvar eglot--managed-mode) ; forward decl Okay, I've pushed a slightly revised version of this patch now. It makes sense to me, even if some caching issues might remain in project backend(s). Spencer, please see if it takes care of your scenario. ------------=_1717706222-22363-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 2 May 2024 19:37:43 +0000 Received: from localhost ([127.0.0.1]:45566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2cFS-0006jt-J7 for submit@debbugs.gnu.org; Thu, 02 May 2024 15:37:43 -0400 Received: from lists.gnu.org ([2001:470:142::17]:39044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s2cFP-0006jn-SA for submit@debbugs.gnu.org; Thu, 02 May 2024 15:37:41 -0400 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 1s2cEx-00031a-Qo for bug-gnu-emacs@gnu.org; Thu, 02 May 2024 15:37:12 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s2cEr-0002lP-2x for bug-gnu-emacs@gnu.org; Thu, 02 May 2024 15:37:10 -0400 From: Spencer Baugh To: bug-gnu-emacs@gnu.org Subject: 29.2.50; eglot-reconnect errors when the project is deleted Date: Thu, 02 May 2024 15:37:03 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1714678623; bh=HsRotOPpaHWjrXzxXabxrWnURS6qeU7SqBW9Ncv/+r4=; h=From:To:Cc:Subject:Date; b=Z6Wp+E/kyH86Ai5tdudXbRqk1spKOqA3n7xPBf3h7HCG8MGEcWiJfDuqAgffpveJY QSuTogNzcA3uKkBeSC6+G8tqR185iQcJeS1NPK8u9vJ3uQYnUi6lWnjz1nqR/CzTmC iVrCGIrYVU+BMaZZpESkA4j/6MqwU8HwyZHVzC8b+86mlxf8KKhD4ksSQgVKTgEKBY sS2j52cuuJHMXHOtt7y7tdoaVz85/1VbLHHH+AjnQLqFshCMRwmnN6qhfSeuWXcfOm uROkRw3RVojcQAyXtZPcnf42w2cdTRaRlyRVz1gLWNonvFEGGV4HJjMZGyTnhb4pH0 uX+jbCCXFpPlA== Received-SPF: pass client-ip=64.215.233.18; envelope-from=sbaugh@janestreet.com; helo=mxout5.mail.janestreet.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit Cc: dmity@gutov.dev, app-emacs-dev@janestreet.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) In some project /home/foo/proj, with pretty much any LSP server: 1. In /home/foo/proj, M-x eglot, starting some LSP server 2. Delete the directory /home/foo/proj 3. The LSP server will crash/exit 4. The process sentinel for the server will run, running eglot--on-shutdown which by default will call eglot-reconnect 5. eglot-reconnect extracts the saved project instance out of the server, which has a root directory which no longer exists, and calls eglot--connect with it 6. eglot--connect calls project-name on a nonexistent project instance, which may fail with an error depending on the project implementation (I have a custom project implementation, but I think this can happen with project-vc too) 7. This causes the process sentinel to error. I think the right fix is probably for eglot--on-shutdown (or maybe eglot-reconnect) to call (project-current nil (project-root pr)) to find the new project instance. If that returns nil, the project has disappeared, and eglot should just not try to reconnect. This also would make eglot behave better if the project layout changes (e.g. if there are nested projects). Alternatively, maybe eglot--on-shutdown shouldn't automatically reconnect in the first place? Maybe reconnection should happen automatically only when some specific buffer tries to interact with the LSP - then it can run project-current in the context of that specific buffer, and see there's no project, and fail. Plus, if the user kills all the buffers in the project (possibly with project-kill-buffers) before deleting it, this approach would entirely avoid the unnecessary eglot reconnection attempt. In GNU Emacs 29.2.50 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.12, Xaw scroll bars) of 2024-04-25 built on igm-qws-u22796a Repository revision: d07451c1f8053fa355d091351a614f232995ab8c Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Rocky Linux 8.9 (Green Obsidian) Configured using: 'configure -C --with-x-toolkit=lucid --with-gif=ifavailable' Configured features: CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM LUCID ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: ELisp/l Minor modes in effect: repeat-mode: t delete-selection-mode: t global-so-long-mode: t pixel-scroll-precision-mode: t jane-fe-minor-mode: t jane-fe-jenga-minor-mode: t editorconfig-mode: t dired-omit-mode: t which-function-mode: t global-git-commit-mode: t magit-auto-revert-mode: t shell-dirtrack-mode: t server-mode: t savehist-mode: t save-place-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tab-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t context-menu-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Features: (magit-patch make-mode doctor texinfo texinfo-loaddefs completion emacs-news-mode latexenc mode-local minibuf-eldef ...) Memory information: ((conses 16 4170589 532507) (symbols 48 67528 55) (strings 32 645610 32608) (string-bytes 1 31944500) (vectors 16 203742) (vector-slots 8 4053669 619438) (floats 8 1045 1428) (intervals 56 410065 1774) (buffers 976 767)) ------------=_1717706222-22363-1-- From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 21 14:43:31 2024 Received: (at control) by debbugs.gnu.org; 21 Nov 2024 19:43:31 +0000 Received: from localhost ([127.0.0.1]:51792 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tED5O-0003Ps-ML for submit@debbugs.gnu.org; Thu, 21 Nov 2024 14:43:31 -0500 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:49303) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tED5M-0003Pb-C9 for control@debbugs.gnu.org; Thu, 21 Nov 2024 14:43:29 -0500 To: control@debbugs.gnu.org From: Spencer Baugh Subject: control message for bug #70724 Message-Id: Date: Thu, 21 Nov 2024 14:43:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1732218202; bh=HRuCIYSdl0+W2KQ719vJKuW9Usx2ngQn6cHUyxQ33x0=; h=To:From:Subject:Date; b=TYBkVtMw1XEw2FRS3RJU1ENQ1CMvPMpkR8/1bucQW794L+ounx/d9nmW34z0MndVv XjNj1EMNwwI7XeUUEfIA5kHOR7h2YDHmFSf4yaJ7EmGrhgae9SnHbKlIhPowvKEG0A j2k5pwbjGPX44re0VRunT9UmUa6pttDFMWraou8dVAAXjKSlFdeTgVbRfNdfn49anG JTtV0OozG/lhAaVD+6dxCwP9ebEHzg3ecgf22zltUmXkwxgCNQFrLlfcP5FbdTVdR/ Oqf9Dk4rQu7qehx0g3cwU2FGhhFXouj+kQ0KbT686wfbBqZp88/ApMHw02EB2BpkvE 3aZPRHnpmv19Q== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) unarchive 70724 quit From unknown Mon Jun 23 04:14:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70724: 29.2.50; eglot-reconnect errors when the project is deleted 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 X-GNU-PR-Keywords: To: Dmitry Gutov Cc: Eli Zaretskii , app-emacs-dev@janestreet.com, =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , 70724@debbugs.gnu.org Received: via spool by 70724-submit@debbugs.gnu.org id=B70724.173221838613833 (code B ref 70724); Thu, 21 Nov 2024 19:47:02 +0000 Received: (at 70724) by debbugs.gnu.org; 21 Nov 2024 19:46:26 +0000 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 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 From: Spencer Baugh In-Reply-To: (Dmitry Gutov's message of "Sun, 19 May 2024 18:08:15 +0300") References: <8634qffrly.fsf@gnu.org> Date: Thu, 21 Nov 2024 14:46:18 -0500 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain 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-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) (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 From unknown Mon Jun 23 04:14:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70724: 29.2.50; eglot-reconnect errors when the project is deleted 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 X-GNU-PR-Keywords: To: Spencer Baugh Cc: Dmitry Gutov , Eli Zaretskii , app-emacs-dev@janestreet.com, 70724@debbugs.gnu.org Received: via spool by 70724-submit@debbugs.gnu.org id=B70724.173221862614589 (code B ref 70724); Thu, 21 Nov 2024 19:51:02 +0000 Received: (at 70724) by debbugs.gnu.org; 21 Nov 2024 19:50:26 +0000 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 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 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) MIME-Version: 1.0 References: <8634qffrly.fsf@gnu.org> In-Reply-To: From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Date: Thu, 21 Nov 2024 19:49:13 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From unknown Mon Jun 23 04:14:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70724: 29.2.50; eglot-reconnect errors when the project is deleted Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Nov 2024 19:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70724 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: Dmitry Gutov , Eli Zaretskii , app-emacs-dev@janestreet.com, 70724@debbugs.gnu.org Received: via spool by 70724-submit@debbugs.gnu.org id=B70724.173221876514845 (code B ref 70724); Thu, 21 Nov 2024 19:53:02 +0000 Received: (at 70724) by debbugs.gnu.org; 21 Nov 2024 19:52:45 +0000 Received: from localhost ([127.0.0.1]:51825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEDEK-0003rM-Oq for submit@debbugs.gnu.org; Thu, 21 Nov 2024 14:52:45 -0500 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:50341) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEDEI-0003r9-QZ for 70724@debbugs.gnu.org; Thu, 21 Nov 2024 14:52:43 -0500 From: Spencer Baugh In-Reply-To: ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Thu, 21 Nov 2024 19:49:13 +0000") References: <8634qffrly.fsf@gnu.org> Date: Thu, 21 Nov 2024 14:52:37 -0500 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1732218757; bh=fYdL7hAJ8fZSXUJUNLEZwMQ1BWEI7hxxDpYNOcZrjFQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=fqWUBWEE3E2zLZyKgM/A2DBAY2w7A3aEtsq8iwHAxciaabFSksT9LYsZyfb2zkAj0 KVMM4fFYEoENOaZK6SQK3HtAteyRo3EnqK/P896eh8PAS0AMwclUt8TRl/OxadDFNH haIeadD91g755dgfQBTVOR3n7Ve92DU/F40b6HDJZEANaMaSbXHLdd4ZePySNyPXp9 eOQ7qYJsMrvbUtJt/PGnbYCgsGjBzbDVDCliHbvL+0+eg1bbuZgUWuEAa2ZywBC+Ac 2EOXkUGI6wKrUaIkPkRITQYSI6OBl/ZRTlUSUb5SDnIX01SXSxaC8fj3/AS4ijCaSI S2peUCrd6KF0Q== X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Jo=C3=A3o T=C3=A1vora writes: > 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 That looks good to me. From unknown Mon Jun 23 04:14:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70724: 29.2.50; eglot-reconnect errors when the project is deleted Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Nov 2024 19:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70724 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: Dmitry Gutov , Eli Zaretskii , app-emacs-dev@janestreet.com, 70724@debbugs.gnu.org Received: via spool by 70724-submit@debbugs.gnu.org id=B70724.173221894515497 (code B ref 70724); Thu, 21 Nov 2024 19:56:01 +0000 Received: (at 70724) by debbugs.gnu.org; 21 Nov 2024 19:55:45 +0000 Received: from localhost ([127.0.0.1]:51833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEDHF-00041t-9Q for submit@debbugs.gnu.org; Thu, 21 Nov 2024 14:55:45 -0500 Received: from mxout6.mail.janestreet.com ([64.215.233.21]:37307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEDHD-00041d-1T for 70724@debbugs.gnu.org; Thu, 21 Nov 2024 14:55:44 -0500 From: Spencer Baugh In-Reply-To: (Spencer Baugh's message of "Thu, 21 Nov 2024 14:52:37 -0500") References: <8634qffrly.fsf@gnu.org> Date: Thu, 21 Nov 2024 14:55:37 -0500 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1732218937; bh=At5kl5+F0zRxTsDzBYg8bGP27yCHYV9WOLKGNOMTYS0=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=2k5SDbIZ5ZE6xeBGODRvu/NvrLrW2OGIWobWnQSX8H3zZTRJ9Kuh/zY8pY33zp3Z8 OC6n19gdhczrbDuMoXDORG63jHDJ0SxVX9Y/CjdZY3UUSTrDUtRS2EMSCwk6vuVWct /pAH6GwcRAj2zwTC9/VMdIRpFhhu8q5zDgwRzQGz6DqAEE3YY5ebxtXVUPUw3Xu8bl e4B6ukyQZmiyHYY+TTLd9FjDFgC3ZpRqeFQIF2w5wHzLeGQ+JxkD32xXt1u2h7QXN0 EWYV/LznHRg2VjKYQm++mkUxMZqs25h0hQpHz0IJ+WZVgzlqvihLbgFzK3laf8SJ8f eR+eZFMDmL+JQ== X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Spencer Baugh writes: > Jo=C3=A3o T=C3=A1vora writes: >> 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 becau= se >> + (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 > > That looks good to me. Actually, wait, sorry, neither this nor your initial revised patch fixes this bug at all. The process sentinel still errors because eglot-reconnect errors. We need to actually not try to reconnect when the project is gone. From unknown Mon Jun 23 04:14:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70724: 29.2.50; eglot-reconnect errors when the project is deleted 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 20:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70724 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Spencer Baugh Cc: Dmitry Gutov , Eli Zaretskii , app-emacs-dev@janestreet.com, 70724@debbugs.gnu.org Received: via spool by 70724-submit@debbugs.gnu.org id=B70724.173222014318947 (code B ref 70724); Thu, 21 Nov 2024 20:16:01 +0000 Received: (at 70724) by debbugs.gnu.org; 21 Nov 2024 20:15:43 +0000 Received: from localhost ([127.0.0.1]:51860 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEDaY-0004vX-PC for submit@debbugs.gnu.org; Thu, 21 Nov 2024 15:15:43 -0500 Received: from mail-oi1-f176.google.com ([209.85.167.176]:43239) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEDaW-0004vH-HS for 70724@debbugs.gnu.org; Thu, 21 Nov 2024 15:15:41 -0500 Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-3e7b704b7e1so1206003b6e.0 for <70724@debbugs.gnu.org>; Thu, 21 Nov 2024 12:15:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732220075; x=1732824875; 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=8bvVMEPKs1jRkjH9tE1L0madIBIiWahrAKmZZ4cx+rA=; b=HXYtYYRR06+j/1+hEj7XFOymji6EwOzCKpkpCQwX2JSZUzznwNhIXT/F55uqgUSHrd 17O21raM2HBPwzJFWOh63xyDPEQNa1UGgRnBGmEsQpCS8vObnN1LttXp4XIgPEOQfOY/ eksv7hMw9ULhbvQq8LMhntvBB0KpR3RVmQM2aBK8mwEotuVb5Mnj4TGYbK6W74t7TZ8z wijx/q/rwgvt4EHIn5e56023b1ZY0pjr970VFG8zd6tXGvr2wZxyKM3N0eGtY0CImhrC bXiuA/P66iwE4980gfSBpQQVWC0YGVUHZva0kfQigowO80P3mrfMEiXBESvxS9JopHjO LE+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732220075; x=1732824875; 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=8bvVMEPKs1jRkjH9tE1L0madIBIiWahrAKmZZ4cx+rA=; b=DkESj/yGk70IsOPPv7XdxCJ/ZuPlcfygwpiQBdl4lF5txUYja4YD1QrstmC/YJZGrx jg+EeP/LeMKJvgTJFSJh3/76z9+LgsIHzaIq1SuXH+6h4DJ4k4DEXgE+mlIG22P9giR3 TFbtbxD3cRKhj2kyrICvAwRPnOO3XrxTaocJ46iys83xFuFhsFxXCn5m90IkziGTJWne r/bCsdYSPVU/FZ9FniNNjzy5D1C9yIlqHVflgtV13SCmB9063XTDA8XMXlDm1St0O9tr lNlhz0tIuDF3fPjSUj838be4SbYeZO4yaHHa0GLs3K6d6si/incEXsSnJZoh+rCWg71C OLvA== X-Forwarded-Encrypted: i=1; AJvYcCWVpvrBDuYJHqwu8Oj+7ounxU5NGLWPexSR5OlmW3Tch8s1dC0DCG6oecsDSc0CnT3njueP7w==@debbugs.gnu.org X-Gm-Message-State: AOJu0YxMysawJlWca0jc+N5p8EcPFeDaNFptI1iR/aVqIJg0P2hOLaLv VLa686xKJnKnYwuchr3xAW+COIiB/Zx3AOkwBGNRK4OMwLXs25eAmKsb+PzgK6SOtl2qQ9HpJPy AXQ8r87FmgtDyI+jt1Df8amsGn6Q= X-Gm-Gg: ASbGncueUElVnzBwjugcEoVqlMt6nrtrWe8Fp37cjC2c4AT4Cc+Q+Y6SySLwhmD69w9 TBzZd3k+znu5h5eC+jfqkVzadmomuEA== X-Google-Smtp-Source: AGHT+IE+tMPlB3dtgoBHQha04yjvh1s657ehNWvzblgiCDCmVEpIhCqGNN4W43997uXcyv/wK8Ovr0FRwspftTNfdsI= X-Received: by 2002:a05:6808:1789:b0:3e7:ac6a:2137 with SMTP id 5614622812f47-3e914a7f5c0mr297321b6e.16.1732220075033; Thu, 21 Nov 2024 12:14:35 -0800 (PST) MIME-Version: 1.0 References: <8634qffrly.fsf@gnu.org> In-Reply-To: From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Date: Thu, 21 Nov 2024 20:14:24 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Explain your scenario, please. And note that if you take the rug from underneath Eglot it will error, period. That's by design. I'm not willing to contort the code to do anything more than provide a more or less understandable error message for such (relatively rare) rug pulling. IOW sentinels erroring is part of Emacs life and not a bug in itself, it's the error message that I'm willing to help ensure is clear. Please provide a backtrace and say if it's obtained with the very same recipe in the beginning of the bug report. Jo=C3=A3o On Thu, Nov 21, 2024 at 7:55=E2=80=AFPM Spencer Baugh wrote: > > Spencer Baugh writes: > > Jo=C3=A3o T=C3=A1vora writes: > >> 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 bec= ause > >> + (eglot--error "Project at `%s' is gone!" > >> default-directory))) > >> + (readable-name (format "EGLOT (%s/%s)" nickname managed-mode= s)) > >> server-info > >> (contact (if (functionp contact) (funcall contact) contact)) > >> (initargs > > > > That looks good to me. > > Actually, wait, sorry, neither this nor your initial revised patch fixes > this bug at all. The process sentinel still errors because > eglot-reconnect errors. We need to actually not try to reconnect when > the project is gone. --=20 Jo=C3=A3o T=C3=A1vora From unknown Mon Jun 23 04:14:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70724: 29.2.50; eglot-reconnect errors when the project is deleted Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Nov 2024 20:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70724 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: Dmitry Gutov , Eli Zaretskii , app-emacs-dev@janestreet.com, 70724@debbugs.gnu.org Received: via spool by 70724-submit@debbugs.gnu.org id=B70724.173222230425295 (code B ref 70724); Thu, 21 Nov 2024 20:52:02 +0000 Received: (at 70724) by debbugs.gnu.org; 21 Nov 2024 20:51:44 +0000 Received: from localhost ([127.0.0.1]:51935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEE9P-0006Zu-KE for submit@debbugs.gnu.org; Thu, 21 Nov 2024 15:51:44 -0500 Received: from mxout1.mail.janestreet.com ([38.105.200.78]:41191) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEE9N-0006Zi-O2 for 70724@debbugs.gnu.org; Thu, 21 Nov 2024 15:51:42 -0500 From: Spencer Baugh In-Reply-To: ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Thu, 21 Nov 2024 20:14:24 +0000") References: <8634qffrly.fsf@gnu.org> Date: Thu, 21 Nov 2024 15:51:36 -0500 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1732222296; bh=UVOtA3b8tHdHHhJA/Ep2vuH9AYaxfadkzke00X6GRck=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=XObfqAbJAid1Z3D3LtJSVbTwndMvLqMxeWAiGX5srMq7x8RmIRqatAAo5WT/YARDF EPe8UMoAqAvPXsiDynSHFFJNW0z+7y0aYqZhgia7gjIF/fDchMz/nvEBtZyzaqX1mi AaGLtn7cUDXRX2V3lWSD062niGEJXu7Kol85jwv5ubpfETlXzivMWtEJCssOLJf1uH yrZWRZGiFVTWHtOpZFpZ2jz3Fcask1forVTCTwo6F5DIPIw2Kfyd5On3SvgUh3F+6t 8AMQaghcWejf7jKkFL1lv+2v+DswOBzaDKEwJa3sjn+b6ZR7as7DZVOIeAb0bs0agI 1lEBlcH6/IxJQ== X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Jo=C3=A3o T=C3=A1vora writes: > Explain your scenario, please. And note that if you take the rug from > underneath Eglot it will error, period. That's by design. I'm not > willing to contort the code to do anything more than provide a > more or less understandable error message for such (relatively rare) > rug pulling. IOW sentinels erroring is part of Emacs life and not a > bug in itself, it's the error message that I'm willing to help ensure is > clear. I use (the equivalent of) git worktrees to have one repo checkout per branch that I'm working on. As I finish work on a branch, I delete the worktree with a shell command outside of Emacs. Thus I hit this error several times a day, depending on how productive I am. (The same workflow is used by ~everyone at my employer, and before we can use Eglot widely, it would be ideal to get rid of this frequent error) > Please provide a backtrace and say if it's obtained with the very > same recipe in the beginning of the bug report. > Sure, here's the backtrace with the patch in your last email. It is obtained with the very same recipe in the beginning of the bug report: I opened an (OCaml) file, did M-x eglot (starting ocaml-lsp), deleted the directory, and it proceeded as I said in the beginning of the bug report. Debugger entered--Lisp error: (error "[eglot] Project at `/usr/local/home/s= baugh/workspaces/fe-880764/+share+/' is gone!") signal(error ("[eglot] Project at `/usr/local/home/sbaugh/workspaces/fe-8= 80764/+share+/' is gone!")) error("[eglot] %s" "Project at `/usr/local/home/sbaugh/workspaces/fe-8807= 64/+share+/' is gone!") eglot--error("Project at `%s' is gone!" "/usr/local/home/sbaugh/workspace= s/fe-880764/+share+/") (if (file-exists-p default-directory) (project-name project) (eglot--erro= r "Project at `%s' is gone!" default-directory)) (let* ((default-directory (project-root project)) (nickname (if (file-exi= sts-p default-directory) (project-name project) (eglot--error "Project at `= %s' is gone!" default-directory))) (readable-name (format "EGLOT (%s/%s)" n= ickname managed-modes)) server-info (contact (if (functionp contact) (funca= ll contact) contact)) (initargs (cond ((keywordp (car contact)) contact) ((= integerp (car (cdr contact))) (setq server-info (list (format "%s:%s" ... .= ..))) (list ':process #'(lambda nil ...))) ((and (stringp (car contact)) (c= l-find-if #'... contact)) (setq server-info (list "")) (l= ist ':process (jsonrpc-autoport-bootstrap readable-name contact :connect-ar= gs '...))) ((stringp (car contact)) (let* ((probe ...) (more-initargs ...) = (contact ...)) (cons ':process (cons ... more-initargs)))))) (spread #'(lam= bda (fn) #'(lambda (server method params) (let ... ...)))) (server (apply #= 'make-instance class :name readable-name :events-buffer-config eglot-events= -buffer-config :notification-dispatcher (funcall spread #'eglot-handle-noti= fication) :request-dispatcher (funcall spread #'eglot-handle-request) :on-s= hutdown #'eglot--on-shutdown initargs)) (canceled nil) (tag (make-symbol "c= onnected-catch-tag"))) (if server-info (progn (jsonrpc--debug server "Runni= ng language server: %s" (string-join server-info " ")))) (let* ((v server))= (\(setf\ eglot--saved-initargs\) initargs v)) (let* ((v server)) (\(setf\ = eglot--project\) project v)) (let* ((v server)) (\(setf\ eglot--project-nic= kname\) nickname v)) (let* ((v server)) (\(setf\ eglot--languages\) (let* (= (--cl-var-- managed-modes) (m nil) (--cl-var-- language-ids) (l nil) (--cl-= var-- nil)) (while (and (consp --cl-var--) (progn (setq m ...) (consp --cl-= var--))) (setq l (car --cl-var--)) (setq --cl-var-- (cons (cons m l) --cl-v= ar--)) (setq --cl-var-- (cdr --cl-var--)) (setq --cl-var-- (cdr --cl-var--)= )) (nreverse --cl-var--)) v)) (run-hook-with-args 'eglot-server-initialized= -hook server) (unwind-protect (condition-case _quit (let ((retval (catch ta= g (jsonrpc-async-request server :initialize ... :success-fn ... :timeout eg= lot-connect-timeout :error-fn ... :timeout-fn ...) (cond ... ...)))) (cond = ((consp retval) (let* (...) (if ... ... ...))) ((null retval) (let nil (egl= ot--message "Waiting in background for server `%s'" ...) nil)) (t (let nil = server)))) (quit (jsonrpc-shutdown server) (setq canceled 'quit))) (setq ta= g nil))) eglot--connect((tuareg-mode) #s(jane-fe-project :workspace "/usr/local/ho= me/sbaugh/workspaces/fe-880764/+share+/" :vc (vc Hg "/usr/local/home/sbaugh= /workspaces/fe-880764/+share+/")) eglot-lsp-server (:process (closure ((con= tact "dispatch_ocaml_lsp.exe" "open! Core" "dev") (server-info "dispatch_oc= aml_lsp.exe" "open! Core" "dev") (readable-name . "EGLOT (dune-add-disable-= file-watcher-rpc/(tuareg-mode))") tramp-ssh-controlmaster-options tramp-use= -ssh-controlmaster-options) nil (let ((default-directory default-directory)= (tramp-use-ssh-controlmaster-options 'suppress) (tramp-ssh-controlmaster-o= ptions "-o ControlMaster=3Dno -o ControlPath=3Dnone")) (make-process :name = readable-name :command (setq server-info (eglot--cmd contact)) :connection-= type 'pipe :coding 'utf-8-emacs-unix :noquery t :stderr (get-buffer-create = (format "*%s stderr*" readable-name)) :file-handler t)))) ("tuareg")) eglot-reconnect(#) (cond ((eglot--shutdown-requested server) t) ((not (eglot--inhibit-autore= connect server)) (eglot--warn "Reconnecting after unexpected server exit.")= (eglot-reconnect server)) ((timerp (eglot--inhibit-autoreconnect server)) = (eglot--warn "Not auto-reconnecting, last one didn't last long."))) eglot--on-shutdown(#) funcall(eglot--on-shutdown #) (unwind-protect (mapc #'(lambda (jsonrpc-lambda-elem168) (apply #'(lambda= (_id _method _success-fn error-fn _timer) (funcall error-fn '(:code -1 :me= ssage "Server died"))) jsonrpc-lambda-elem168)) (jsonrpc--continuations con= nection)) (jsonrpc--message "Server exited with status %s" (process-exit-st= atus proc)) (delete-process proc) (let* ((p (and t (slot-value connection '= -autoport-inferior)))) (if p (delete-process p) nil)) (funcall (jsonrpc--on= -shutdown connection) connection)) (progn (save-current-buffer (set-buffer (jsonrpc-events-buffer connection= )) (let ((inhibit-read-only t)) (insert "\n----------b---y---e---b---y---e-= ---------\n"))) (mapc #'(lambda (jsonrpc-lambda-elem167) (apply #'(lambda (= _id _method _success-fn _error-fn timer) (if timer (progn (cancel-timer tim= er)))) jsonrpc-lambda-elem167)) (jsonrpc--continuations connection)) (mapha= sh #'(lambda (_ triplet) (progn (ignore (consp triplet)) (let* ((x919 (cdr-= safe triplet))) (progn (ignore (consp x919)) (let* ((x920 (car-safe x919)) = (x921 (cdr-safe x919))) (progn (ignore (consp x921)) (let* ((x923 (cdr-safe= x921))) (progn (ignore (null x923)) (let ((timer x920)) (if timer (progn (= cancel-timer timer)))))))))))) (jsonrpc--deferred-actions connection)) (pro= cess-put proc 'jsonrpc-sentinel-cleanup-started t) (unwind-protect (mapc #'= (lambda (jsonrpc-lambda-elem168) (apply #'(lambda (_id _method _success-fn = error-fn _timer) (funcall error-fn '(:code -1 :message "Server died"))) jso= nrpc-lambda-elem168)) (jsonrpc--continuations connection)) (jsonrpc--messag= e "Server exited with status %s" (process-exit-status proc)) (delete-proces= s proc) (let* ((p (and t (slot-value connection '-autoport-inferior)))) (if= p (delete-process p) nil)) (funcall (jsonrpc--on-shutdown connection) conn= ection))) (if (not (process-live-p proc)) (progn (save-current-buffer (set-buffer (= jsonrpc-events-buffer connection)) (let ((inhibit-read-only t)) (insert "\n= ----------b---y---e---b---y---e----------\n"))) (mapc #'(lambda (jsonrpc-la= mbda-elem167) (apply #'(lambda (_id _method _success-fn _error-fn timer) (i= f timer (progn (cancel-timer timer)))) jsonrpc-lambda-elem167)) (jsonrpc--c= ontinuations connection)) (maphash #'(lambda (_ triplet) (progn (ignore (co= nsp triplet)) (let* ((x919 (cdr-safe triplet))) (progn (ignore (consp x919)= ) (let* ((x920 (car-safe x919)) (x921 (cdr-safe x919))) (progn (ignore (con= sp x921)) (let* ((x923 (cdr-safe x921))) (progn (ignore (null x923)) (let (= (timer x920)) (if timer (progn ...))))))))))) (jsonrpc--deferred-actions co= nnection)) (process-put proc 'jsonrpc-sentinel-cleanup-started t) (unwind-p= rotect (mapc #'(lambda (jsonrpc-lambda-elem168) (apply #'(lambda (_id _meth= od _success-fn error-fn _timer) (funcall error-fn '(:code -1 :message "Serv= er died"))) jsonrpc-lambda-elem168)) (jsonrpc--continuations connection)) (= jsonrpc--message "Server exited with status %s" (process-exit-status proc))= (delete-process proc) (let* ((p (and t (slot-value connection '-autoport-i= nferior)))) (if p (delete-process p) nil)) (funcall (jsonrpc--on-shutdown c= onnection) connection)))) (let ((connection (process-get proc 'jsonrpc-connection))) (jsonrpc--debu= g connection "Connection state change: `%s'" change) (if (not (process-live= -p proc)) (progn (save-current-buffer (set-buffer (jsonrpc-events-buffer co= nnection)) (let ((inhibit-read-only t)) (insert "\n----------b---y---e---b-= --y---e----------\n"))) (mapc #'(lambda (jsonrpc-lambda-elem167) (apply #'(= lambda (_id _method _success-fn _error-fn timer) (if timer (progn (cancel-t= imer timer)))) jsonrpc-lambda-elem167)) (jsonrpc--continuations connection)= ) (maphash #'(lambda (_ triplet) (progn (ignore (consp triplet)) (let* ((x9= 19 (cdr-safe triplet))) (progn (ignore (consp x919)) (let* ((x920 (car-safe= x919)) (x921 (cdr-safe x919))) (progn (ignore (consp x921)) (let* ((x923 (= cdr-safe x921))) (progn (ignore (null x923)) (let (...) (if timer ...))))))= )))) (jsonrpc--deferred-actions connection)) (process-put proc 'jsonrpc-sen= tinel-cleanup-started t) (unwind-protect (mapc #'(lambda (jsonrpc-lambda-el= em168) (apply #'(lambda (_id _method _success-fn error-fn _timer) (funcall = error-fn '(:code -1 :message "Server died"))) jsonrpc-lambda-elem168)) (jso= nrpc--continuations connection)) (jsonrpc--message "Server exited with stat= us %s" (process-exit-status proc)) (delete-process proc) (let* ((p (and t (= slot-value connection '-autoport-inferior)))) (if p (delete-process p) nil)= ) (funcall (jsonrpc--on-shutdown connection) connection))))) jsonrpc--process-sentinel(# "exited abnormally with code 1\n") From unknown Mon Jun 23 04:14:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#70724: 29.2.50; eglot-reconnect errors when the project is deleted 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 23:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70724 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Spencer Baugh Cc: Dmitry Gutov , Eli Zaretskii , app-emacs-dev@janestreet.com, 70724@debbugs.gnu.org Received: via spool by 70724-submit@debbugs.gnu.org id=B70724.173223229221370 (code B ref 70724); Thu, 21 Nov 2024 23:39:02 +0000 Received: (at 70724) by debbugs.gnu.org; 21 Nov 2024 23:38:12 +0000 Received: from localhost ([127.0.0.1]:52134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEGkU-0005YY-GH for submit@debbugs.gnu.org; Thu, 21 Nov 2024 18:38:12 -0500 Received: from mail-oi1-f179.google.com ([209.85.167.179]:59612) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEGkR-0005Y6-35 for 70724@debbugs.gnu.org; Thu, 21 Nov 2024 18:38:08 -0500 Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-3e600ae1664so875370b6e.2 for <70724@debbugs.gnu.org>; Thu, 21 Nov 2024 15:38:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732232221; x=1732837021; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=44WuLjMigwbnCWOuz/kLh5iSKbDqD/FEC8xTP81igPc=; b=KkZEtGJmGIDq/53cAe0RFPI8/DAmggrYowzvod7diLCWOZBKHujEajrckC9cNt6MaZ GWLL00aVPjDEgXpubRMQMsREY70j109Imon4pjOTANkKSwuDsvlC7Ls5jsxJWFFUSXXl mNC7GkaahgSkKQ3hgAMmF/DTCpTzNirXnKwwGUCZRisExWxAsvSsshU2G1tlIlKKjV29 VJHbB6u4d0CUr7Qb9X9jmZ6N85j/wXxu6zDq96uVPPIg2z9+ftN+gWlRPc6fBq8b7/gu kY8OianU0hksfV8cL2jS9jS/27RukW72xueaGsjDnreCDnyfgBZolqgjl9SfBdEUSqRi ANbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732232221; x=1732837021; h=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=44WuLjMigwbnCWOuz/kLh5iSKbDqD/FEC8xTP81igPc=; b=Gqc8g6nyb5R8f5Em5jJdOzknRANqyPCI/SDrbsUEr70SH5TI34qBC0ygm7vS5idHRK ctGCOfMUKz3OgTR8//nsnSF5sCaW2ulWNjpZaDA8A+6JyG+zet70vQ08RYyR0q+jwijE advumnYwwF/nGxLVu2biGWf32j5iRkb68jA51xTWsxd8DC/r+LjWc2xW79mmGxltadSk 5fQcnDzzKowoKcIhRFbRInSxLY7uBOZ5MjD1Gp7aX2A/NOl9ZwBws7Gng0zH+IBz2KAG SAKEiZS9MPynTci+nVirlhhZdV8ONMo7KzQV9eG05DSmZzXnT2AZ3KulJA18pgKu6bwc je9g== X-Forwarded-Encrypted: i=1; AJvYcCXxIbqypaO2OfRxQwTo80jkNyfOMjb0xV5GwFnrTNmIFqK7E6CpTrjspIB8AXSm0mOMm2JpTA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyuJ+DQF+alUsyK38JcLM4Um7bZcuSVYeD+dQo4Sbr2sqKf69oG JnqVlgnYqgVc31ANzYVjzBs6ZLCDkhK+hHmpvt2q2bYXCly+VJBOMPfatrpgdl9qEDm+5Goqnn8 0fKC//u0HoQqzxpzSPCKSvRRPAaA= X-Gm-Gg: ASbGnctn2fTy6zPSHpjO3UHDihjCcRcTM60Ki4Xe/si7UVjQDTYxcGZFcOWMKS1jeyW 6StsSww1owutYzS/QWyFAS5exyaxdIg== X-Google-Smtp-Source: AGHT+IE/HId83yWCdp9iPV9pClxrSjKHAZYWIV188wpTeLjJv+nwzoMPnDL6282xKCSV1dCz/ta99vsyQaQSRIBGacc= X-Received: by 2002:a05:6808:ec6:b0:3e5:f656:dd19 with SMTP id 5614622812f47-3e91582c839mr1062373b6e.19.1732232221438; Thu, 21 Nov 2024 15:37:01 -0800 (PST) MIME-Version: 1.0 References: <8634qffrly.fsf@gnu.org> In-Reply-To: From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Date: Thu, 21 Nov 2024 23:36:50 +0000 Message-ID: Content-Type: multipart/alternative; boundary="0000000000003a3d18062774becc" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000003a3d18062774becc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable So, the error is explanatory, no?? As far as I can tell your original patch also signalled an error, and that error happened in the sentinel. If you want to avoid this error and silently proceed, for the benefit of your particular workflow, write a project backend that keeps its vital information despite having lost its file system backing. Or, maybe better, write some advice to eglot-autoreconnect which is an external function (and thus offers some stability guarantee of its interface). eglot-reconnect takes the server as argument and you can query the project to know if its still valid or not and noop in the case it's been deleted from the filesystem. But this is too specific to generalize in Eglot. I for one like to be warned of these error, because for me having a connected-to project suddenly deleted in an exception, it's not the rule. Jo=C3=A3o On Thu, Nov 21, 2024, 20:51 Spencer Baugh wrote: > Jo=C3=A3o T=C3=A1vora writes: > > > Explain your scenario, please. And note that if you take the rug from > > underneath Eglot it will error, period. That's by design. I'm not > > willing to contort the code to do anything more than provide a > > more or less understandable error message for such (relatively rare) > > rug pulling. IOW sentinels erroring is part of Emacs life and not a > > bug in itself, it's the error message that I'm willing to help ensure = is > > clear. > > I use (the equivalent of) git worktrees to have one repo checkout per > branch that I'm working on. As I finish work on a branch, I delete the > worktree with a shell command outside of Emacs. Thus I hit this error > several times a day, depending on how productive I am. > > (The same workflow is used by ~everyone at my employer, and before we > can use Eglot widely, it would be ideal to get rid of this frequent > error) > > > Please provide a backtrace and say if it's obtained with the very > > same recipe in the beginning of the bug report. > > > > Sure, here's the backtrace with the patch in your last email. It is > obtained with the very same recipe in the beginning of the bug report: I > opened an (OCaml) file, did M-x eglot (starting ocaml-lsp), deleted the > directory, and it proceeded as I said in the beginning of the bug > report. > > Debugger entered--Lisp error: (error "[eglot] Project at > `/usr/local/home/sbaugh/workspaces/fe-880764/+share+/' is gone!") > signal(error ("[eglot] Project at > `/usr/local/home/sbaugh/workspaces/fe-880764/+share+/' is gone!")) > error("[eglot] %s" "Project at > `/usr/local/home/sbaugh/workspaces/fe-880764/+share+/' is gone!") > eglot--error("Project at `%s' is gone!" > "/usr/local/home/sbaugh/workspaces/fe-880764/+share+/") > (if (file-exists-p default-directory) (project-name project) > (eglot--error "Project at `%s' is gone!" default-directory)) > (let* ((default-directory (project-root project)) (nickname (if > (file-exists-p default-directory) (project-name project) (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 (cond ((keyword= p > (car contact)) contact) ((integerp (car (cdr contact))) (setq server-info > (list (format "%s:%s" ... ...))) (list ':process #'(lambda nil ...))) ((a= nd > (stringp (car contact)) (cl-find-if #'... contact)) (setq server-info (li= st > "")) (list ':process (jsonrpc-autoport-bootstrap > readable-name contact :connect-args '...))) ((stringp (car contact)) (let= * > ((probe ...) (more-initargs ...) (contact ...)) (cons ':process (cons ... > more-initargs)))))) (spread #'(lambda (fn) #'(lambda (server method param= s) > (let ... ...)))) (server (apply #'make-instance class :name readable-name > :events-buffer-config eglot-events-buffer-config :notification-dispatcher > (funcall spread #'eglot-handle-notification) :request-dispatcher (funcall > spread #'eglot-handle-request) :on-shutdown #'eglot--on-shutdown initargs= )) > (canceled nil) (tag (make-symbol "connected-catch-tag"))) (if server-info > (progn (jsonrpc--debug server "Running language server: %s" (string-join > server-info " ")))) (let* ((v server)) (\(setf\ eglot--saved-initargs\) > initargs v)) (let* ((v server)) (\(setf\ eglot--project\) project v)) (le= t* > ((v server)) (\(setf\ eglot--project-nickname\) nickname v)) (let* ((v > server)) (\(setf\ eglot--languages\) (let* ((--cl-var-- managed-modes) (m > nil) (--cl-var-- language-ids) (l nil) (--cl-var-- nil)) (while (and (con= sp > --cl-var--) (progn (setq m ...) (consp --cl-var--))) (setq l (car > --cl-var--)) (setq --cl-var-- (cons (cons m l) --cl-var--)) (setq > --cl-var-- (cdr --cl-var--)) (setq --cl-var-- (cdr --cl-var--))) (nrevers= e > --cl-var--)) v)) (run-hook-with-args 'eglot-server-initialized-hook serve= r) > (unwind-protect (condition-case _quit (let ((retval (catch tag > (jsonrpc-async-request server :initialize ... :success-fn ... :timeout > eglot-connect-timeout :error-fn ... :timeout-fn ...) (cond ... ...)))) > (cond ((consp retval) (let* (...) (if ... ... ...))) ((null retval) (let > nil (eglot--message "Waiting in background for server `%s'" ...) nil)) (t > (let nil server)))) (quit (jsonrpc-shutdown server) (setq canceled 'quit)= )) > (setq tag nil))) > eglot--connect((tuareg-mode) #s(jane-fe-project :workspace > "/usr/local/home/sbaugh/workspaces/fe-880764/+share+/" :vc (vc Hg > "/usr/local/home/sbaugh/workspaces/fe-880764/+share+/")) eglot-lsp-server > (:process (closure ((contact "dispatch_ocaml_lsp.exe" "open! Core" "dev") > (server-info "dispatch_ocaml_lsp.exe" "open! Core" "dev") (readable-name = . > "EGLOT (dune-add-disable-file-watcher-rpc/(tuareg-mode))") > tramp-ssh-controlmaster-options tramp-use-ssh-controlmaster-options) nil > (let ((default-directory default-directory) > (tramp-use-ssh-controlmaster-options 'suppress) > (tramp-ssh-controlmaster-options "-o ControlMaster=3Dno -o > ControlPath=3Dnone")) (make-process :name readable-name :command (setq > server-info (eglot--cmd contact)) :connection-type 'pipe :coding > 'utf-8-emacs-unix :noquery t :stderr (get-buffer-create (format "*%s > stderr*" readable-name)) :file-handler t)))) ("tuareg")) > eglot-reconnect(#) > (cond ((eglot--shutdown-requested server) t) ((not > (eglot--inhibit-autoreconnect server)) (eglot--warn "Reconnecting after > unexpected server exit.") (eglot-reconnect server)) ((timerp > (eglot--inhibit-autoreconnect server)) (eglot--warn "Not auto-reconnectin= g, > last one didn't last long."))) > eglot--on-shutdown(#) > funcall(eglot--on-shutdown #= ) > (unwind-protect (mapc #'(lambda (jsonrpc-lambda-elem168) (apply > #'(lambda (_id _method _success-fn error-fn _timer) (funcall error-fn > '(:code -1 :message "Server died"))) jsonrpc-lambda-elem168)) > (jsonrpc--continuations connection)) (jsonrpc--message "Server exited wit= h > status %s" (process-exit-status proc)) (delete-process proc) (let* ((p (a= nd > t (slot-value connection '-autoport-inferior)))) (if p (delete-process p) > nil)) (funcall (jsonrpc--on-shutdown connection) connection)) > (progn (save-current-buffer (set-buffer (jsonrpc-events-buffer > connection)) (let ((inhibit-read-only t)) (insert > "\n----------b---y---e---b---y---e----------\n"))) (mapc #'(lambda > (jsonrpc-lambda-elem167) (apply #'(lambda (_id _method _success-fn > _error-fn timer) (if timer (progn (cancel-timer timer)))) > jsonrpc-lambda-elem167)) (jsonrpc--continuations connection)) (maphash > #'(lambda (_ triplet) (progn (ignore (consp triplet)) (let* ((x919 > (cdr-safe triplet))) (progn (ignore (consp x919)) (let* ((x920 (car-safe > x919)) (x921 (cdr-safe x919))) (progn (ignore (consp x921)) (let* ((x923 > (cdr-safe x921))) (progn (ignore (null x923)) (let ((timer x920)) (if tim= er > (progn (cancel-timer timer)))))))))))) (jsonrpc--deferred-actions > connection)) (process-put proc 'jsonrpc-sentinel-cleanup-started t) > (unwind-protect (mapc #'(lambda (jsonrpc-lambda-elem168) (apply #'(lambda > (_id _method _success-fn error-fn _timer) (funcall error-fn '(:code -1 > :message "Server died"))) jsonrpc-lambda-elem168)) (jsonrpc--continuation= s > connection)) (jsonrpc--message "Server exited with status %s" > (process-exit-status proc)) (delete-process proc) (let* ((p (and t > (slot-value connection '-autoport-inferior)))) (if p (delete-process p) > nil)) (funcall (jsonrpc--on-shutdown connection) connection))) > (if (not (process-live-p proc)) (progn (save-current-buffer (set-buffer > (jsonrpc-events-buffer connection)) (let ((inhibit-read-only t)) (insert > "\n----------b---y---e---b---y---e----------\n"))) (mapc #'(lambda > (jsonrpc-lambda-elem167) (apply #'(lambda (_id _method _success-fn > _error-fn timer) (if timer (progn (cancel-timer timer)))) > jsonrpc-lambda-elem167)) (jsonrpc--continuations connection)) (maphash > #'(lambda (_ triplet) (progn (ignore (consp triplet)) (let* ((x919 > (cdr-safe triplet))) (progn (ignore (consp x919)) (let* ((x920 (car-safe > x919)) (x921 (cdr-safe x919))) (progn (ignore (consp x921)) (let* ((x923 > (cdr-safe x921))) (progn (ignore (null x923)) (let ((timer x920)) (if tim= er > (progn ...))))))))))) (jsonrpc--deferred-actions connection)) (process-pu= t > proc 'jsonrpc-sentinel-cleanup-started t) (unwind-protect (mapc #'(lambda > (jsonrpc-lambda-elem168) (apply #'(lambda (_id _method _success-fn error-= fn > _timer) (funcall error-fn '(:code -1 :message "Server died"))) > jsonrpc-lambda-elem168)) (jsonrpc--continuations connection)) > (jsonrpc--message "Server exited with status %s" (process-exit-status > proc)) (delete-process proc) (let* ((p (and t (slot-value connection > '-autoport-inferior)))) (if p (delete-process p) nil)) (funcall > (jsonrpc--on-shutdown connection) connection)))) > (let ((connection (process-get proc 'jsonrpc-connection))) > (jsonrpc--debug connection "Connection state change: `%s'" change) (if (n= ot > (process-live-p proc)) (progn (save-current-buffer (set-buffer > (jsonrpc-events-buffer connection)) (let ((inhibit-read-only t)) (insert > "\n----------b---y---e---b---y---e----------\n"))) (mapc #'(lambda > (jsonrpc-lambda-elem167) (apply #'(lambda (_id _method _success-fn > _error-fn timer) (if timer (progn (cancel-timer timer)))) > jsonrpc-lambda-elem167)) (jsonrpc--continuations connection)) (maphash > #'(lambda (_ triplet) (progn (ignore (consp triplet)) (let* ((x919 > (cdr-safe triplet))) (progn (ignore (consp x919)) (let* ((x920 (car-safe > x919)) (x921 (cdr-safe x919))) (progn (ignore (consp x921)) (let* ((x923 > (cdr-safe x921))) (progn (ignore (null x923)) (let (...) (if timer > ...)))))))))) (jsonrpc--deferred-actions connection)) (process-put proc > 'jsonrpc-sentinel-cleanup-started t) (unwind-protect (mapc #'(lambda > (jsonrpc-lambda-elem168) (apply #'(lambda (_id _method _success-fn error-= fn > _timer) (funcall error-fn '(:code -1 :message "Server died"))) > jsonrpc-lambda-elem168)) (jsonrpc--continuations connection)) > (jsonrpc--message "Server exited with status %s" (process-exit-status > proc)) (delete-process proc) (let* ((p (and t (slot-value connection > '-autoport-inferior)))) (if p (delete-process p) nil)) (funcall > (jsonrpc--on-shutdown connection) connection))))) > jsonrpc--process-sentinel(# (dune-add-disable-file-watcher-rpc/(tuareg-mode))> "exited abnormally wit= h > code 1\n") > --0000000000003a3d18062774becc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
So, the error is explanatory, no??=C2=A0= As far as I can tell your original=C2=A0
patch also= signalled an error, and that error happened in the sentinel.

If you want to avoid this error and s= ilently proceed, for the benefit
of your particular = workflow, write a project backend=C2=A0 that keeps its=C2=A0
vital information despite having lost its file system backing.

Or, maybe better, write some advice to = eglot-autoreconnect which=C2=A0
is an external function (and thus= offers some stability guarantee of=C2=A0
its interface).=C2=A0 e= glot-reconnect takes the server as argument and=C2=A0
you can que= ry the project to know if its still valid or not and noop
in the = case it's been deleted from the filesystem.=C2=A0 But this is too=C2=A0=
specific to generalize in Eglot.=C2=A0 I for one like to be warn= ed of these
error, because for me having a connected-to project s= uddenly
deleted in an exception, it's not the rule.

Jo=C3=A3o



On Thu, Nov 21= , 2024, 20:51 Spencer Baugh <sbaugh@janestreet.com> wrote:
Jo=C3=A3o T=C3=A1vora <joaotavora= @gmail.com> writes:

> Explain your scenario, please.=C2=A0 And note that if you take the rug= from
> underneath Eglot it will error, period.=C2=A0 That's by design.=C2= =A0 =C2=A0I'm not
> willing to contort the code to do=C2=A0 anything more than provide a > more or less understandable error message for such (relatively rare) > rug pulling.=C2=A0 IOW sentinels erroring is part of Emacs life and no= t a
> bug in itself,=C2=A0 it's the error message that I'm willing t= o help ensure is
> clear.

I use (the equivalent of) git worktrees to have one repo checkout per
branch that I'm working on.=C2=A0 As I finish work on a branch, I delet= e the
worktree with a shell command outside of Emacs.=C2=A0 Thus I hit this error=
several times a day, depending on how productive I am.

(The same workflow is used by ~everyone at my employer, and before we
can use Eglot widely, it would be ideal to get rid of this frequent
error)

> Please provide a backtrace and say if it's obtained with the very<= br> > same recipe in the beginning of the bug report.
>

Sure, here's the backtrace with the patch in your last email.=C2=A0 It = is
obtained with the very same recipe in the beginning of the bug report: I opened an (OCaml) file, did M-x eglot (starting ocaml-lsp), deleted the
directory, and it proceeded as I said in the beginning of the bug
report.

Debugger entered--Lisp error: (error "[eglot] Project at `/usr/local/h= ome/sbaugh/workspaces/fe-880764/+share+/' is gone!")
=C2=A0 signal(error ("[eglot] Project at `/usr/local/home/sbaugh/works= paces/fe-880764/+share+/' is gone!"))
=C2=A0 error("[eglot] %s" "Project at `/usr/local/home/sbaug= h/workspaces/fe-880764/+share+/' is gone!")
=C2=A0 eglot--error("Project at `%s' is gone!" "/usr/loc= al/home/sbaugh/workspaces/fe-880764/+share+/")
=C2=A0 (if (file-exists-p default-directory) (project-name project) (eglot-= -error "Project at `%s' is gone!" default-directory))
=C2=A0 (let* ((default-directory (project-root project)) (nickname (if (fil= e-exists-p default-directory) (project-name project) (eglot--error "Pr= oject at `%s' is gone!" default-directory))) (readable-name (forma= t "EGLOT (%s/%s)" nickname managed-modes)) server-info (contact (= if (functionp contact) (funcall contact) contact)) (initargs (cond ((keywor= dp (car contact)) contact) ((integerp (car (cdr contact))) (setq server-inf= o (list (format "%s:%s" ... ...))) (list ':process #'(lam= bda nil ...))) ((and (stringp (car contact)) (cl-find-if #'... contact)= ) (setq server-info (list "<inferior process>")) (list '= ;:process (jsonrpc-autoport-bootstrap readable-name contact :connect-args &= #39;...))) ((stringp (car contact)) (let* ((probe ...) (more-initargs ...) = (contact ...)) (cons ':process (cons ... more-initargs)))))) (spread #&= #39;(lambda (fn) #'(lambda (server method params) (let ... ...)))) (ser= ver (apply #'make-instance class :name readable-name :events-buffer-con= fig eglot-events-buffer-config :notification-dispatcher (funcall spread #&#= 39;eglot-handle-notification) :request-dispatcher (funcall spread #'egl= ot-handle-request) :on-shutdown #'eglot--on-shutdown initargs)) (cancel= ed nil) (tag (make-symbol "connected-catch-tag"))) (if server-inf= o (progn (jsonrpc--debug server "Running language server: %s" (st= ring-join server-info " ")))) (let* ((v server)) (\(setf\ eglot--= saved-initargs\) initargs v)) (let* ((v server)) (\(setf\ eglot--project\) = project v)) (let* ((v server)) (\(setf\ eglot--project-nickname\) nickname = v)) (let* ((v server)) (\(setf\ eglot--languages\) (let* ((--cl-var-- manag= ed-modes) (m nil) (--cl-var-- language-ids) (l nil) (--cl-var-- nil)) (whil= e (and (consp --cl-var--) (progn (setq m ...) (consp --cl-var--))) (setq l = (car --cl-var--)) (setq --cl-var-- (cons (cons m l) --cl-var--)) (setq --cl= -var-- (cdr --cl-var--)) (setq --cl-var-- (cdr --cl-var--))) (nreverse --cl= -var--)) v)) (run-hook-with-args 'eglot-server-initialized-hook server)= (unwind-protect (condition-case _quit (let ((retval (catch tag (jsonrpc-as= ync-request server :initialize ... :success-fn ... :timeout eglot-connect-t= imeout :error-fn ... :timeout-fn ...) (cond ... ...)))) (cond ((consp retva= l) (let* (...) (if ... ... ...))) ((null retval) (let nil (eglot--message &= quot;Waiting in background for server `%s'" ...) nil)) (t (let nil= server)))) (quit (jsonrpc-shutdown server) (setq canceled 'quit))) (se= tq tag nil)))
=C2=A0 eglot--connect((tuareg-mode) #s(jane-fe-project :workspace "/us= r/local/home/sbaugh/workspaces/fe-880764/+share+/" :vc (vc Hg "/u= sr/local/home/sbaugh/workspaces/fe-880764/+share+/")) eglot-lsp-server= (:process (closure ((contact "dispatch_ocaml_lsp.exe" "open= ! Core" "dev") (server-info "dispatch_ocaml_lsp.exe&quo= t; "open! Core" "dev") (readable-name . "EGLOT (du= ne-add-disable-file-watcher-rpc/(tuareg-mode))") tramp-ssh-controlmast= er-options tramp-use-ssh-controlmaster-options) nil (let ((default-director= y default-directory) (tramp-use-ssh-controlmaster-options 'suppress) (t= ramp-ssh-controlmaster-options "-o ControlMaster=3Dno -o ControlPath= =3Dnone")) (make-process :name readable-name :command (setq server-inf= o (eglot--cmd contact)) :connection-type 'pipe :coding 'utf-8-emacs= -unix :noquery t :stderr (get-buffer-create (format "*%s stderr*"= readable-name)) :file-handler t)))) ("tuareg"))
=C2=A0 eglot-reconnect(#<eglot-lsp-server eglot-lsp-server-18f8056>)<= br> =C2=A0 (cond ((eglot--shutdown-requested server) t) ((not (eglot--inhibit-a= utoreconnect server)) (eglot--warn "Reconnecting after unexpected serv= er exit.") (eglot-reconnect server)) ((timerp (eglot--inhibit-autoreco= nnect server)) (eglot--warn "Not auto-reconnecting, last one didn'= t last long.")))
=C2=A0 eglot--on-shutdown(#<eglot-lsp-server eglot-lsp-server-18f8056>= ;)
=C2=A0 funcall(eglot--on-shutdown #<eglot-lsp-server eglot-lsp-server-18= f8056>)
=C2=A0 (unwind-protect (mapc #'(lambda (jsonrpc-lambda-elem168) (apply = #'(lambda (_id _method _success-fn error-fn _timer) (funcall error-fn &= #39;(:code -1 :message "Server died"))) jsonrpc-lambda-elem168)) = (jsonrpc--continuations connection)) (jsonrpc--message "Server exited = with status %s" (process-exit-status proc)) (delete-process proc) (let= * ((p (and t (slot-value connection '-autoport-inferior)))) (if p (dele= te-process p) nil)) (funcall (jsonrpc--on-shutdown connection) connection))=
=C2=A0 (progn (save-current-buffer (set-buffer (jsonrpc-events-buffer conne= ction)) (let ((inhibit-read-only t)) (insert "\n----------b---y---e---= b---y---e----------\n"))) (mapc #'(lambda (jsonrpc-lambda-elem167)= (apply #'(lambda (_id _method _success-fn _error-fn timer) (if timer (= progn (cancel-timer timer)))) jsonrpc-lambda-elem167)) (jsonrpc--continuati= ons connection)) (maphash #'(lambda (_ triplet) (progn (ignore (consp t= riplet)) (let* ((x919 (cdr-safe triplet))) (progn (ignore (consp x919)) (le= t* ((x920 (car-safe x919)) (x921 (cdr-safe x919))) (progn (ignore (consp x9= 21)) (let* ((x923 (cdr-safe x921))) (progn (ignore (null x923)) (let ((time= r x920)) (if timer (progn (cancel-timer timer)))))))))))) (jsonrpc--deferre= d-actions connection)) (process-put proc 'jsonrpc-sentinel-cleanup-star= ted t) (unwind-protect (mapc #'(lambda (jsonrpc-lambda-elem168) (apply = #'(lambda (_id _method _success-fn error-fn _timer) (funcall error-fn &= #39;(:code -1 :message "Server died"))) jsonrpc-lambda-elem168)) = (jsonrpc--continuations connection)) (jsonrpc--message "Server exited = with status %s" (process-exit-status proc)) (delete-process proc) (let= * ((p (and t (slot-value connection '-autoport-inferior)))) (if p (dele= te-process p) nil)) (funcall (jsonrpc--on-shutdown connection) connection))= )
=C2=A0 (if (not (process-live-p proc)) (progn (save-current-buffer (set-buf= fer (jsonrpc-events-buffer connection)) (let ((inhibit-read-only t)) (inser= t "\n----------b---y---e---b---y---e----------\n"))) (mapc #'= (lambda (jsonrpc-lambda-elem167) (apply #'(lambda (_id _method _success= -fn _error-fn timer) (if timer (progn (cancel-timer timer)))) jsonrpc-lambd= a-elem167)) (jsonrpc--continuations connection)) (maphash #'(lambda (_ = triplet) (progn (ignore (consp triplet)) (let* ((x919 (cdr-safe triplet))) = (progn (ignore (consp x919)) (let* ((x920 (car-safe x919)) (x921 (cdr-safe = x919))) (progn (ignore (consp x921)) (let* ((x923 (cdr-safe x921))) (progn = (ignore (null x923)) (let ((timer x920)) (if timer (progn ...))))))))))) (j= sonrpc--deferred-actions connection)) (process-put proc 'jsonrpc-sentin= el-cleanup-started t) (unwind-protect (mapc #'(lambda (jsonrpc-lambda-e= lem168) (apply #'(lambda (_id _method _success-fn error-fn _timer) (fun= call error-fn '(:code -1 :message "Server died"))) jsonrpc-la= mbda-elem168)) (jsonrpc--continuations connection)) (jsonrpc--message "= ;Server exited with status %s" (process-exit-status proc)) (delete-pro= cess proc) (let* ((p (and t (slot-value connection '-autoport-inferior)= ))) (if p (delete-process p) nil)) (funcall (jsonrpc--on-shutdown connectio= n) connection))))
=C2=A0 (let ((connection (process-get proc 'jsonrpc-connection))) (json= rpc--debug connection "Connection state change: `%s'" change)= (if (not (process-live-p proc)) (progn (save-current-buffer (set-buffer (j= sonrpc-events-buffer connection)) (let ((inhibit-read-only t)) (insert &quo= t;\n----------b---y---e---b---y---e----------\n"))) (mapc #'(lambd= a (jsonrpc-lambda-elem167) (apply #'(lambda (_id _method _success-fn _e= rror-fn timer) (if timer (progn (cancel-timer timer)))) jsonrpc-lambda-elem= 167)) (jsonrpc--continuations connection)) (maphash #'(lambda (_ triple= t) (progn (ignore (consp triplet)) (let* ((x919 (cdr-safe triplet))) (progn= (ignore (consp x919)) (let* ((x920 (car-safe x919)) (x921 (cdr-safe x919))= ) (progn (ignore (consp x921)) (let* ((x923 (cdr-safe x921))) (progn (ignor= e (null x923)) (let (...) (if timer ...)))))))))) (jsonrpc--deferred-action= s connection)) (process-put proc 'jsonrpc-sentinel-cleanup-started t) (= unwind-protect (mapc #'(lambda (jsonrpc-lambda-elem168) (apply #'(l= ambda (_id _method _success-fn error-fn _timer) (funcall error-fn '(:co= de -1 :message "Server died"))) jsonrpc-lambda-elem168)) (jsonrpc= --continuations connection)) (jsonrpc--message "Server exited with sta= tus %s" (process-exit-status proc)) (delete-process proc) (let* ((p (a= nd t (slot-value connection '-autoport-inferior)))) (if p (delete-proce= ss p) nil)) (funcall (jsonrpc--on-shutdown connection) connection)))))
=C2=A0 jsonrpc--process-sentinel(#<process EGLOT (dune-add-disable-file-= watcher-rpc/(tuareg-mode))> "exited abnormally with code 1\n")=
--0000000000003a3d18062774becc--