From: João Távora Date: Fri, 4 May 2018 00:25:13 +0000 (+0100) Subject: When user declines to reconnect, first quit existing server X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~649 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c1e66cf87af0f2f26afbd55679bb68962fb76f91;p=emacs.git When user declines to reconnect, first quit existing server * eglot.el (eglot): Rework reconnection logic. --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index c5a0c0f0d7a..3d0c0448344 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -293,13 +293,15 @@ Execute program (or connect to :) " (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