[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot c790274 39/69: jsonrpc--next-request-id is a conn
From: |
João Távora |
Subject: |
[elpa] externals/eglot c790274 39/69: jsonrpc--next-request-id is a connection slot |
Date: |
Fri, 22 Jun 2018 11:55:00 -0400 (EDT) |
branch: externals/eglot
commit c790274a8a9f20a1716e6980265fe6b19bba64db
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
jsonrpc--next-request-id is a connection slot
* jsonrpc.el (jsonrpc-connection): Make jsonrpc--next-request-id a
slot.
(jsonrpc--next-request-id): Remove this variable.
(jsonrpc--async-request-1): Use slot.
---
jsonrpc.el | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/jsonrpc.el b/jsonrpc.el
index beb3d01..a8c86d0 100644
--- a/jsonrpc.el
+++ b/jsonrpc.el
@@ -133,7 +133,7 @@
(require 'subr-x)
(require 'warnings)
(require 'pcase)
-(require 'ert)
+(require 'ert) ; to escape a `condition-case-unless-debug'
(require 'array) ; xor
(defvar jsonrpc-find-connection-functions nil
@@ -206,7 +206,11 @@ FORMAT as the message."
:accessor jsonrpc--deferred-actions
:documentation "Map (DEFERRED BUF) to (FN TIMER ID). FN is\
a saved DEFERRED `async-request' from BUF, to be sent not later\
-than TIMER as ID.")))
+than TIMER as ID.")
+ (-next-request-id
+ :initform 0
+ :accessor jsonrpc--next-request-id
+ :documentation "Next number used for a request")))
(defclass jsonrpc-process-connection (jsonrpc-connection)
((-process
@@ -544,9 +548,6 @@ for sending requests immediately."
(defconst jrpc-default-request-timeout 10
"Time in seconds before timing out a JSONRPC request.")
-(defvar-local jsonrpc--next-request-id 0)
-
-
(cl-defun jsonrpc-async-request (connection
method
params
@@ -593,7 +594,7 @@ TIMEOUT is nil)."
(`(,_ ,timer ,old-id)
(and deferred (gethash (list deferred buf)
(jsonrpc--deferred-actions
connection))))
- (id (or old-id (cl-incf jsonrpc--next-request-id)))
+ (id (or old-id (cl-incf (jsonrpc--next-request-id connection))))
(make-timer
(lambda ( )
(when timeout
- [elpa] externals/eglot 5874af9 32/69: Fix deferred actions (forgot the crucial non-local exit), (continued)
- [elpa] externals/eglot 5874af9 32/69: Fix deferred actions (forgot the crucial non-local exit), João Távora, 2018/06/22
- [elpa] externals/eglot 481f16e 33/69: * eglot.el (eglot-eldoc-function): Remove spurious log message, João Távora, 2018/06/22
- [elpa] externals/eglot c43dff4 35/69: On request timeout, clear it from the deferred actions, João Távora, 2018/06/22
- [elpa] externals/eglot 870c60a 04/69: Merge master into jsonrpc-refactor (using imerge), João Távora, 2018/06/22
- [elpa] externals/eglot 980f3e7 34/69: Fix another merge-related bug in eglot-eldoc-function, João Távora, 2018/06/22
- [elpa] externals/eglot fab7f8b 44/69: Improve Makefile test targets, João Távora, 2018/06/22
- [elpa] externals/eglot d7e1b92 42/69: * jsonrpc.el (jsonrpc-message): Fix formatting bug., João Távora, 2018/06/22
- [elpa] externals/eglot 0ba7964 40/69: * jsonrpc.el (jsonrpc-log-event): Log time of event., João Távora, 2018/06/22
- [elpa] externals/eglot f594dd7 36/69: jsonrpc-request also calls for deferred action cleanup, João Távora, 2018/06/22
- [elpa] externals/eglot dae1de1 41/69: Tweak Makefile to run both tests in a row, João Távora, 2018/06/22
- [elpa] externals/eglot c790274 39/69: jsonrpc--next-request-id is a connection slot,
João Távora <=
- [elpa] externals/eglot 68c266e 45/69: Avoid more catastrophes, João Távora, 2018/06/22
- [elpa] externals/eglot bf9c850 52/69: Get rid of jsonrpc-obj, João Távora, 2018/06/22
- [elpa] externals/eglot 0b474ec 63/69: Fix use of jsonrpc-message in tests, João Távora, 2018/06/22
- [elpa] externals/eglot 44e9647 46/69: Simplify JSONRPC connection shutdown, João Távora, 2018/06/22
- [elpa] externals/eglot 47b957d 65/69: Let's not send Content-type for now., João Távora, 2018/06/22
- [elpa] externals/eglot 61d1276 66/69: Fix another bug in jsonrpc-connection-send, João Távora, 2018/06/22
- [elpa] externals/eglot 2917214 47/69: Merge master into jsonrpc-refactor, João Távora, 2018/06/22
- [elpa] externals/eglot f730fff 48/69: Merge branch 'master' into jsonrpc-refactor, João Távora, 2018/06/22
- [elpa] externals/eglot aaca7de 60/69: Fix ridiculous bug, João Távora, 2018/06/22
- [elpa] externals/eglot d87f4bf 55/69: jsonrpc--log-event should also be private, João Távora, 2018/06/22