From 814dee21dabf4e787ee92629f78a17aff6cfbf7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Tue, 20 Apr 2021 18:39:54 +0100 Subject: [PATCH] Fix https://github.com/joaotavora/eglot/issues/670: make eglot-current-server work in notification handlers * eglot.el (eglot--connect): Ensure `eglot--cached-server` bound when calling notification/request methods. --- lisp/progmodes/eglot.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 20f59956f8..f926709e8c 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -945,7 +945,8 @@ This docstring appeases checkdoc, that's all." (format "*%s stderr*" readable-name)) :file-handler t))))))) (spread (lambda (fn) (lambda (server method params) - (apply fn server method (append params nil))))) + (let ((eglot--cached-server server)) + (apply fn server method (append params nil)))))) (server (apply #'make-instance class