emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#70958: closed (30.0.50; eglot-managed-mode hooks not called on shutd


From: GNU bug Tracking System
Subject: bug#70958: closed (30.0.50; eglot-managed-mode hooks not called on shutdown)
Date: Sat, 01 Jun 2024 16:02:02 +0000

Your message dated Sat, 01 Jun 2024 19:01:17 +0300
with message-id <86jzj8odo2.fsf@gnu.org>
and subject line Re: bug#70958: 30.0.50; eglot-managed-mode hooks not called on 
shutdown
has caused the debbugs.gnu.org bug report #70958,
regarding 30.0.50; eglot-managed-mode hooks not called on shutdown
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
70958: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70958
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 30.0.50; eglot-managed-mode hooks not called on shutdown 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---



--- End Message ---
--- Begin Message --- Subject: Re: bug#70958: 30.0.50; eglot-managed-mode hooks not called on shutdown Date: Sat, 01 Jun 2024 19:01:17 +0300
> From: João Távora <joaotavora@gmail.com>
> Date: Sat, 1 Jun 2024 16:48:47 +0100
> 
> Yes, thanks

Thanks, done.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]