From: João Távora Date: Sun, 22 Jul 2018 18:07:43 +0000 (+0100) Subject: Don't turn on flymake-mode any more than is needed X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~472 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=693e4282510f8ba8d70e6144707907ba9fbd56b0;p=emacs.git Don't turn on flymake-mode any more than is needed If flymake-mode is in eglot--managed-mode-hook, it will be called even if eglot--managed-mode is being turned off, which could be problematic because it triggers a check if flymake-start-on-flymake-mode is t. * eglot.el (eglot--managed-mode): Turn on flymake-mode and eldoc-mode here. GitHub-reference: close https://github.com/joaotavora/eglot/issues/44 --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 49a1f3d496b..cb9a5ed0515 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -700,7 +700,9 @@ If optional MARKERS, make markers." (add-hook 'change-major-mode-hook 'eglot--managed-mode-onoff nil t) (add-function :before-until (local 'eldoc-documentation-function) #'eglot-eldoc-function) - (add-function :around (local 'imenu-create-index-function) #'eglot-imenu)) + (add-function :around (local 'imenu-create-index-function) #'eglot-imenu) + (flymake-mode 1) + (eldoc-mode 1)) (t (remove-hook 'flymake-diagnostic-functions 'eglot-flymake-backend t) (remove-hook 'after-change-functions 'eglot--after-change t) @@ -738,9 +740,6 @@ Reset in `eglot--managed-mode-onoff'.") (setf (eglot--managed-buffers server) (delq buf (eglot--managed-buffers server))))))))) -(add-hook 'eglot--managed-mode-hook 'flymake-mode) -(add-hook 'eglot--managed-mode-hook 'eldoc-mode) - (defun eglot--current-server () "Find the current logical EGLOT server." (or