From 1091226b3a65d9e4a324691a65db46b47e76d9b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sun, 3 May 2020 21:59:29 +0100 Subject: [PATCH] Simplify bug-reporting instructions We assume the user has a recent enough jsonrpc.el that consolidates events and stderr int the same transcript. * README.md (Reporting bugs): Simplify instructions. * eglot.el (eglot-events-buffer): Can work with no server. --- lisp/progmodes/eglot.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index d172f4c7cc8..03609a128c3 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -808,9 +808,15 @@ INTERACTIVE is t if called interactively." (add-hook 'post-command-hook #'maybe-connect 'append nil))))) (defun eglot-events-buffer (server) - "Display events buffer for SERVER." - (interactive (list (eglot--current-server-or-lose))) - (display-buffer (jsonrpc-events-buffer server))) + "Display events buffer for SERVER. +Use current server's or first available Eglot events buffer." + (interactive (list eglot--cached-server)) + (let ((buffer (if server (jsonrpc-events-buffer server) + (cl-find "\\*EGLOT.*events\\*" + (buffer-list) + :key #'buffer-name :test #'string-match)))) + (if buffer (display-buffer buffer) + (eglot--error "Can't find an Eglot events buffer!")))) (defun eglot-stderr-buffer (server) "Display stderr buffer for SERVER." -- 2.39.2