]> git.eshelyaron.com Git - emacs.git/commitdiff
Rename eglot--continuations eglot--pending-continuations
authorJoão Távora <joaotavora@gmail.com>
Wed, 16 Aug 2017 10:36:44 +0000 (11:36 +0100)
committerJoão Távora <joaotavora@gmail.com>
Wed, 16 Aug 2017 12:51:03 +0000 (13:51 +0100)
lisp/progmodes/eglot.el

index f2ef4184d64dc3168dbb383f9a520443ec963f14..166f23ccd8cde6d81ddd4a2a7390335f314856c1 100644 (file)
@@ -67,7 +67,7 @@
 (eglot--define-process-var eglot--expected-bytes nil
   "How many bytes declared by server")
 
-(eglot--define-process-var eglot--continuations (make-hash-table)
+(eglot--define-process-var eglot--pending-continuations (make-hash-table)
   "A hash table of request ID to continuation lambdas")
 
 (eglot--define-process-var eglot--events-buffer nil
   (let* ((response-id (plist-get message :id))
          (err (plist-get message :error))
          (continuations (and response-id
-                             (gethash response-id (eglot--continuations)))))
+                             (gethash response-id (eglot--pending-continuations)))))
     (cond ((and response-id
                 (not continuations))
            (eglot--warn "Ooops no continuation for id %s" response-id))
           (continuations
            (cancel-timer (third continuations))
+           (remhash response-id
+                    (eglot--pending-continuations))
            (cond (err
                   (apply (second continuations) err))
                  (t
          (timeout-fn (or timeout-fn
                          (lambda ()
                            (eglot--warn "Tired of waiting for reply to %s" id)
-                           (remhash id (eglot--continuations process)))))
+                           (remhash id (eglot--pending-continuations process)))))
          (error-fn (or error-fn
                        (cl-function
                         (lambda (&key code message)
                                          timeout-fn
                                        (lambda ()
                                          (throw catch-tag (apply timeout-fn))))))
-               (eglot--continuations process))
+               (eglot--pending-continuations process))
       (unless async-p
         (while t
           (unless (eq (process-status process) 'open)