[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master d7b9737 2/2: * lisp/jsonrpc.el (jsonrpc-request): C
From: |
João Távora |
Subject: |
[Emacs-diffs] master d7b9737 2/2: * lisp/jsonrpc.el (jsonrpc-request): Clarify comment. |
Date: |
Sat, 11 Aug 2018 09:57:51 -0400 (EDT) |
branch: master
commit d7b9737e69e44e90c45fab19255a0737c8f854ac
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
* 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 b41c30c..691e7b2 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))