[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 8de749faa14 1/4: Jsonrpc: allow method identifiers to be simply s
From: |
João Távora |
Subject: |
master 8de749faa14 1/4: Jsonrpc: allow method identifiers to be simply strings |
Date: |
Wed, 13 Dec 2023 19:53:45 -0500 (EST) |
branch: master
commit 8de749faa14f6a1566a5a92b84a6f834944eb22f
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Jsonrpc: allow method identifiers to be simply strings
* lisp/jsonrpc.el (jsonrpc-connection-send): Support string methods.
---
lisp/jsonrpc.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el
index 7726712d056..f7ccc8d2745 100644
--- a/lisp/jsonrpc.el
+++ b/lisp/jsonrpc.el
@@ -443,7 +443,9 @@ connection object, called when the process dies.")
(when method
(plist-put args :method
(cond ((keywordp method) (substring (symbol-name method) 1))
- ((and method (symbolp method)) (symbol-name method)))))
+ ((symbolp method) (symbol-name method))
+ ((stringp method) method)
+ (t (error "[jsonrpc] invalid method %s" method)))))
(let* ( (message `(:jsonrpc "2.0" ,@args))
(json (jsonrpc--json-encode message))
(headers