]> git.eshelyaron.com Git - emacs.git/commit
Let eglot-flymake-backend be in flymake-d-functions even if eglot off
authorJoão Távora <joaotavora@gmail.com>
Tue, 10 Aug 2021 19:28:35 +0000 (20:28 +0100)
committerJoão Távora <joaotavora@gmail.com>
Tue, 17 Aug 2021 09:03:17 +0000 (10:03 +0100)
commitace1573dfe02fa5969692af545993ccf9475ccaf
tree34d9eab86d82eb4b77a4e431289d8d67dd36cf64
parent7eb81031cd25562c7c566a34cce616fd0410e51d
Let eglot-flymake-backend be in flymake-d-functions even if eglot off

This is useful when using  eglot-stay-out-of and a pattern like:

   (defun my/js-mode-hook ()
     (add-hook 'flymake-diagnostic-functions 'some-eslint-backend nil t))
     (setq-local eglot-stay-out-of '(flymake))
     (add-hook 'flymake-diagnostic-functions 'eglot-flymake-backend nil t))

   (add-hook 'js-mode-hook 'my/js-mode-hook)

Then, _both_ backends will run unconditionally, but Eglot backend only
actually reports diagnostics if Eglot is on.

* eglot.el (eglot-flymake-backend): If buffer isn't being managed
by Eglot, behave as a noop.
lisp/progmodes/eglot.el