From 9bc459df6ddbd79f18fd569b008b5f82640c0fce Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 27 Jul 2018 10:06:21 +0100 Subject: [PATCH] Be less verbose when using eglot-ensure * eglot.el (eglot-ensure): Don't message when a buffer is already managed. GitHub-reference: close https://github.com/joaotavora/eglot/issues/48 --- lisp/progmodes/eglot.el | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 77f370e3471..695db498ff4 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -137,7 +137,7 @@ lasted more than that many seconds." :type '(choice (boolean :tag "Whether to inhibit autoreconnection") (integer :tag "Number of seconds"))) - + ;;; API (WORK-IN-PROGRESS!) ;;; (cl-defmacro eglot--with-live-buffer (buf &rest body) @@ -225,7 +225,7 @@ lasted more than that many seconds." :documentation "Represents a server. Wraps a process for LSP communication.") - + ;;; Process management (defvar eglot--servers-by-project (make-hash-table :test #'equal) "Keys are projects. Values are lists of processes.") @@ -417,9 +417,7 @@ INTERACTIVE is t if called interactively." () (remove-hook 'post-command-hook #'maybe-connect nil) (eglot--with-live-buffer buffer - (if eglot--managed-mode - (eglot--message "Buffer is already managed by existing `%s'" - (eglot--project-nickname (eglot--current-server))) + (unless eglot--managed-mode (let ((server (apply #'eglot--connect (eglot--guess-contact)))) (eglot--message "Automatically started `%s' to manage `%s' buffers in project `%s'" -- 2.39.2