From: João Távora <joaotavora@gmail.com> Date: Sat, 11 Aug 2018 13:19:10 +0000 (+0100) Subject: * lisp/jsonrpc.el (jsonrpc-request): Clarify comment. X-Git-Tag: emacs-27.0.90~4603 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d7b9737e69e44e90c45fab19255a0737c8f854ac;p=emacs.git * lisp/jsonrpc.el (jsonrpc-request): Clarify comment. --- 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))