emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/eglot f594dd7 36/69: jsonrpc-request also calls for def


From: João Távora
Subject: [elpa] externals/eglot f594dd7 36/69: jsonrpc-request also calls for deferred action cleanup
Date: Fri, 22 Jun 2018 11:55:00 -0400 (EDT)

branch: externals/eglot
commit f594dd7f59fa878a085e66e338d251ff1d16017d
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    jsonrpc-request also calls for deferred action cleanup
    
    Noticed by Filipp Gunbin <address@hidden>
    
    * jsonrpc.el (jsonrpc--async-request-1): In the non-local exit
    also return the id.
    (jsonrpc-request): Cleanup deferred actions here too.
---
 jsonrpc.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/jsonrpc.el b/jsonrpc.el
index c032687..beb3d01 100644
--- a/jsonrpc.el
+++ b/jsonrpc.el
@@ -625,7 +625,7 @@ TIMEOUT is nil)."
                                                     method params args)))))
                        (or timer (setq timer (funcall make-timer))) id)
                  (jsonrpc--deferred-actions connection))
-        (cl-return-from jsonrpc--async-request-1 (list nil timer))))
+        (cl-return-from jsonrpc--async-request-1 (list id timer))))
     ;; Really send it
     ;;
     (jsonrpc-connection-send connection (jsonrpc-obj :jsonrpc "2.0"
@@ -677,8 +677,10 @@ DEFERRED is passed to `jsonrpc-async-request', which see."
                   :deferred deferred
                   :timeout timeout))
                 (while t (accept-process-output nil 30)))
-            (pcase-let ((`(,id ,timer) id-and-timer))
-              (when id (remhash id (jsonrpc--request-continuations 
connection)))
+            (pcase-let* ((`(,id ,timer) id-and-timer))
+              (remhash id (jsonrpc--request-continuations connection))
+              (remhash (list deferred (current-buffer))
+                       (jsonrpc--deferred-actions connection))
               (when timer (cancel-timer timer))))))
     (when (eq 'error (car retval))
       (signal 'jsonrpc-error



reply via email to

[Prev in Thread] Current Thread [Next in Thread]