GNU bug report logs - #70958
30.0.50; eglot-managed-mode hooks not called on shutdown

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Troy Brown <brownts@HIDDEN>; merged with #70835; dated Wed, 15 May 2024 12:39:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 70958 <at> debbugs.gnu.org:


Received: (at 70958) by debbugs.gnu.org; 27 May 2024 15:52:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 27 11:52:46 2024
Received: from localhost ([127.0.0.1]:45095 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sBceU-0002bj-F2
	for submit <at> debbugs.gnu.org; Mon, 27 May 2024 11:52:46 -0400
Received: from mail-lf1-f54.google.com ([209.85.167.54]:51551)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1sBceS-0002bW-20
 for 70958 <at> debbugs.gnu.org; Mon, 27 May 2024 11:52:44 -0400
Received: by mail-lf1-f54.google.com with SMTP id
 2adb3069b0e04-5296935252dso3195987e87.3
 for <70958 <at> debbugs.gnu.org>; Mon, 27 May 2024 08:52:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1716825089; x=1717429889; 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=X9egqEh/ntPXjBCIyYFxWWe719mfuRP5QstTmJ15P5c=;
 b=cU4f4p5iOAmNNL3wsLXS1tRB+Nhny89X8OXORhjGd2kBUrXWTVRPImRXIeZepJNuac
 DiVgLXmbAMC4oLANmaugr1nk7Fvj+8CKoPxufG2Yf+Jz+sahdoWGa6xzH7JB8iPO1uWk
 eKDymBr9sc+m7soFWkbcckTPoxG2OW0EQM7HPAjmiEh7gi3+ySf25TJkV3wCX5LzZecZ
 gZGF8vIroq9dmD1gFBCZUuOcSbTtypsII5zv2z/81SvH4TwvEOAIGG/Fb8SDb/gpUY5S
 hh4oolJ4pu70uuswrokE5WFKfTlgQXfN1I2CJgWg8z0nVkEEWeRaCxpGGmtRkMxc83V0
 bLxw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1716825089; x=1717429889;
 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=X9egqEh/ntPXjBCIyYFxWWe719mfuRP5QstTmJ15P5c=;
 b=Jz1Qbd3DyHxcztlJatFNjPx0HihSggBmLHw66SvXOfOPzyAVxtQvh7s/6Y1pURGHO1
 M6i5xQPaBIq6drzLhGK2VAUNO6b1YRHaBpwRdhIwpJlBFiuDoCmggRqAsp8KEwBy/9QT
 ZCD4jByCsG6TXl8fuFdIDwPGr9NpDQ76DIgkubgHA4ZZ4Fha/K8/aUS9zxOLtE6sYIzE
 9Qi3MimrZDfqWgDtU8+IlYgAl2YV4z052uqIYIWX/6QIX3gmbvwho5h3SPmAFmWKDHtd
 FfPjpSXXha1hkvRu69xQicm78F8tlXfrEJkWmf4F3krnA5xNmT1XUQau1daAwILFlrjU
 8RvQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCUMbH/mhVwpabaiMr3vX4uV4/KSzuAXxBMvQ0vA2+AMw618SwB3kyTZi9c32wZxbzjW3P4N0NtD9FjsOe1Z2VVhW1XRHMg=
X-Gm-Message-State: AOJu0YyeHMF5Ol6isSMqt9xhYud62rkyAKxolTJkCx0+jHlgNVCsFHGk
 cyUuGHTulcI6EsRZ2LuLlJ/447isWZBRYBZ6fbpH3peTg9L76kWUa+Oat23zFgDii4jCXN8lHcQ
 yOJZS9D4098AKPad/POsWpNjXAMWRrw==
X-Google-Smtp-Source: AGHT+IELKX4sGK9/sRTX0Q7zt8UWGrhbYag/zdTmunDBsCM0vchWJGC3ucHdilB81fD2DrBbL6nlMcmvSuh8wnKYSYY=
X-Received: by 2002:a05:6512:3246:b0:523:963b:3a1a with SMTP id
 2adb3069b0e04-52964ea972bmr5566597e87.17.1716825089084; Mon, 27 May 2024
 08:51:29 -0700 (PDT)
MIME-Version: 1.0
References: <CABvCZ43amZyUFGW-q3kU1+XGA0CV5xkvUYrGKrhGKxS6OWQ+kw@HIDDEN>
 <86y17yz5sr.fsf@HIDDEN>
 <CALDnm52bQJGKe-Bv8DzJTqpjf5LxVOPSmQzGRqc_Gx2kU1g0QQ@HIDDEN>
 <CABvCZ43GkHMi8kWAy5qRdnF=YdH3V-iDiwVXnLT3_ex8iCcRMg@HIDDEN>
 <CALDnm53H+vqVwNttxTV2fKe_A3vrxTJ9ZmRpK3q1UyPvKn=2Mw@HIDDEN>
 <CABvCZ41ZOPW4nHHjHnv6uBGOdq_4+pGcXrVNbRvF0ifRQDfJtQ@HIDDEN>
 <CALDnm50u2r5y_k3j8i-cmEJT=BHJ8-33sUuiKh2-WCmr6Or6ug@HIDDEN>
 <CABvCZ43N7s-Kka2Z7i6X+bySy-XuxAir7cVn8vXURUhVMS9brg@HIDDEN>
 <CALDnm53f1nxwBum+EcTxJQC+Qd27OYV1iZCVwnchSuvjj6jQEg@HIDDEN>
In-Reply-To: <CALDnm53f1nxwBum+EcTxJQC+Qd27OYV1iZCVwnchSuvjj6jQEg@HIDDEN>
From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Date: Mon, 27 May 2024 16:51:17 +0100
Message-ID: <CALDnm53w-5_VOLgJ7Q4uqmo3ok-tcPBaseCPyV=uWqFt15qVTA@HIDDEN>
Subject: Re: bug#70958: 30.0.50;
 eglot-managed-mode hooks not called on shutdown
To: Troy Brown <brownts@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70958
Cc: 70958 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Felician Nemeth <felician.nemeth@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

By the way Troy, can you show your indent-region-function based
on eglot-format? I once tried this and it didn't work very well.  With the
clangd server.  Would like to see your attempt.

Jo=C3=A3o

On Mon, May 27, 2024 at 4:45=E2=80=AFPM Jo=C3=A3o T=C3=A1vora <joaotavora@g=
mail.com> wrote:
>
> merge 70958 70835
> thanks
>
> On Mon, May 27, 2024 at 3:32=E2=80=AFPM Troy Brown <brownts@HIDDEN=
> wrote:
> >
> > On Mon, May 27, 2024 at 10:09=E2=80=AFAM Jo=C3=A3o T=C3=A1vora <joaotav=
ora@HIDDEN> wrote:
> > >
> > > Bugs are only "legitimate" when they are harming someone somewhere.
> > > This hook has been there for a number of years, and noone has complai=
ned
> > > that I can remember. If you have a use for the on-shutdown, then it's
> > > a bug.  It'd help to know about this use case. If you don't have a us=
e,
> > > it's just a doc bug, and patches welcome.
>
> Actually I was wrong.  I have been recently warned of this exact
> same issue.  I thought you and that person were the same.
> bug#70835, which this bug is a duplicate of (so I've merged them,
> hopefully)
>
> > The use case is that I was experimenting with updating the
> > buffer-local indent-region-function (and indirectly
> > indent-line-function) to be based on eglot-format when the buffer was
> > connected to the language server.  I was attempting to use the
> > eglot-managed-mode-hook so I could update these variables when the
> > Eglot buffer management changed.  Since the hook wasn't being called
> > on shutdown it would still attempt to call eglot-format when it was no
> > longer managing the buffer.  The workaround was to use a mode-specific
> > function for indent-region-function and then having that call
> > eglot-managed-p to determine if it should call eglot-format or
> > something else (e.g., indent-relative).
>
> Anyway, to your use case.  The "off" hook would solve your problem,
> but not as well as your solution.  When setting variables, there's
> no clean solution to the "undo problem", unless the variable in
> question is a hook.  Think:
>
>  var is originally X
>  activate minor mode foo, saves var value of X, sets to Y,
>  activate minor mode bar, that also sets var, saves Y, sets to Z
>  deactivate foo, sets var to X
>  deactivate bar, sets var to Y
>  now both modes are inactive, variable is set to Y, in error
>
> When the variable being affected is a hook with certain rules, this
> problem doesn't exist.
>
> Anyway, it's not a problem for Eglot to solve.  So given there is
> also bug#70835 requesting the same, I think we can risk just running
> eglot-managed-mode-hook like so let's try this patch:
>
> diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
> index 6896baf30ce..2fab9e7f38b 100644
> --- a/lisp/progmodes/eglot.el
> +++ b/lisp/progmodes/eglot.el
> @@ -2059,6 +2059,7 @@ eglot--managed-mode
>      (when eglot--current-flymake-report-fn
>        (eglot--report-to-flymake nil)
>        (setq eglot--current-flymake-report-fn nil))
> +    (run-hooks 'eglot-managed-mode-hook)
>      (let ((server eglot--cached-server))
>        (setq eglot--cached-server nil)
>        (when server
>
> There will possibly be people complaining we broke their configs,
> so this might not be the end of the story. But it's reasonable to try it
> since this is how  the documentation says it _should_ work and is
> consistent with the normal minor-mode hooks.
>
> Jo=C3=A3o



--=20
Jo=C3=A3o T=C3=A1vora




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70958; Package emacs. Full text available.
Merged 70835 70958. Request was from João Távora <joaotavora@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 70958 <at> debbugs.gnu.org:


Received: (at 70958) by debbugs.gnu.org; 27 May 2024 15:46:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 27 11:46:31 2024
Received: from localhost ([127.0.0.1]:45084 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sBcYR-0002SK-57
	for submit <at> debbugs.gnu.org; Mon, 27 May 2024 11:46:31 -0400
Received: from mail-lf1-f53.google.com ([209.85.167.53]:51296)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>)
 id 1sBcYO-0002Rv-DZ; Mon, 27 May 2024 11:46:29 -0400
Received: by mail-lf1-f53.google.com with SMTP id
 2adb3069b0e04-529661f2552so3236157e87.2; 
 Mon, 27 May 2024 08:46:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1716824713; x=1717429513; 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=8r1lueHInvT70nhh4nDRsPMyl4wbuu2uE0BgEac+v1U=;
 b=LmuW46ivKSMnOunGAFaxIG4V4ZadX2y2aOhqVMBP2XEgtmUqT8g+koZQ87Jxo4Y4so
 GOR3NT9eTVxqpZsFfo91LruomiWLcahvUvt73juY2CTk9K71jDOnSLLnKmO+MJS6lUYP
 JiCG8JYT+gKyRQdwqNERrzds/JVpVj8Mib7rCBT+V6uugAjHDVISBEi839p+hat5vgbg
 K4khJ4gFbLtXYVDOxZ5fjzAK9MKOiqQQDy6Ia12MDWNfgeL6GgS9sKYuKPcIrAZNTGTp
 /NkcMHctqkVrsHf2mz9ZNlhGzF4EGjLTvjLqzl23jhKurXxw7LHD7yJora9i9PJXJWH0
 JyfQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1716824713; x=1717429513;
 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=8r1lueHInvT70nhh4nDRsPMyl4wbuu2uE0BgEac+v1U=;
 b=nKaH1Jb0QtWR3H526c0d1Q/KfzthSrxnGouMeWtYE5wRdiY5bwVL9QfYSUXOOTLOdP
 64cFRaNVwSWeI3EeaxZTqUNLbXhNQSwgCg1IFUJ5x2/RwtMQDH9ec6c1zeW3CO9E4xzV
 GVm0GoUFPKhN2PBBCcllAcOB9kryyzf8eCPPoOIbiDMyONSkQhuEC9jGjtWF1ik7oUxw
 4+PXOxiakTCboI35cznIhDNptTEjalqQYAcdjUn36yZwTJA8raVUFLRTV1dZ+zQeW+UO
 b63Kn7XfI7bq/VVXWeYgxr25Lt6hIqACZ7e7B85hiyFXbt9IYXhkH7Gk4+LKFvIGtleI
 sE2A==
X-Forwarded-Encrypted: i=1;
 AJvYcCXczykO6gjeZ9Yy3qC5BfH3eUbB/pLLbuWnQ3YrZZ1MBoAQ2bzOyrj2PY3J0SMWguMeckPt4g0SJ9v/5ZUwc0xCMaslRw4yJqjdqLQvX50+wWv0mSEHLWOx/+gOZF6G
X-Gm-Message-State: AOJu0YyX5QmjnYdPIaxReBJe9vpAltXJ69+60yfiQCdla8B4UIgs00bH
 p5DFjmr98iiq0VfDaTxHCm+HHa/TH4KtavOmUbWqQKzXnqbaDbdQsnMQ8mQnMGX+sNTcxou1zKk
 4whn/8TgBISI9hmW2CPs/A8uG5rI=
X-Google-Smtp-Source: AGHT+IEEIkfmPvi5wMLrm2mR5DhMq0kU77a8RmtHvcS9ymiDeihDOCJJuyvF6oP4G4mlqA+pa/JmNbF2ox6uwpsOuA8=
X-Received: by 2002:a05:6512:1112:b0:520:98ff:5554 with SMTP id
 2adb3069b0e04-5296547aa0amr8107946e87.30.1716824713249; Mon, 27 May 2024
 08:45:13 -0700 (PDT)
MIME-Version: 1.0
References: <CABvCZ43amZyUFGW-q3kU1+XGA0CV5xkvUYrGKrhGKxS6OWQ+kw@HIDDEN>
 <86y17yz5sr.fsf@HIDDEN>
 <CALDnm52bQJGKe-Bv8DzJTqpjf5LxVOPSmQzGRqc_Gx2kU1g0QQ@HIDDEN>
 <CABvCZ43GkHMi8kWAy5qRdnF=YdH3V-iDiwVXnLT3_ex8iCcRMg@HIDDEN>
 <CALDnm53H+vqVwNttxTV2fKe_A3vrxTJ9ZmRpK3q1UyPvKn=2Mw@HIDDEN>
 <CABvCZ41ZOPW4nHHjHnv6uBGOdq_4+pGcXrVNbRvF0ifRQDfJtQ@HIDDEN>
 <CALDnm50u2r5y_k3j8i-cmEJT=BHJ8-33sUuiKh2-WCmr6Or6ug@HIDDEN>
 <CABvCZ43N7s-Kka2Z7i6X+bySy-XuxAir7cVn8vXURUhVMS9brg@HIDDEN>
In-Reply-To: <CABvCZ43N7s-Kka2Z7i6X+bySy-XuxAir7cVn8vXURUhVMS9brg@HIDDEN>
From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Date: Mon, 27 May 2024 16:45:01 +0100
Message-ID: <CALDnm53f1nxwBum+EcTxJQC+Qd27OYV1iZCVwnchSuvjj6jQEg@HIDDEN>
Subject: Re: bug#70958: 30.0.50;
 eglot-managed-mode hooks not called on shutdown
To: Troy Brown <brownts@HIDDEN>, 
 GNU bug tracker automated control server <control <at> debbugs.gnu.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70958
Cc: 70958 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Felician Nemeth <felician.nemeth@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

merge 70958 70835
thanks

On Mon, May 27, 2024 at 3:32=E2=80=AFPM Troy Brown <brownts@HIDDEN> =
wrote:
>
> On Mon, May 27, 2024 at 10:09=E2=80=AFAM Jo=C3=A3o T=C3=A1vora <joaotavor=
a@HIDDEN> wrote:
> >
> > Bugs are only "legitimate" when they are harming someone somewhere.
> > This hook has been there for a number of years, and noone has complaine=
d
> > that I can remember. If you have a use for the on-shutdown, then it's
> > a bug.  It'd help to know about this use case. If you don't have a use,
> > it's just a doc bug, and patches welcome.

Actually I was wrong.  I have been recently warned of this exact
same issue.  I thought you and that person were the same.
bug#70835, which this bug is a duplicate of (so I've merged them,
hopefully)

> The use case is that I was experimenting with updating the
> buffer-local indent-region-function (and indirectly
> indent-line-function) to be based on eglot-format when the buffer was
> connected to the language server.  I was attempting to use the
> eglot-managed-mode-hook so I could update these variables when the
> Eglot buffer management changed.  Since the hook wasn't being called
> on shutdown it would still attempt to call eglot-format when it was no
> longer managing the buffer.  The workaround was to use a mode-specific
> function for indent-region-function and then having that call
> eglot-managed-p to determine if it should call eglot-format or
> something else (e.g., indent-relative).

Anyway, to your use case.  The "off" hook would solve your problem,
but not as well as your solution.  When setting variables, there's
no clean solution to the "undo problem", unless the variable in
question is a hook.  Think:

 var is originally X
 activate minor mode foo, saves var value of X, sets to Y,
 activate minor mode bar, that also sets var, saves Y, sets to Z
 deactivate foo, sets var to X
 deactivate bar, sets var to Y
 now both modes are inactive, variable is set to Y, in error

When the variable being affected is a hook with certain rules, this
problem doesn't exist.

Anyway, it's not a problem for Eglot to solve.  So given there is
also bug#70835 requesting the same, I think we can risk just running
eglot-managed-mode-hook like so let's try this patch:

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 6896baf30ce..2fab9e7f38b 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -2059,6 +2059,7 @@ eglot--managed-mode
     (when eglot--current-flymake-report-fn
       (eglot--report-to-flymake nil)
       (setq eglot--current-flymake-report-fn nil))
+    (run-hooks 'eglot-managed-mode-hook)
     (let ((server eglot--cached-server))
       (setq eglot--cached-server nil)
       (when server

There will possibly be people complaining we broke their configs,
so this might not be the end of the story. But it's reasonable to try it
since this is how  the documentation says it _should_ work and is
consistent with the normal minor-mode hooks.

Jo=C3=A3o




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70958; Package emacs. Full text available.

Message received at 70958 <at> debbugs.gnu.org:


Received: (at 70958) by debbugs.gnu.org; 27 May 2024 14:32:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 27 10:32:31 2024
Received: from localhost ([127.0.0.1]:45017 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sBbOp-0000Y9-GO
	for submit <at> debbugs.gnu.org; Mon, 27 May 2024 10:32:31 -0400
Received: from mail-lf1-f44.google.com ([209.85.167.44]:52389)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <troy.s.brown@HIDDEN>) id 1sBbOn-0000Xt-8n
 for 70958 <at> debbugs.gnu.org; Mon, 27 May 2024 10:32:29 -0400
Received: by mail-lf1-f44.google.com with SMTP id
 2adb3069b0e04-52388d9ca98so16958747e87.0
 for <70958 <at> debbugs.gnu.org>; Mon, 27 May 2024 07:32:20 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1716820334; x=1717425134;
 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=TuG5b7Q4bVfj73Hud3K1X+zl1HMrGOXAL3crQHIX8vo=;
 b=H+GPM5DdDutXpJm7tbDJxNrSs9xsq328BkJhSeQG01w6u/58hKjF0+PGrnck6HuAI0
 SSBB5iI9TjHFauNqB6bHeofEcNc3WXSVfWU3B2NrqxYNGy/kUMNHPUbIGU6Vqg25X+NF
 9XZLlIqoM0c7XMXGogyLX1dAUrrnkloY3om9jnxwzm2DbhFLEqfUJVFH6houSdQ1eQ+O
 IhWGV04fADAQloKoWUvyIQsI08CviBVPNjkqi9zeqslLmQmchKHjhCuO2XzJoVfOht/M
 MYx8224zWCstTo1fawMWpr2cGAX5VyfjUEgHeHSAlVkwi8JD22f1MjUN99NxFu02VDgP
 RX6A==
X-Forwarded-Encrypted: i=1;
 AJvYcCU283GjB6gf94vfWc1+U/0tfcYPFjm+XLDoYDW1KRvq6eelYN4QOvQY5Uw1kWkKErrsjWhCvQvejGvo8jv/MRrIDC0ZYhc=
X-Gm-Message-State: AOJu0YzfQQHFVcz0d9NpIhFd9LDNTMdJ9i6OXcZ91TfbBhHO5e0nuOO4
 9+8x4jgQrSQDMEKTuQGQ9sxp9vqgyC4odZKdwAAaGSQM/JhLlPYsifee0cHnG+/Nbv8b
X-Google-Smtp-Source: AGHT+IHwi/n0QlMTu6CymwlIw0RwkWaKrlrzUU8PC/N9efH63iiaRXjIyiQKDORHcOddDlb4brm5kQ==
X-Received: by 2002:ac2:5bce:0:b0:51d:9aa7:23e with SMTP id
 2adb3069b0e04-52967a26deemr6761377e87.65.1716820334050; 
 Mon, 27 May 2024 07:32:14 -0700 (PDT)
Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com.
 [209.85.167.54]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5296e885c84sm568672e87.59.2024.05.27.07.32.13
 for <70958 <at> debbugs.gnu.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 May 2024 07:32:13 -0700 (PDT)
Received: by mail-lf1-f54.google.com with SMTP id
 2adb3069b0e04-52388d9ca98so16958718e87.0
 for <70958 <at> debbugs.gnu.org>; Mon, 27 May 2024 07:32:13 -0700 (PDT)
X-Forwarded-Encrypted: i=1;
 AJvYcCVRKtNxENaQmdCGk4jzJkD96sfCK7JEO6vP9Oz8yhcXltxV8RGkQ5mOqivZsQg0eMLAU/40E0NLqfadd6ejLxO6wgdkpoU=
X-Received: by 2002:a05:6512:1251:b0:523:b068:a6d4 with SMTP id
 2adb3069b0e04-5296736b99emr9535828e87.45.1716820333175; Mon, 27 May 2024
 07:32:13 -0700 (PDT)
MIME-Version: 1.0
References: <CABvCZ43amZyUFGW-q3kU1+XGA0CV5xkvUYrGKrhGKxS6OWQ+kw@HIDDEN>
 <86y17yz5sr.fsf@HIDDEN>
 <CALDnm52bQJGKe-Bv8DzJTqpjf5LxVOPSmQzGRqc_Gx2kU1g0QQ@HIDDEN>
 <CABvCZ43GkHMi8kWAy5qRdnF=YdH3V-iDiwVXnLT3_ex8iCcRMg@HIDDEN>
 <CALDnm53H+vqVwNttxTV2fKe_A3vrxTJ9ZmRpK3q1UyPvKn=2Mw@HIDDEN>
 <CABvCZ41ZOPW4nHHjHnv6uBGOdq_4+pGcXrVNbRvF0ifRQDfJtQ@HIDDEN>
 <CALDnm50u2r5y_k3j8i-cmEJT=BHJ8-33sUuiKh2-WCmr6Or6ug@HIDDEN>
In-Reply-To: <CALDnm50u2r5y_k3j8i-cmEJT=BHJ8-33sUuiKh2-WCmr6Or6ug@HIDDEN>
From: Troy Brown <brownts@HIDDEN>
Date: Mon, 27 May 2024 10:32:01 -0400
X-Gmail-Original-Message-ID: <CABvCZ43N7s-Kka2Z7i6X+bySy-XuxAir7cVn8vXURUhVMS9brg@HIDDEN>
Message-ID: <CABvCZ43N7s-Kka2Z7i6X+bySy-XuxAir7cVn8vXURUhVMS9brg@HIDDEN>
Subject: Re: bug#70958: 30.0.50;
 eglot-managed-mode hooks not called on shutdown
To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 70958
Cc: 70958 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Felician Nemeth <felician.nemeth@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

On Mon, May 27, 2024 at 10:09=E2=80=AFAM Jo=C3=A3o T=C3=A1vora <joaotavora@=
gmail.com> wrote:
>
> Bugs are only "legitimate" when they are harming someone somewhere.
> This hook has been there for a number of years, and noone has complained
> that I can remember. If you have a use for the on-shutdown, then it's
> a bug.  It'd help to know about this use case. If you don't have a use,
> it's just a doc bug, and patches welcome.
>

The use case is that I was experimenting with updating the
buffer-local indent-region-function (and indirectly
indent-line-function) to be based on eglot-format when the buffer was
connected to the language server.  I was attempting to use the
eglot-managed-mode-hook so I could update these variables when the
Eglot buffer management changed.  Since the hook wasn't being called
on shutdown it would still attempt to call eglot-format when it was no
longer managing the buffer.  The workaround was to use a mode-specific
function for indent-region-function and then having that call
eglot-managed-p to determine if it should call eglot-format or
something else (e.g., indent-relative).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70958; Package emacs. Full text available.

Message received at 70958 <at> debbugs.gnu.org:


Received: (at 70958) by debbugs.gnu.org; 27 May 2024 14:10:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 27 10:10:54 2024
Received: from localhost ([127.0.0.1]:45007 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sBb3u-0008Sv-9n
	for submit <at> debbugs.gnu.org; Mon, 27 May 2024 10:10:54 -0400
Received: from mail-lf1-f53.google.com ([209.85.167.53]:56538)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1sBb3r-0008Si-PJ
 for 70958 <at> debbugs.gnu.org; Mon, 27 May 2024 10:10:52 -0400
Received: by mail-lf1-f53.google.com with SMTP id
 2adb3069b0e04-5295ae273c8so3491046e87.0
 for <70958 <at> debbugs.gnu.org>; Mon, 27 May 2024 07:10:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1716818977; x=1717423777; 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=lFbSgRgIaWPjAx5vY40eQc6El0ujMb4nzMEx1SBPOS0=;
 b=ULyhLEhXwoJG5UIikiWMq7TxWohHkE2IcSQ4lNNxIRm1dwOMbliIhI8P4jMqHklBr5
 MDlJIHgkDdXS4Iw0SpOiv+RrlrHJL4ESwHDZ/f0broWydjnj7fG1+J4RC7N+ZEVA73iX
 99VPKZJ9kw3DHgGrWBU17+iUl3FwyC2eWXUFgmiUdnFvwyZKOw/vBJ0GB43bUfNVbRVx
 fyQimxjgZKPJG2Tb9MA/gDReir/s2ArvO93xKZjs9SqGsboMRnycjfcFSdVrNF6Wbz7y
 PlKCzQ/5Vi5fOyuSvKeyfc1uQPa+zROGjVPFu7YD6HfxW5DtiDoYHsI4ZyTYQf+gF5sU
 ouyw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1716818977; x=1717423777;
 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=lFbSgRgIaWPjAx5vY40eQc6El0ujMb4nzMEx1SBPOS0=;
 b=uyNIXsoXycTyKbDeD75DLAhpfI9cJoEZBVGXdvWtvNi7n8qwx3/MMQF/Me5e5wIo9u
 zgzR5upQGaszgMvDoz5TFec27WJjiglrnhYTQtZ9ajfHv5Q/Fb880MSTkG++1hgF2zwI
 rL5EqjMTQoat3YXXUiop2yUGpxrCAGh6+2iAWx03USn/CIMIllWxo/ztREMAlpxwjRyi
 +7aA1ccGrSTJixkwSPbyW7Xrcegy9IZv8qf+XYxIhooNnjuR3MlE26Wn9miE2rq1cYLt
 Dkte1dm9q9NA+Zim4XnYsU3qgCiSmezfvlAzl5Jl1tV42PdTMHLXFz/Rt1cAOx8uyL0P
 /gHg==
X-Forwarded-Encrypted: i=1;
 AJvYcCVPtaFxCDhE/S8uAxinARSgjqBPhazUpgAdw9FVPOvz1/sARPaJ4swVfSkyxG6ZActIofPpJglH1EJrnWZfuV/A8aEqnrE=
X-Gm-Message-State: AOJu0Yyc9S/Smn//kZGWbjlE8LOrDvLsm5fHjPBLMNTcSflGzYs0z3OR
 dnqxbNTlEfne/eo1QYyWi/i2MYCd4rg5nwj4ilrswIoARMCIXm7kD0jBIiIB5z6YV1HNTM917/2
 JTxJRa7mFz5UCeauWqxTFAEx/ykc=
X-Google-Smtp-Source: AGHT+IHkyI9MszvAh0F+ani18UGGhF6fFfk0/t3YgCr7hb2AYYtMu97p7wc+4dtExf7gXsqir+YC8QfpOQSR14yRkOQ=
X-Received: by 2002:a19:f50f:0:b0:523:8744:54ae with SMTP id
 2adb3069b0e04-52966ab7593mr5553988e87.63.1716818976721; Mon, 27 May 2024
 07:09:36 -0700 (PDT)
MIME-Version: 1.0
References: <CABvCZ43amZyUFGW-q3kU1+XGA0CV5xkvUYrGKrhGKxS6OWQ+kw@HIDDEN>
 <86y17yz5sr.fsf@HIDDEN>
 <CALDnm52bQJGKe-Bv8DzJTqpjf5LxVOPSmQzGRqc_Gx2kU1g0QQ@HIDDEN>
 <CABvCZ43GkHMi8kWAy5qRdnF=YdH3V-iDiwVXnLT3_ex8iCcRMg@HIDDEN>
 <CALDnm53H+vqVwNttxTV2fKe_A3vrxTJ9ZmRpK3q1UyPvKn=2Mw@HIDDEN>
 <CABvCZ41ZOPW4nHHjHnv6uBGOdq_4+pGcXrVNbRvF0ifRQDfJtQ@HIDDEN>
In-Reply-To: <CABvCZ41ZOPW4nHHjHnv6uBGOdq_4+pGcXrVNbRvF0ifRQDfJtQ@HIDDEN>
From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Date: Mon, 27 May 2024 15:09:25 +0100
Message-ID: <CALDnm50u2r5y_k3j8i-cmEJT=BHJ8-33sUuiKh2-WCmr6Or6ug@HIDDEN>
Subject: Re: bug#70958: 30.0.50;
 eglot-managed-mode hooks not called on shutdown
To: Troy Brown <brownts@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70958
Cc: 70958 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Felician Nemeth <felician.nemeth@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Mon, May 27, 2024 at 1:46=E2=80=AFPM Troy Brown <brownts@HIDDEN> =
wrote:
> I did
> however think it was a legitimate bug (not just a doc bug) and

Bugs are only "legitimate" when they are harming someone somewhere.
This hook has been there for a number of years, and noone has complained
that I can remember. If you have a use for the on-shutdown, then it's
a bug.  It'd help to know about this use case. If you don't have a use,
it's just a doc bug, and patches welcome.

Jo=C3=A3o




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70958; Package emacs. Full text available.

Message received at 70958 <at> debbugs.gnu.org:


Received: (at 70958) by debbugs.gnu.org; 27 May 2024 12:46:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 27 08:46:26 2024
Received: from localhost ([127.0.0.1]:43328 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sBZk9-0005kK-QV
	for submit <at> debbugs.gnu.org; Mon, 27 May 2024 08:46:26 -0400
Received: from mail-ej1-f47.google.com ([209.85.218.47]:55643)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <troy.s.brown@HIDDEN>) id 1sBZk8-0005k7-Fx
 for 70958 <at> debbugs.gnu.org; Mon, 27 May 2024 08:46:24 -0400
Received: by mail-ej1-f47.google.com with SMTP id
 a640c23a62f3a-a6267778b3aso216735166b.3
 for <70958 <at> debbugs.gnu.org>; Mon, 27 May 2024 05:46:15 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1716813970; x=1717418770;
 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=egt6cQ5/g2oUoICxHfGT88yMyj567Anlej3vDaAiCC0=;
 b=xQUfNHee8OLNJbEF6vix3lIBFfXqM5EQ2sTpyaA0HM80K1J0046KzO+r3t6e80w9BR
 QoyGkAey3XHyfnM8BOrhTIZ8PD9DJqdmPDI4GCqTfEamU6SnpvwS0lggq6Prr5E3+Yny
 oMx9xavBN1QJvT0hwspOcon2DHf3Cao657WjNDPJX2THTxQO/sGw/ug4E28MpbuKHHxA
 A7km1tVLocTD+p66irf/nSwZS8lEgRpV3UNm3ur5LzsYSUyGORSHDTVHdcEnC2HV5q4a
 W8XNdiP6r3wPV3HDQ3oq48pvSr/C5sxyahiRf7zJVzpz1H3JK07PBR/WjYEaCIc+XU/M
 Uh2w==
X-Forwarded-Encrypted: i=1;
 AJvYcCUPgklvtpjHcZzXYP2k/JTHOfPV3tR7cRJjQ9Dx5uVSd+beE31w6h4pg8xHMX4A/TeBp9TaEbVJxfSxYlUoqfaou19XDnc=
X-Gm-Message-State: AOJu0YxBMkWPo2JAwfWyXvoVsEOW15shxHVYLk4y9n/HsGnMClanlGGc
 u4TD7/iJW8Gf0SS7BwUu0b0gQAfYxniDeeOZgi2sMxDBz0N9rNf/8x1VvQLiQ1A=
X-Google-Smtp-Source: AGHT+IFGulvABc+D/+cx5GCUE+3rYsA1Ygcss4vJBJPMPeXx5v7uGxb3OTx1UBsRopsG3+JJ/vxjvw==
X-Received: by 2002:a17:906:3c13:b0:a59:f30e:fecd with SMTP id
 a640c23a62f3a-a62641c6aacmr613109466b.2.1716813969599; 
 Mon, 27 May 2024 05:46:09 -0700 (PDT)
Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com.
 [209.85.208.51]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a626cc89661sm493975166b.147.2024.05.27.05.46.09
 for <70958 <at> debbugs.gnu.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 May 2024 05:46:09 -0700 (PDT)
Received: by mail-ed1-f51.google.com with SMTP id
 4fb4d7f45d1cf-57857e0f464so3578258a12.0
 for <70958 <at> debbugs.gnu.org>; Mon, 27 May 2024 05:46:09 -0700 (PDT)
X-Forwarded-Encrypted: i=1;
 AJvYcCXrS3plz/AmgLz9HDEmgoJBzjQhbpERMgME+EJsOlvh59EPGZmK11JagaocJAiZmri7GFEPz97Qxt1VyrmCO45HIgYFE90=
X-Received: by 2002:a17:907:86a2:b0:a62:c2a5:cff5 with SMTP id
 a640c23a62f3a-a62c2a5d017mr413910666b.56.1716813969289; Mon, 27 May 2024
 05:46:09 -0700 (PDT)
MIME-Version: 1.0
References: <CABvCZ43amZyUFGW-q3kU1+XGA0CV5xkvUYrGKrhGKxS6OWQ+kw@HIDDEN>
 <86y17yz5sr.fsf@HIDDEN>
 <CALDnm52bQJGKe-Bv8DzJTqpjf5LxVOPSmQzGRqc_Gx2kU1g0QQ@HIDDEN>
 <CABvCZ43GkHMi8kWAy5qRdnF=YdH3V-iDiwVXnLT3_ex8iCcRMg@HIDDEN>
 <CALDnm53H+vqVwNttxTV2fKe_A3vrxTJ9ZmRpK3q1UyPvKn=2Mw@HIDDEN>
In-Reply-To: <CALDnm53H+vqVwNttxTV2fKe_A3vrxTJ9ZmRpK3q1UyPvKn=2Mw@HIDDEN>
From: Troy Brown <brownts@HIDDEN>
Date: Mon, 27 May 2024 08:45:58 -0400
X-Gmail-Original-Message-ID: <CABvCZ41ZOPW4nHHjHnv6uBGOdq_4+pGcXrVNbRvF0ifRQDfJtQ@HIDDEN>
Message-ID: <CABvCZ41ZOPW4nHHjHnv6uBGOdq_4+pGcXrVNbRvF0ifRQDfJtQ@HIDDEN>
Subject: Re: bug#70958: 30.0.50;
 eglot-managed-mode hooks not called on shutdown
To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 70958
Cc: 70958 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Felician Nemeth <felician.nemeth@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

On Mon, May 27, 2024 at 8:35=E2=80=AFAM Jo=C3=A3o T=C3=A1vora <joaotavora@g=
mail.com> wrote:
>
> Ah, so this is only a doc bug and you don't actually need it?  If so,
> fine with me, just provide a trivial patch for that and I'm sure some
> will install it ASAP.
>

I had tried to use it and found out it didn't work as expected, so I
took a different approach.  At this point, no I don't need it.  I did
however think it was a legitimate bug (not just a doc bug) and
reported it to prevent someone else from running into it in the
future.  If it's just a doc bug, that's fine, it wasn't clear to me.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70958; Package emacs. Full text available.

Message received at 70958 <at> debbugs.gnu.org:


Received: (at 70958) by debbugs.gnu.org; 27 May 2024 12:36:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 27 08:36:42 2024
Received: from localhost ([127.0.0.1]:43294 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sBZak-0005U4-3R
	for submit <at> debbugs.gnu.org; Mon, 27 May 2024 08:36:42 -0400
Received: from mail-lf1-f51.google.com ([209.85.167.51]:57526)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1sBZai-0005Ts-8p
 for 70958 <at> debbugs.gnu.org; Mon, 27 May 2024 08:36:40 -0400
Received: by mail-lf1-f51.google.com with SMTP id
 2adb3069b0e04-52965199234so3533798e87.2
 for <70958 <at> debbugs.gnu.org>; Mon, 27 May 2024 05:36:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1716813325; x=1717418125; 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=Cc0vz8BliGVLuJIXXanQduGmNCaTUeNYZ/WYfT4OGoY=;
 b=S+TTw9nSAiTYKvIbEFijQvKVEiQHMQy5VSx12jSJg/34VVfSlShgSwiT0JRRKtwnpL
 3mIsIhBFFoM1htjXAmcn1UHs/SIFHcnOIuZw/az4gWfimCoT6lbMz8bgCXOvNa06kgqX
 pB2MEmGjiH902MUKtIqtoEP1grLAXmlARxwCgRgmNTDaSqspU/lXkOxY4OE0o+nT7shJ
 9pCNuj//wnqUc/Vz29f/oDEWCiAkQNAcIUmU1pDbpUxW9f7O+bFnz27Zu6FTvBFQh8PK
 HNMOYvZNO274lPnikre+9F7ik9N4KZEkkhSPHOG1aEjKl/4VjNjT30/1havXtiQoLR6j
 J5qw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1716813325; x=1717418125;
 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=Cc0vz8BliGVLuJIXXanQduGmNCaTUeNYZ/WYfT4OGoY=;
 b=KYQdABzh0MCVNzKd6EsL2gXIifr3O3lpkk/H0U+RHVgRCFfUChM/lsdTNACQe+ho7p
 aQ3nIli2AesQ16oUeoC5yEgRc0UcaCNHbEmMvc3iMmIhyrNJMQoCBN118pJES08TCP9m
 7FqNOucdNrxYhBp4IMJLpKnYx599+ic1TLMmGfHuBWZGX5zxZqnm+5XvZFgrhw2+gXie
 AjNjJeHStq/ZQEMQ+qfljPZ2HgFHNl995ARJR4XHuFHF/fZkUXSD+Kpt/JlzyQZ1ANZ9
 oWHEUnwyojci1ixvdSbFknvZxquVMgS1X/Zdu9CPngNwk42FLkeXJUzOEws3OqxCnALZ
 XGUQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCXLnW04+x4UJSxoYWDNOcH8v6BNuHqkurg2bCjKfTXjXwF6lhTrGHF37eeFmyNtxKJhyd0ASMxDmVuUzpnSa/gvFKAhZH8=
X-Gm-Message-State: AOJu0YzS+HqdcQzM4AKnsg9EAVaxOjs09O0dgnNDSFTcBFDFfKip74op
 MEOtczsvkIesX6LnV1SAfbNAp74esHyv/iAoT4W6SfpPitOkHMgY8saAnJc26wgSPBV4NGVqPGL
 c0QESEwZlRuF4T2SSdxTebMSxXkVMwA==
X-Google-Smtp-Source: AGHT+IGBZ1deTdakGpNTu6PuhJpIJ7g3LTKFPJTxIddWmEX+EPhMCnrQ6ROdUMi1wBuUlLR0dC3qppkU92KgMK4mKIw=
X-Received: by 2002:a05:6512:15a2:b0:523:8858:db81 with SMTP id
 2adb3069b0e04-529649c5e7fmr7416814e87.22.1716813325325; Mon, 27 May 2024
 05:35:25 -0700 (PDT)
MIME-Version: 1.0
References: <CABvCZ43amZyUFGW-q3kU1+XGA0CV5xkvUYrGKrhGKxS6OWQ+kw@HIDDEN>
 <86y17yz5sr.fsf@HIDDEN>
 <CALDnm52bQJGKe-Bv8DzJTqpjf5LxVOPSmQzGRqc_Gx2kU1g0QQ@HIDDEN>
 <CABvCZ43GkHMi8kWAy5qRdnF=YdH3V-iDiwVXnLT3_ex8iCcRMg@HIDDEN>
In-Reply-To: <CABvCZ43GkHMi8kWAy5qRdnF=YdH3V-iDiwVXnLT3_ex8iCcRMg@HIDDEN>
From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Date: Mon, 27 May 2024 13:35:13 +0100
Message-ID: <CALDnm53H+vqVwNttxTV2fKe_A3vrxTJ9ZmRpK3q1UyPvKn=2Mw@HIDDEN>
Subject: Re: bug#70958: 30.0.50;
 eglot-managed-mode hooks not called on shutdown
To: Troy Brown <brownts@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70958
Cc: 70958 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Felician Nemeth <felician.nemeth@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Mon, May 27, 2024 at 1:29=E2=80=AFPM Troy Brown <brownts@HIDDEN> =
wrote:
>
> On Sun, May 26, 2024 at 6:46=E2=80=AFPM Jo=C3=A3o T=C3=A1vora <joaotavora=
@gmail.com> wrote:
> >
> > So when e-m-m-hook was added it was made to run only on "turn on"
> > because that's where it was most needed.  We can try changing Eglot
> > to also run it on "turn off", but that is a backward incompatible
> > change.
> >
>
> If it was never intended to run on "turn off", then the comment string
> for eglot-managed-mode-hook likely should be updated as it indicates
> it is run when Eglot stops managing the buffer (i.e., "... run by
> Eglot after it started/stopped managing a buffer").

Ah, so this is only a doc bug and you don't actually need it?  If so,
fine with me, just provide a trivial patch for that and I'm sure some
will install it ASAP.

Jo=C3=A3o




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70958; Package emacs. Full text available.

Message received at 70958 <at> debbugs.gnu.org:


Received: (at 70958) by debbugs.gnu.org; 27 May 2024 12:30:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 27 08:30:12 2024
Received: from localhost ([127.0.0.1]:43286 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sBZUR-0005KX-UR
	for submit <at> debbugs.gnu.org; Mon, 27 May 2024 08:30:12 -0400
Received: from mail-ed1-f45.google.com ([209.85.208.45]:46353)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <troy.s.brown@HIDDEN>) id 1sBZUN-0005Ig-An
 for 70958 <at> debbugs.gnu.org; Mon, 27 May 2024 08:30:09 -0400
Received: by mail-ed1-f45.google.com with SMTP id
 4fb4d7f45d1cf-57857e0f45cso3096414a12.1
 for <70958 <at> debbugs.gnu.org>; Mon, 27 May 2024 05:29:58 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1716812992; x=1717417792;
 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=4Jfj6t7Xkc3SCjvka8VPvWZHytDcXInRRf5Xiwn2Ihk=;
 b=MV2JasviElY3wkS6Gk9PosFwyEwctLB0WEag9QbfFQSucvn9kGcGyOVIKhf/8H6MxK
 7QQtudPD6E3GR7pOVoh1mqkzl9YkJeyBORvV4IvrWfIAlmehw7RhhaDVOg9CI1Ag8EPo
 +N6zXcqob3lsLjtQV8YoF4RNzBXHyNZWwDb3Jqn5OaM2NHwUonGlypZF19ERige20HOP
 L0/UbASj7UziPGMoOuebToFYR2UlfwsISPzGsrqahUzEB/tp/ExmqpHU9Xnee5j8PqJl
 PQ/HX9WDleLYLuhJ1auAEeaMAa1TVsvXzb/5qq1cNS2HyGgz1KbL2cBTtrk+MHVFHJce
 Nsjg==
X-Forwarded-Encrypted: i=1;
 AJvYcCVklNxbVcBgPYPUyEIh795CvuHVk+Lys62RPIFa1XQ6nUQiiVqXjknLIp0DnF/h9Wy7UONzVrN7NvV7ZxN/IU6LLBRbQZs=
X-Gm-Message-State: AOJu0YyQV3TkyyDklMwpMvjnO6YN9sn7jeDafQRLD2sAPBx0IapfzK3l
 iHkScIlGOG6lV9XVxkWMhqaqe/bv2pxFq1oTzO4Cdoe3OvMCEz9DJTQIjxp3zFQ=
X-Google-Smtp-Source: AGHT+IEknEwDK9pYy9itityS5Eon5wM8pASu7Hce1HYOH5PVnqwB6c2FOUpoAJTEPlxoUjXE8pe+vg==
X-Received: by 2002:a50:aa9a:0:b0:578:6901:7454 with SMTP id
 4fb4d7f45d1cf-578690175b6mr4239892a12.15.1716812992218; 
 Mon, 27 May 2024 05:29:52 -0700 (PDT)
Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com.
 [209.85.208.50]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-57852339fc4sm5682419a12.15.2024.05.27.05.29.51
 for <70958 <at> debbugs.gnu.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 May 2024 05:29:51 -0700 (PDT)
Received: by mail-ed1-f50.google.com with SMTP id
 4fb4d7f45d1cf-578517c7ae9so3804030a12.3
 for <70958 <at> debbugs.gnu.org>; Mon, 27 May 2024 05:29:51 -0700 (PDT)
X-Forwarded-Encrypted: i=1;
 AJvYcCWaVaDJ4N/QsSvvG6qOXGIDbxKb9mpQE59ECj4F+cKhUm1mynA1ElnYDkSgu29/zDL6NUJ+kv5HHePpymNGHZ7OwuEPIwM=
X-Received: by 2002:a17:906:fad8:b0:a5c:e9e4:99b8 with SMTP id
 a640c23a62f3a-a6265116471mr621836566b.74.1716812991760; Mon, 27 May 2024
 05:29:51 -0700 (PDT)
MIME-Version: 1.0
References: <CABvCZ43amZyUFGW-q3kU1+XGA0CV5xkvUYrGKrhGKxS6OWQ+kw@HIDDEN>
 <86y17yz5sr.fsf@HIDDEN>
 <CALDnm52bQJGKe-Bv8DzJTqpjf5LxVOPSmQzGRqc_Gx2kU1g0QQ@HIDDEN>
In-Reply-To: <CALDnm52bQJGKe-Bv8DzJTqpjf5LxVOPSmQzGRqc_Gx2kU1g0QQ@HIDDEN>
From: Troy Brown <brownts@HIDDEN>
Date: Mon, 27 May 2024 08:29:40 -0400
X-Gmail-Original-Message-ID: <CABvCZ43GkHMi8kWAy5qRdnF=YdH3V-iDiwVXnLT3_ex8iCcRMg@HIDDEN>
Message-ID: <CABvCZ43GkHMi8kWAy5qRdnF=YdH3V-iDiwVXnLT3_ex8iCcRMg@HIDDEN>
Subject: Re: bug#70958: 30.0.50;
 eglot-managed-mode hooks not called on shutdown
To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 70958
Cc: 70958 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Felician Nemeth <felician.nemeth@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

On Sun, May 26, 2024 at 6:46=E2=80=AFPM Jo=C3=A3o T=C3=A1vora <joaotavora@g=
mail.com> wrote:
>
> So when e-m-m-hook was added it was made to run only on "turn on"
> because that's where it was most needed.  We can try changing Eglot
> to also run it on "turn off", but that is a backward incompatible
> change.
>

If it was never intended to run on "turn off", then the comment string
for eglot-managed-mode-hook likely should be updated as it indicates
it is run when Eglot stops managing the buffer (i.e., "... run by
Eglot after it started/stopped managing a buffer").




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70958; Package emacs. Full text available.

Message received at 70958 <at> debbugs.gnu.org:


Received: (at 70958) by debbugs.gnu.org; 26 May 2024 22:48:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 26 18:48:07 2024
Received: from localhost ([127.0.0.1]:42691 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sBMes-0001mc-Pz
	for submit <at> debbugs.gnu.org; Sun, 26 May 2024 18:48:07 -0400
Received: from mail-lf1-f42.google.com ([209.85.167.42]:60464)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1sBMeq-0001m7-Me
 for 70958 <at> debbugs.gnu.org; Sun, 26 May 2024 18:48:05 -0400
Received: by mail-lf1-f42.google.com with SMTP id
 2adb3069b0e04-529aa4e988aso1231036e87.0
 for <70958 <at> debbugs.gnu.org>; Sun, 26 May 2024 15:47:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1716763610; x=1717368410; 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=B1Oa+TDyzz292AUdOB71qmBysubYLpRj5wD92Saf6Eo=;
 b=C45rzehaY7MVS5P1uwY013QqgbDgYZlxmqtnoxp/GTD7rlGWRGMZVEQnMUuq8L0Npb
 IuDf208l7Agb//NC2fEkKrSskxUmLM3ICf9t1VylsCGNeYI4Yys5nR47A0+TCNVq31AT
 w5LyczGk1EcGyyU2iC0oMFpQ7MFRh9+5utuxwDJgRYbbrL/DzawC3+ELTFTao53CpPRZ
 WTIAou7kw5/jIwkSuPujyAb0O8+/g0fkCgW68JRQrE8cimG8PAKeA5gboSq+RR0qW1RL
 NqwbcTP94BdR4UWHi5kT9Juad6BHZk5+d1aI05CiCNvVwvb6mxSmRnKAGVngLRGLwvGw
 6szw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1716763610; x=1717368410;
 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=B1Oa+TDyzz292AUdOB71qmBysubYLpRj5wD92Saf6Eo=;
 b=hWxRE9Vuy0hoVym6fuAXzpAVYzYx1l8RjbpshtnTIPYBhjMR7/B6cOU4PMhWG2Wr8E
 AQgsgN5otYQm3zarNPsRhEsBMTwHwZTQN/GYk48s3hYml98D5gKKrDNZ1lTPo9S4cPXG
 zn1hoy5vRlI/ZpUqNc1awUlBFj2AMYM5Pnu0p/RKTMerjMkbop7E+OmC2zxvtvb+XF5O
 iZ5Zb764a65iSxl1j5JW43SutorpqKyNI8ZiBgY2AdCq5Im6AJXjlcP5VbhSpWvyNMSy
 p0VFRdIGXlpHlTQNoXE1vUnxTB8DKrM0LHt75yZvz/43K3kmvvQzvPHi+OcM6oIb3I+S
 hTfw==
X-Forwarded-Encrypted: i=1;
 AJvYcCUlo0dwVP59Hf0pyUXimIUBw0fHO7RipZR4Rg5gbWMaN2c7ZsKXip0THq+uwoqyG4abKMC9q+p/B2Kz4vSRElTXbxCcEls=
X-Gm-Message-State: AOJu0YzjGur9aryBmLmAqr6ari1A+38yOHCQaXQHPvzK1hQkkOMUhtH/
 ahFZskrULkEbF4WZ7kilkPZ9w0F2ZfiU6E6v/CaQuTLWSS1LtDs02r/IlfGafV0MrD8i9f8BQqO
 52GIwkvrmQQkMPL/3kustq7Cyshs=
X-Google-Smtp-Source: AGHT+IHztpK/YbDFcoa0iJemDeZYrcA086jBzW8dusXQ8Xae87fclj/q1CQy499Mlb3wBpyfFPNvinK5ZWcZqj/544c=
X-Received: by 2002:a19:7705:0:b0:523:bb4c:7b99 with SMTP id
 2adb3069b0e04-5296420821fmr4758667e87.8.1716763609909; Sun, 26 May 2024
 15:46:49 -0700 (PDT)
MIME-Version: 1.0
References: <CABvCZ43amZyUFGW-q3kU1+XGA0CV5xkvUYrGKrhGKxS6OWQ+kw@HIDDEN>
 <86y17yz5sr.fsf@HIDDEN>
In-Reply-To: <86y17yz5sr.fsf@HIDDEN>
From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Date: Sun, 26 May 2024 23:46:38 +0100
Message-ID: <CALDnm52bQJGKe-Bv8DzJTqpjf5LxVOPSmQzGRqc_Gx2kU1g0QQ@HIDDEN>
Subject: Re: bug#70958: 30.0.50;
 eglot-managed-mode hooks not called on shutdown
To: Eli Zaretskii <eliz@HIDDEN>, Felician Nemeth <felician.nemeth@HIDDEN>, 
 Stefan Monnier <monnier@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70958
Cc: 70958 <at> debbugs.gnu.org, Troy Brown <brownts@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Sat, May 25, 2024 at 8:53=E2=80=AFAM Eli Zaretskii <eliz@HIDDEN> wrote:
>
> > From: Troy Brown <brownts@HIDDEN>
> > Date: Wed, 15 May 2024 08:38:28 -0400
> >
> > The documentation for eglot-managed-mode-hook indicates that the hook
> > is run after Eglot has started/stopped managing a buffer.  I was
> > trying to use this to perform setup/teardown of functionality when
> > this happened, but it appears the registered hooks are never called on
> > shutdown.  The following is a little test that can be run in a buffer
> > which has LSP support, to demonstrate the problem.  My expectation is
> > that "Buffer not managed" is output and the my-eglot-hook-var is
> > changed to 'not-managed when a shutdown occurs.
> >
> > --8<---------------cut here---------------start------------->8---
> > (defun my-eglot-test ()
> >   (defun my-eglot-hook ()
> >     (message "my-eglot-hook invoked")
> >     (if (eglot-managed-p)
> >         (progn
> >           (message "Buffer is managed")
> >           (setq-local my-eglot-hook-var 'managed))
> >       (message "Buffer not managed")
> >       (setq-local my-eglot-hook-var 'not-managed)))
> >   (add-hook 'eglot-managed-mode-hook #'my-eglot-hook)
> >   (setq-local my-eglot-hook-var 'initial)
> >   (cl-assert (not (eglot-managed-p)))
> >   (cl-assert (eq my-eglot-hook-var 'initial))
> >   (call-interactively #'eglot)
> >   (cl-assert (eglot-managed-p))
> >   (cl-assert (eq my-eglot-hook-var 'managed))
> >   (sleep-for 3) ; wait for server connection
> >   (call-interactively #'eglot-shutdown)
> >   (cl-assert (not (eglot-managed-p)))
> >   (cl-assert (eq my-eglot-hook-var 'not-managed)))
> > --8<---------------cut here---------------end--------------->8---
>
> Jo=C3=A3o, any comments or suggestions?

eglot-managed-mode-hook is an abnormal minor mode hook because there
is no eglot-managed-mode minor mode, there is only eglot--managed-mode
which is a "--" definition on purpose (that does have the normal hooks
of course).

So when e-m-m-hook was added it was made to run only on "turn on"
because that's where it was most needed.  We can try changing Eglot
to also run it on "turn off", but that is a backward incompatible
change.

Alternatively, we can add a new eglot-managed-mode-off-hook.

Whatever the decision, there is the additional question of _when_ to
run the "off".  Maybe it's simple to  decide, but at least the the
"on" e-m -m-hook is specially  designed to run after some
LSP communication has taken  place,  which is of the  reasons
eglot--managed-mode-hook wasn't  suitable.  So maybe the "off"
should run in a similarly careful symmetrical position.

Finally, Troy can probably also make use of the internal
eglot--managed-mode-hook.  It's a "--", unsupported and dangerous
in theory, in practice it should be OK.

I'm CCing Felici=C3=A1n and Stefan for suggestions.

Jo=C3=A3o




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70958; Package emacs. Full text available.

Message received at 70958 <at> debbugs.gnu.org:


Received: (at 70958) by debbugs.gnu.org; 25 May 2024 07:53:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 25 03:53:33 2024
Received: from localhost ([127.0.0.1]:41904 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sAmDc-0006zj-Oj
	for submit <at> debbugs.gnu.org; Sat, 25 May 2024 03:53:33 -0400
Received: from eggs.gnu.org ([209.51.188.92]:49648)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1sAmDT-0006zY-TJ
 for 70958 <at> debbugs.gnu.org; Sat, 25 May 2024 03:53:32 -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 <eliz@HIDDEN>)
 id 1sAmDG-0000LY-MD; Sat, 25 May 2024 03:53:10 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=8lSu7OOwS5JkC9t1p+pzzIwxIb5fjZwfGDx9BLxr9AA=; b=ISH/HBLA6e65idAIcvvM
 jhvCwisyk1zVDjHr7ZjsvqkNPErBE6Q4wqzwPB0OTvSxBHQsLHAlF+Dk9Tspim/fvee1H/x0oXrm/
 tu001IGui5zWzv117OY0Ns6Hlu9hS8VUZbJLWO2AsnPIrPFaB0LjsEfANVH1hRRLZx6PI6Ll8O+V6
 ypGySVh3IDo0cSCpQ5rl9gUqbXqZAw6iD0JFQ1YTWMG51uIQ3toCIQzX0wGDWWfBWjqXZZu+MH+hM
 bVHWHyQorOjrutjOkG2HS7tuiqsp445gdpACa78SosZBuqyE7pw5oW5nQ0sBH/Hi6UjD7MazAIOG0
 LNLDpjMDYpwTEw==;
Date: Sat, 25 May 2024 10:53:08 +0300
Message-Id: <86y17yz5sr.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Troy Brown <brownts@HIDDEN>, =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?=
 <joaotavora@HIDDEN>
In-Reply-To: <CABvCZ43amZyUFGW-q3kU1+XGA0CV5xkvUYrGKrhGKxS6OWQ+kw@HIDDEN>
 (message from Troy Brown on Wed, 15 May 2024 08:38:28 -0400)
Subject: Re: bug#70958: 30.0.50;
 eglot-managed-mode hooks not called on shutdown
References: <CABvCZ43amZyUFGW-q3kU1+XGA0CV5xkvUYrGKrhGKxS6OWQ+kw@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 70958
Cc: 70958 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Troy Brown <brownts@HIDDEN>
> Date: Wed, 15 May 2024 08:38:28 -0400
> 
> The documentation for eglot-managed-mode-hook indicates that the hook
> is run after Eglot has started/stopped managing a buffer.  I was
> trying to use this to perform setup/teardown of functionality when
> this happened, but it appears the registered hooks are never called on
> shutdown.  The following is a little test that can be run in a buffer
> which has LSP support, to demonstrate the problem.  My expectation is
> that "Buffer not managed" is output and the my-eglot-hook-var is
> changed to 'not-managed when a shutdown occurs.
> 
> --8<---------------cut here---------------start------------->8---
> (defun my-eglot-test ()
>   (defun my-eglot-hook ()
>     (message "my-eglot-hook invoked")
>     (if (eglot-managed-p)
>         (progn
>           (message "Buffer is managed")
>           (setq-local my-eglot-hook-var 'managed))
>       (message "Buffer not managed")
>       (setq-local my-eglot-hook-var 'not-managed)))
>   (add-hook 'eglot-managed-mode-hook #'my-eglot-hook)
>   (setq-local my-eglot-hook-var 'initial)
>   (cl-assert (not (eglot-managed-p)))
>   (cl-assert (eq my-eglot-hook-var 'initial))
>   (call-interactively #'eglot)
>   (cl-assert (eglot-managed-p))
>   (cl-assert (eq my-eglot-hook-var 'managed))
>   (sleep-for 3) ; wait for server connection
>   (call-interactively #'eglot-shutdown)
>   (cl-assert (not (eglot-managed-p)))
>   (cl-assert (eq my-eglot-hook-var 'not-managed)))
> --8<---------------cut here---------------end--------------->8---

João, any comments or suggestions?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70958; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 15 May 2024 12:38:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 15 08:38:52 2024
Received: from localhost ([127.0.0.1]:42190 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s7DuG-0000Z5-Bh
	for submit <at> debbugs.gnu.org; Wed, 15 May 2024 08:38:52 -0400
Received: from lists.gnu.org ([209.51.188.17]:57612)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <troy.s.brown@HIDDEN>) id 1s7DuE-0000Yy-Cg
 for submit <at> debbugs.gnu.org; Wed, 15 May 2024 08:38:51 -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 <troy.s.brown@HIDDEN>)
 id 1s7DuC-0007yP-BN
 for bug-gnu-emacs@HIDDEN; Wed, 15 May 2024 08:38:48 -0400
Received: from mail-ej1-f53.google.com ([209.85.218.53])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <troy.s.brown@HIDDEN>)
 id 1s7Du9-0005BH-Jc
 for bug-gnu-emacs@HIDDEN; Wed, 15 May 2024 08:38:47 -0400
Received: by mail-ej1-f53.google.com with SMTP id
 a640c23a62f3a-a59b58fe083so153834366b.0
 for <bug-gnu-emacs@HIDDEN>; Wed, 15 May 2024 05:38:43 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1715776720; x=1716381520;
 h=to:subject:message-id:date:from:mime-version:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=Ip3dyGhLdcG1NRSbNt4mEYS7ZL87/pepRfUn5Dlpzsg=;
 b=UzOdSkvECVl1oMft8A1UxH0oTz//EoIBEi+SazBsaF+CkLzW984K+vIZ60hPM1lR8v
 vkD3n7iCozaFuD0KIXluqg+kVgtksnZaHoL6h/3qYmSrd1z0d8tydAATDQlFaU1pL1h4
 Q3Fzg4V7N9oTTA1wVo4Zwp8U+VqajOzMPDHv3q6LsSn3Fz8WDg9+7qtQWS3axzQfTN/s
 e7iWvlDD87kBcOL0bFEIl0jTlf/Pn3ba7I17cEldn4ZCKVU5/php2WOIl3Jlkw+mNRHu
 pQbzFlEaKAR5v/dpsyF7eN4lXinl7Tr+OupMVos3t74YTDShlyBmju9b8dZRn7NxxPaA
 6Cug==
X-Gm-Message-State: AOJu0YyomBb/mwC1rou4tk+Q92O7F8KLUAalHSFMZKDOLwHwb6TmwgL5
 h6bdM3JZRRl1YboMo/vafEMmWGv2t+rTo6KrcI2lzQLDcaIkuyVKI4Dv16nHSxo=
X-Google-Smtp-Source: AGHT+IGrn/auehJZSTu0fWu5Nf32dVN63UOCKNMHhiSIiOYEbAP56iLvuDLHxvZUiPdidOnnflmgVQ==
X-Received: by 2002:a17:906:289b:b0:a5a:8bc4:f503 with SMTP id
 a640c23a62f3a-a5a8bc4f988mr216040566b.25.1715776720141; 
 Wed, 15 May 2024 05:38:40 -0700 (PDT)
Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com.
 [209.85.218.41]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a5a1781ce4esm870215666b.13.2024.05.15.05.38.39
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 15 May 2024 05:38:39 -0700 (PDT)
Received: by mail-ej1-f41.google.com with SMTP id
 a640c23a62f3a-a5a8cd78701so183876066b.2
 for <bug-gnu-emacs@HIDDEN>; Wed, 15 May 2024 05:38:39 -0700 (PDT)
X-Received: by 2002:a17:906:b1d3:b0:a59:9db2:d988 with SMTP id
 a640c23a62f3a-a5a2d65f404mr1009865766b.50.1715776719320; Wed, 15 May 2024
 05:38:39 -0700 (PDT)
MIME-Version: 1.0
From: Troy Brown <brownts@HIDDEN>
Date: Wed, 15 May 2024 08:38:28 -0400
X-Gmail-Original-Message-ID: <CABvCZ43amZyUFGW-q3kU1+XGA0CV5xkvUYrGKrhGKxS6OWQ+kw@HIDDEN>
Message-ID: <CABvCZ43amZyUFGW-q3kU1+XGA0CV5xkvUYrGKrhGKxS6OWQ+kw@HIDDEN>
Subject: 30.0.50; eglot-managed-mode hooks not called on shutdown
To: bug-gnu-emacs@HIDDEN
Content-Type: text/plain; charset="UTF-8"
Received-SPF: pass client-ip=209.85.218.53;
 envelope-from=troy.s.brown@HIDDEN; helo=mail-ej1-f53.google.com
X-Spam_score_int: -15
X-Spam_score: -1.6
X-Spam_bar: -
X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9,
 FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001,
 HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001,
 RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.1 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.1 (--)

The documentation for eglot-managed-mode-hook indicates that the hook
is run after Eglot has started/stopped managing a buffer.  I was
trying to use this to perform setup/teardown of functionality when
this happened, but it appears the registered hooks are never called on
shutdown.  The following is a little test that can be run in a buffer
which has LSP support, to demonstrate the problem.  My expectation is
that "Buffer not managed" is output and the my-eglot-hook-var is
changed to 'not-managed when a shutdown occurs.

--8<---------------cut here---------------start------------->8---
(defun my-eglot-test ()
  (defun my-eglot-hook ()
    (message "my-eglot-hook invoked")
    (if (eglot-managed-p)
        (progn
          (message "Buffer is managed")
          (setq-local my-eglot-hook-var 'managed))
      (message "Buffer not managed")
      (setq-local my-eglot-hook-var 'not-managed)))
  (add-hook 'eglot-managed-mode-hook #'my-eglot-hook)
  (setq-local my-eglot-hook-var 'initial)
  (cl-assert (not (eglot-managed-p)))
  (cl-assert (eq my-eglot-hook-var 'initial))
  (call-interactively #'eglot)
  (cl-assert (eglot-managed-p))
  (cl-assert (eq my-eglot-hook-var 'managed))
  (sleep-for 3) ; wait for server connection
  (call-interactively #'eglot-shutdown)
  (cl-assert (not (eglot-managed-p)))
  (cl-assert (eq my-eglot-hook-var 'not-managed)))
--8<---------------cut here---------------end--------------->8---




Acknowledgement sent to Troy Brown <brownts@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#70958; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 27 May 2024 16:00:03 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.