--- Begin Message ---
Subject: |
eglot-managed-mode-hook doesn't run when minor mode is turned off |
Date: |
Wed, 08 May 2024 16:50:11 -0300 |
As the title says, the public facing `eglot-managed-mode-hook' doesn't
run when `eglot--managed-mode' is turned off. That can be tested with
(add-hook 'eglot-managed-mode-hook
(lambda ()
(message "ran eglot-managed-mode-hook with eglot--managed-mode
'%s'"
(if eglot--managed-mode "on" "off"))))
(add-hook 'eglot--managed-mode-hook
(lambda ()
(message "ran eglot--managed-mode-hook with eglot--managed-mode
'%s'"
(if eglot--managed-mode "on" "off"))))
In fact, as of Eglot version 1.17, that is caused by the following
(defun eglot--maybe-activate-editing-mode ()
"Maybe activate `eglot--managed-mode'.
If it is activated, also signal textDocument/didOpen."
(unless eglot--managed-mode
^^^^^^^^^^^^^^^^^^^^^^^^^^^
;; Called when `revert-buffer-in-progress-p' is t but
;; `revert-buffer-preserve-modes' is nil.
(when (and buffer-file-name (eglot-current-server))
(setq eglot--diagnostics nil)
(eglot--managed-mode)
(eglot--signal-textDocument/didOpen)
;; Run user hook after 'textDocument/didOpen' so server knows
;; about the buffer.
(eglot-inlay-hints-mode 1)
(run-hooks 'eglot-managed-mode-hook))))
Calling run-hooks inside the definition of eglot--managed-mode, but I'm
not sure.
Best,
--
João Pedro de A. Paula
IT bachelors at Universidade Federal do Rio Grande do Norte (UFRN)
--- 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 ---