]> git.eshelyaron.com Git - emacs.git/commit
Implement asynchronous server connection
authorJoão Távora <joaotavora@gmail.com>
Sat, 11 Aug 2018 13:52:33 +0000 (14:52 +0100)
committerJoão Távora <joaotavora@gmail.com>
Sun, 12 Aug 2018 23:26:29 +0000 (00:26 +0100)
commitd164ece5cf0fefec4c36c1b80f9f43c35e00f4f9
treedee66587e664dc29fb0a292904f8acbc565dac45
parentef5266397a0447a356b401df5572becdb30e7c61
Implement asynchronous server connection

A new defcustom eglot-sync-connect controls this feature.  If it is t,
eglot should behave like previously, waiting synchronously for a
connection to be established, with the exception that there is now a
non-nil timeout set to eglot-connect-timeout, which defaults to 30
seconds.

eglot-connect is now considerably more complicated as it replicates
most of the work that jsonrpc-request does vis-a-vis handling errors,
timeouts and user quits..

* eglot-tests.el
(eglot--call-with-dirs-and-files): Simplify cleanup logic.
(slow-sync-connection-wait)
(slow-sync-connection-intime, slow-async-connection)
(slow-sync-error): New tests.

* eglot.el (eglot-sync-connect): New defcustom.
(eglot-ensure, eglot): Simplify.
(eglot--connect): Honour eglot-sync-connect.  Complicate
considerably.
(eglot-connect-timeout): New defcustom.
(Package-requires): Require jsonrpc 1.0.6

GitHub-reference: close https://github.com/joaotavora/eglot/issues/68
lisp/progmodes/eglot.el