From: João Távora Date: Wed, 8 Nov 2023 14:22:23 +0000 (-0600) Subject: Jsonrpc: allow method identifiers to be simply strings X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8de749faa14f6a1566a5a92b84a6f834944eb22f;p=emacs.git Jsonrpc: allow method identifiers to be simply strings * lisp/jsonrpc.el (jsonrpc-connection-send): Support string methods. --- 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