]> git.eshelyaron.com Git - emacs.git/commit
Provide stable eglot-current-server helper
authorJoão Távora <joaotavora@gmail.com>
Sat, 9 Nov 2019 22:58:08 +0000 (22:58 +0000)
committerJoão Távora <joaotavora@gmail.com>
Sun, 10 Nov 2019 22:23:40 +0000 (22:23 +0000)
commita6799b92ce6208a12d17291673aa09e8963e61be
tree6d2e1841ca27dd6142082c89783a54b22c04e025
parent8b4e81cdcf57a1eca09523c84bb3389d3549131d
Provide stable eglot-current-server helper

It's better if eglot--current-server is removed, since it was being
abused by other packages, and has side effects.  The only place where
it was really needed was eglot--maybe-activate-editing-mode, so the
find-and-cache logic has been moved there.  All other places that can
handle a nil server now use eglot-current-server, the external
version.

* eglot.el (eglot-shutdown, eglot, eglot--read-server)
(eglot--mode-line-format): Use eglot-current-server.
(eglot--connect): Update comment.
(eglot--current-server): Remove.
(eglot-current-server): New helper.
(eglot--maybe-activate-editing-mode): find and cache the server here.

* eglot-tests.el (auto-detect-running-server)
(auto-shutdown, auto-reconnect, eglot-ensure)
(slow-async-connection): Use eglot-current-server.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/342
lisp/progmodes/eglot.el