From d7b9737e69e44e90c45fab19255a0737c8f854ac Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sat, 11 Aug 2018 14:19:10 +0100 Subject: [PATCH] * lisp/jsonrpc.el (jsonrpc-request): Clarify comment. --- lisp/jsonrpc.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index b41c30c5162..691e7b2830d 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -283,7 +283,7 @@ ignored." (let* ((tag (cl-gensym "jsonrpc-request-catch-tag")) id-and-timer cancelled (retval - (unwind-protect ; protect against user-quit, for example + (unwind-protect (catch tag (setq id-and-timer @@ -310,6 +310,10 @@ ignored." (setq cancelled t) `(cancelled ,cancel-on-input-retval)) (t (while t (accept-process-output nil 30))))) + ;; In normal operation, cancellation is handled by the + ;; timeout function and response filter, but we still have + ;; to protect against user-quit (C-g) or the + ;; `cancel-on-input' case. (pcase-let* ((`(,id ,timer) id-and-timer)) (remhash id (jsonrpc--request-continuations connection)) (remhash (list deferred (current-buffer)) -- 2.39.5