unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Troy Brown <brownts@troybrown.dev>
To: "João Távora" <joaotavora@gmail.com>
Cc: 70958@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>,
	Felician Nemeth <felician.nemeth@gmail.com>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#70958: 30.0.50; eglot-managed-mode hooks not called on shutdown
Date: Mon, 27 May 2024 10:32:01 -0400	[thread overview]
Message-ID: <CABvCZ43N7s-Kka2Z7i6X+bySy-XuxAir7cVn8vXURUhVMS9brg@mail.gmail.com> (raw)
In-Reply-To: <CALDnm50u2r5y_k3j8i-cmEJT=BHJ8-33sUuiKh2-WCmr6Or6ug@mail.gmail.com>

On Mon, May 27, 2024 at 10:09 AM João Távora <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).





  reply	other threads:[~2024-05-27 14:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-15 12:38 bug#70958: 30.0.50; eglot-managed-mode hooks not called on shutdown Troy Brown
2024-05-25  7:53 ` Eli Zaretskii
2024-05-26 22:46   ` João Távora
2024-05-27 12:29     ` Troy Brown
2024-05-27 12:35       ` João Távora
2024-05-27 12:45         ` Troy Brown
2024-05-27 14:09           ` João Távora
2024-05-27 14:32             ` Troy Brown [this message]
2024-05-27 15:45               ` João Távora
2024-05-27 15:51                 ` João Távora
2024-05-27 16:21     ` Felician Nemeth
2024-05-27 17:22       ` João Távora
2024-05-27 17:35         ` Felician Nemeth
2024-05-27 21:05           ` João Távora
2024-05-27 22:21             ` João Távora
2024-05-28 13:00               ` Troy Brown
2024-06-01 14:18                 ` Eli Zaretskii
     [not found]                   ` <CALDnm507yRL6y6VcM-OwHUhSmFbpcFhsUb00wabirPkfq7ZAow@mail.gmail.com>
2024-06-01 16:01                     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABvCZ43N7s-Kka2Z7i6X+bySy-XuxAir7cVn8vXURUhVMS9brg@mail.gmail.com \
    --to=brownts@troybrown.dev \
    --cc=70958@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=felician.nemeth@gmail.com \
    --cc=joaotavora@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).