From: João Távora Date: Wed, 13 Jun 2018 17:46:19 +0000 (+0100) Subject: Fix a bug when eglot--request times out X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~503 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b21929955d9fe59ffc79a6759f1b8887bb7699cd;p=emacs.git Fix a bug when eglot--request times out * eglot.el (eglot--request): Better timeout message. (eglot--async-request): Must return the timer. --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index e438c492dd9..7bef2ec08e1 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -737,7 +737,7 @@ happens, the original timer keeps counting). Return (ID TIMER)." (setf (eglot--status server) `(,message t)) server `(:message "error ignored, status set" :id ,id :error ,code))) - (or timer (funcall make-timer))) + (setq timer (or timer (funcall make-timer)))) (eglot--pending-continuations server)) (list id timer))) @@ -758,7 +758,10 @@ DEFERRED is passed to `eglot--async-request', which see." (eglot--async-request server method params :success-fn (lambda (result) (throw done `(done ,result))) - :timeout-fn (lambda () (throw done '(error "Timed out"))) + :timeout-fn (lambda () (throw done + `(error + ,(format "Request id=%s timed out" + (car id-and-timer))))) :error-fn (eglot--lambda (&key code message _data) (throw done `(error ,(format "Ooops: %s: %s" code message))))