From 8de749faa14f6a1566a5a92b84a6f834944eb22f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Wed, 8 Nov 2023 08:22:23 -0600 Subject: [PATCH] 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 -- 2.39.2