[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot 4bbf810 25/69: Don't return implementation detail
From: |
João Távora |
Subject: |
[elpa] externals/eglot 4bbf810 25/69: Don't return implementation details in jsonrpc-async-request |
Date: |
Fri, 22 Jun 2018 11:54:57 -0400 (EDT) |
branch: externals/eglot
commit 4bbf810fccf371f89f79be28bbc3afcefe12d3a4
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Don't return implementation details in jsonrpc-async-request
* jsonrpc.el (jsonrpc-async-request): Pass everything to
jsonrpc-async-request-1.
(jsonrpc--async-request-1): New function.
(jsonrpc-request): Use it.
---
jsonrpc.el | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/jsonrpc.el b/jsonrpc.el
index f801931..35516d0 100644
--- a/jsonrpc.el
+++ b/jsonrpc.el
@@ -507,9 +507,9 @@ request and a process object.")
method
params
&rest args
- &key success-fn error-fn timeout-fn
- (timeout jrpc-default-request-timeout)
- (deferred nil))
+ &key _success-fn _error-fn
+ _timeout-fn
+ _timeout _deferred)
"Make a request to PROC, expecting a reply, return immediately.
The JSONRPC request is formed by METHOD, a symbol, and PARAMS a
JSON object.
@@ -529,9 +529,21 @@ sent at all, in case it is overridden in the meantime by a
new
request with identical DEFERRED and for the same buffer.
However, in that situation, the original timeout is kept.
+Returns nil."
+ (apply #'jsonrpc--async-request-1 proc method params args))
+
+(cl-defun jsonrpc--async-request-1 (proc
+ method
+ params
+ &rest args
+ &key success-fn error-fn timeout-fn
+ (timeout jrpc-default-request-timeout)
+ (deferred nil))
+ "Does actual work for `jsonrpc-async-request'.
+
Return a list (ID TIMER). ID is the new request's ID, or nil if
the request was deferred. TIMER is a timer object set (or nil, if
-TIMEOUT is nil)"
+TIMEOUT is nil)."
(let* ((id (jsonrpc--next-request-id))
(timer nil)
(make-timer
@@ -604,7 +616,7 @@ DEFERRED is passed to `jsonrpc-async-request', which see."
(catch tag
(setq
id-and-timer
- (jsonrpc-async-request
+ (jsonrpc--async-request-1
proc method params
:success-fn (lambda (result) (throw tag `(done ,result)))
:error-fn
- [elpa] externals/eglot 33ae871 09/69: More flexible jrpc.el and improve eglot.el's doc, (continued)
- [elpa] externals/eglot 33ae871 09/69: More flexible jrpc.el and improve eglot.el's doc, João Távora, 2018/06/22
- [elpa] externals/eglot 3265c1d 10/69: Simpler callback protocol for JSONRPC parameters and results, João Távora, 2018/06/22
- [elpa] externals/eglot e906d25 14/69: Overhaul JSON and JSRONRPC error handling, João Távora, 2018/06/22
- [elpa] externals/eglot 7cd94b9 12/69: Improve jrpc.el's doc (and change jrpc-request's protocol a tiny bit), João Távora, 2018/06/22
- [elpa] externals/eglot 489182d 24/69: New jsonrpc-error error type, João Távora, 2018/06/22
- [elpa] externals/eglot 5cea412 20/69: Fix typos and phrasing in commentary and docstrings, João Távora, 2018/06/22
- [elpa] externals/eglot c30f0f3 23/69: Get rid of jsonrpc.el customization group and timeout, João Távora, 2018/06/22
- [elpa] externals/eglot 5e8fe4c 26/69: Add jsonrpc-tests.el, João Távora, 2018/06/22
- [elpa] externals/eglot 05ff697 29/69: Document current API breaches a bit, João Távora, 2018/06/22
- [elpa] externals/eglot 258e3b0 07/69: Merge master into jsonrpc-refactor (using imerge), João Távora, 2018/06/22
- [elpa] externals/eglot 4bbf810 25/69: Don't return implementation details in jsonrpc-async-request,
João Távora <=
- [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