]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/jsonrpc.el (jsonrpc-request): Clarify comment.
authorJoão Távora <joaotavora@gmail.com>
Sat, 11 Aug 2018 13:19:10 +0000 (14:19 +0100)
committerJoão Távora <joaotavora@gmail.com>
Sat, 11 Aug 2018 13:57:01 +0000 (14:57 +0100)
lisp/jsonrpc.el

index b41c30c516228f1a72035807c75743d4d73d152f..691e7b2830dce2a765d7c29f75229946a379bc31 100644 (file)
@@ -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))