Subject: bug#58839: [Patch] Re: bug#58839: 29.0.50; project-kill-buffer fails when Eglot is running

From: João Távora <[email-masked]>
Date: Fri, 28 Oct 2022 18:36:48 +0100

On Fri, Oct 28, 2022 at 6:28 PM Philip Kaludercic <[email-masked]>
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 should
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ão