From a0a6218af2dfb476573b2e564f43ab82bfcaaca2 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 #670: make eglot-current-server work in notification handlers * eglot.el (eglot--connect): Ensure `eglot--cached-server` bound when calling notification/request methods. --- eglot.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eglot.el b/eglot.el index 20f59956..f926709e 100644 --- a/eglot.el +++ b/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