diff options
author | João Távora <joaotavora@gmail.com> | 2018-08-11 14:19:10 +0100 |
---|---|---|
committer | João Távora <joaotavora@gmail.com> | 2018-08-11 14:57:01 +0100 |
commit | d7b9737e69e44e90c45fab19255a0737c8f854ac (patch) | |
tree | aec6ef7a9a28fb97e5291fe1ca6d2827e475a440 /lisp/jsonrpc.el | |
parent | c580443325a3d071625185876a8f28e04793c625 (diff) | |
download | emacs-d7b9737e69e44e90c45fab19255a0737c8f854ac.tar.gz |
* lisp/jsonrpc.el (jsonrpc-request): Clarify comment.
Diffstat (limited to 'lisp/jsonrpc.el')
-rw-r--r-- | lisp/jsonrpc.el | 6 |
1 files changed, 5 insertions, 1 deletions
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)) |