From 740e975fbcb3079d1277f60c9438e46f146f0125 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Wed, 25 Jan 2023 00:05:32 +0100 Subject: Add docstring --- compat.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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")) -- cgit v1.0