From ef1924c8e2f562a828e1f6a0ac17058b8a5b50fb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Wed, 2 May 2018 13:31:26 +0100 Subject: [PATCH] Add eglot-clear-status interactive command * eglot.el (eglot-clear-status): New (eglot-forget-pending-continuations): Fix bug. (eglot--mode-line-format): Add link to eglot-clear-status. --- lisp/progmodes/eglot.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 1a82cc507d3..db594f4984a 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -361,9 +361,14 @@ identifier. ERROR is non-nil if this is an error." (defun eglot-forget-pending-continuations (process) "Stop waiting for responses from the current LSP PROCESS." - (interactive (eglot--current-process-or-lose)) + (interactive (list (eglot--current-process-or-lose))) (clrhash (eglot--pending-continuations process))) +(defun eglot-clear-status (process) + "Clear most recent error message from PROCESS." + (interactive (list (eglot--current-process-or-lose))) + (setf (eglot--status process) nil)) + (cl-defun eglot--request (process method params @@ -668,12 +673,15 @@ running. INTERACTIVE is t if called interactively." `("/" (:propertize ,status - help-echo ,(concat "mouse-1: go to events buffer") + help-echo ,(concat "mouse-1: go to events buffer\n" + "mouse-3: clear this status") mouse-face mode-line-highlight face compilation-mode-line-fail keymap ,(let ((map (make-sparse-keymap))) (define-key map [mode-line mouse-1] 'eglot-events-buffer) + (define-key map [mode-line mouse-3] + 'eglot-clear-status) map)))) ,@(when (and doing (not done-p)) `("/" -- 2.39.2