From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/elisp/jsonrpc-json-object-format.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 devdocs/elisp/jsonrpc-json-object-format.html (limited to 'devdocs/elisp/jsonrpc-json-object-format.html') diff --git a/devdocs/elisp/jsonrpc-json-object-format.html b/devdocs/elisp/jsonrpc-json-object-format.html new file mode 100644 index 00000000..6ccf6cb5 --- /dev/null +++ b/devdocs/elisp/jsonrpc-json-object-format.html @@ -0,0 +1,15 @@ +

JSONRPC JSON object format

JSONRPC JSON objects are exchanged as Lisp plists (see Property Lists): JSON-compatible plists are handed to the dispatcher functions and, likewise, JSON-compatible plists should be given to jsonrpc-notify, jsonrpc-request, and jsonrpc-async-request.

To facilitate handling plists, this library makes liberal use of cl-lib library (see cl-lib in Common Lisp Extensions for GNU Emacs Lisp) and suggests (but doesn’t force) its clients to do the same. A macro jsonrpc-lambda can be used to create a lambda for destructuring a JSON-object like in this example:

(jsonrpc-async-request
+ myproc :frobnicate `(:foo "trix")
+ :success-fn (jsonrpc-lambda (&key bar baz &allow-other-keys)
+               (message "Server replied back with %s and %s!"
+                        bar baz))
+ :error-fn (jsonrpc-lambda (&key code message _data)
+             (message "Sadly, server reports %s: %s"
+                      code message)))
+
+
+

+ Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc.
Licensed under the GNU GPL license.
+ https://www.gnu.org/software/emacs/manual/html_node/elisp/JSONRPC-JSON-object-format.html +

+
-- cgit v1.2.3