aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2023-01-25 00:05:32 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2023-01-25 00:06:03 +0100
commit740e975fbcb3079d1277f60c9438e46f146f0125 (patch)
treef4769192e509683e0b70a4fd54b8a94fc2ee44c8
parent7e678b3fa102a86553921d6c24056bbbe5365c7e (diff)
Add docstring
-rw-r--r--compat.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/compat.el b/compat.el
index 1e38672..d2c8bb8 100644
--- a/compat.el
+++ b/compat.el
@@ -89,10 +89,14 @@ See also `compat-function' to lookup compatibility functions."
(defvar json-object-type)
(defvar json-key-type)
(declare-function json-read nil)
-
(declare-function compat--json--print nil)
+
(unless (eval-when-compile (ignore-errors (eval '(json-parse-string "[]") t)))
(defun compat--json--print (obj)
+ "Print OBJ to the current-buffer/standard-output.
+We provide our entire reimplementation of `json--print' and
+`json-encode', since the error checking and the format of
+libjansson and json.el differ too much."
(cond
((numberp obj) (prin1 obj))
((eq obj t) (insert "true"))