]> git.eshelyaron.com Git - emacs.git/commitdiff
When user declines to reconnect, first quit existing server
authorJoão Távora <joaotavora@gmail.com>
Fri, 4 May 2018 00:25:13 +0000 (01:25 +0100)
committerJoão Távora <joaotavora@gmail.com>
Fri, 4 May 2018 10:45:39 +0000 (11:45 +0100)
* eglot.el (eglot): Rework reconnection logic.

lisp/progmodes/eglot.el

index c5a0c0f0d7a5cd4e32a783544137859afd715d96..3d0c04483440206240affcb2ecb47ff6048e30e2 100644 (file)
@@ -293,13 +293,15 @@ Execute program (or connect to <host>:<port>) "
                   (y-or-n-p "[eglot] Live process found, reconnect instead? "))
              (eglot-reconnect current-process interactive))
             (t
+             (when (process-live-p current-process)
+               (eglot-shutdown current-process 'sync))
              (eglot--connect
               project
               managed-major-mode
               short-name
               command
               (lambda (proc)
-                (eglot--message "Connected! Process `%s' now managing `%s'\
+                (eglot--message "Connected! Process `%s' now managing `%s' \
 buffers in project %s."
                                 proc
                                 managed-major-mode