all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#70835: eglot-managed-mode-hook doesn't run when minor mode is turned off
@ 2024-05-08 19:50 João Pedro
  0 siblings, 0 replies; only message in thread
From: João Pedro @ 2024-05-08 19:50 UTC (permalink / raw)
  To: 70835

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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-08 19:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-08 19:50 bug#70835: eglot-managed-mode-hook doesn't run when minor mode is turned off João Pedro

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.