From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#58839: [Patch] Re: bug#58839: 29.0.50; project-kill-buffer fails when Eglot is running Date: Fri, 28 Oct 2022 18:36:48 +0100 Message-ID: References: <87sfj8umwb.fsf@posteo.net> <87edur3lil.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000003cc74405ec1bb08d" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34917"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Manuel Uberti , 58839@debbugs.gnu.org, Dmitry Gutov To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 28 19:37:11 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ooTI6-0008qO-NO for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Oct 2022 19:37:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooTHq-0007g6-V7; Fri, 28 Oct 2022 13:36:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooTH0-0007OQ-Qh for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 13:36:22 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ooTH0-000480-IH for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 13:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ooTH0-0007mF-8B for bug-gnu-emacs@gnu.org; Fri, 28 Oct 2022 13:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Oct 2022 17:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58839 X-GNU-PR-Package: emacs Original-Received: via spool by 58839-submit@debbugs.gnu.org id=B58839.166697855629884 (code B ref 58839); Fri, 28 Oct 2022 17:36:02 +0000 Original-Received: (at 58839) by debbugs.gnu.org; 28 Oct 2022 17:35:56 +0000 Original-Received: from localhost ([127.0.0.1]:34206 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooTGu-0007lv-7e for submit@debbugs.gnu.org; Fri, 28 Oct 2022 13:35:56 -0400 Original-Received: from mail-oa1-f42.google.com ([209.85.160.42]:34733) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooTGs-0007lh-BO for 58839@debbugs.gnu.org; Fri, 28 Oct 2022 13:35:54 -0400 Original-Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-13ba86b5ac0so7082869fac.1 for <58839@debbugs.gnu.org>; Fri, 28 Oct 2022 10:35:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=feoRXod2uxVIgJD8Xr8N0mIda1WYvWiIoq7xhULSrxk=; b=Y0miWxW8LgurcD8Aw15lTERHdZJ4sfSpJ47bn+lUTGIvOSklTX0V6oSFm/8i+l1gjz odQ4hfhtWARLx3XdqzPy+vfhjxAypprQPCTedeW0pfpCRhx2hqkkbGOVcfQFMBLdXzge uK8meA0CAU7MlWigfjXK64zW9OwoNUezgUz0L30MahJSVPhkRIFUO/FOuMQejpaxPpVW dZ9U2Xao0Ap7rC8qYgBEgyskMEFK34vMuF5S0/a0/s4RXodE/4mRiMIga8QLVgM7tTIZ y2CSNa+lUoSmc64sa5PItOC5nLx4rrzWBG5TAzPV2VjHe4u+wSmih4X3w0hdQplJPUxo xnsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=feoRXod2uxVIgJD8Xr8N0mIda1WYvWiIoq7xhULSrxk=; b=K8mcuZX6j5u/6Kx4Ipag+4l2jeQkkqxG5lKqXGqCjYcSkM0jsD13TgszQrY0Io5TCu scVjBD+8QUrsjuDXxPBlcvzxtb/DIlwp+ekiS0eH/FzovT6LArmVkRlLU7ziaY99H9sd nIzwgsBV5IaKP3dmBhAVAGysJKuGslBgF5b6c0vHEZmS0DtSslUU80UglnuyQOIqS0Fp 1ZPXAJT/CfdAVA/lcZwOCuYbJBD78NzaZ51EvQoF8Q9ZUc7O26gIWUdH0piZapkP/EhA IpThkRGWRhY0pYav1h6PikQJ8NVFyqgqFQFLD4JKLpoH6yDMO1a6YtmFWJelPyztgCq1 gtpQ== X-Gm-Message-State: ACrzQf2CseAyT77BQrZxhr2qwKganPHY0DcE/eKgN/7P2Y/Le0nGUAZs 5edOv98imEQ1iu/qNXP6teHe9ELgdrGOKTxXn9A= X-Google-Smtp-Source: AMsMyM7HdMZb8rrqCrQbtItf0zZLzSXLM0qWhzkVnzLPDb/GiLfL71rFQdDgU7tc9CDJw1po8kiOYNH2d0uRcDzGy8w= X-Received: by 2002:a05:6870:2155:b0:13c:8db1:2446 with SMTP id g21-20020a056870215500b0013c8db12446mr1393909oae.171.1666978548597; Fri, 28 Oct 2022 10:35:48 -0700 (PDT) In-Reply-To: <87edur3lil.fsf@posteo.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "bug-gnu-emacs" Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:246440 Archived-At: --0000000000003cc74405ec1bb08d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Oct 28, 2022 at 6:28 PM Philip Kaludercic wrote: > > I still don't agree that this is the right interpretation of the issue > or solution, but wouldn't it be better to add this to > `project-kill-buffer-conditions'? > > The solution I would prefer is if project.el would define a sort of > project-kill-hook, that Eglot would modify and make sure that > `eglot-shutdown' is invoked before any buffer is killed. > I believe we have been over this. Eglot's preference eglot-autoshutdown and eglot-autoreconnect already control this behaviour. You should use those: eglot-autoshutdown does _exactly_ what you want: shut the process down (in a controlled fashion) if all manged buffers are killed. You may argue (in a separate issue) that eglot-autoshutdown's default shoul= d be t. Just like any other user preference, we can weigh the pros and cons. That buffer is Eglot's property, just like internal symbols or global data structures. Just because it's a buffer, it doesn't mean you may touch it. It is hidden because you may not. What would even be the advantage here? You can of course show a patch, but I doubt it's going to be much simpler than what I have proposed. For starters, your idea increases coupling between two packages, which is generally not good. Jo=C3=A3o --0000000000003cc74405ec1bb08d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Oct 28, 2022 at 6:28 PM Philip Kaludercic <philipk@posteo.net> wrote:

I still don't agree that this is the right interpretation of the issue<= br> or solution, but wouldn't it be better to add this to
`project-kill-buffer-conditions'?

The solution I would prefer is if project.el would define a sort of
project-kill-hook, that Eglot would modify and make sure that
`eglot-shutdown' is invoked before any buffer is killed.

I believe we have been over this.=C2= =A0 Eglot's preference eglot-autoshutdown
and eglot-autorecon= nect already control this behaviour.=C2=A0 You should use
th= ose: eglot-autoshutdown does _exactly_ what you want: shut the process
down (in a controlled fashion) if all manged buffers are killed.

You may argue (in a separate issue) that eglot-autoshu= tdown's default should
be t.=C2=A0 Just like any other user p= reference, we can weigh the pros and cons.

Tha= t buffer is Eglot's property, just like internal symbols or global data= structures.
Just because it's a buffer, it doesn't m= ean you may touch it.=C2=A0=C2=A0 It is hidden because
you m= ay not.=C2=A0 What would even be the advantage here?

You can of course show a patch, but I doubt it's going to be much si= mpler than
what I have proposed.=C2=A0 For starters, your id= ea increases coupling between
two packages, which is general= ly not good.

Jo=C3=A3o
--0000000000003cc74405ec1bb08d--