emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/tomelr 732140041e 07/84: doc: Discover `json-encoding-p


From: ELPA Syncer
Subject: [elpa] externals/tomelr 732140041e 07/84: doc: Discover `json-encoding-pretty-print` variable!
Date: Tue, 3 May 2022 09:58:07 -0400 (EDT)

branch: externals/tomelr
commit 732140041e91528a7ee3c730ce10bac0931698c4
Author: Kaushal Modi <kaushal.modi@gmail.com>
Commit: Kaushal Modi <kaushal.modi@gmail.com>

    doc: Discover `json-encoding-pretty-print` variable!
---
 README.org | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/README.org b/README.org
index 6c0e0711e8..3db9373425 100644
--- a/README.org
+++ b/README.org
@@ -899,7 +899,7 @@ the name matches "scalar" completely or partially, run:
 #+begin_src shell
 make test MATCH=scalar
 #+end_src
-* Helper function
+* COMMENT Helper function
 ** JSON Reference pretty print string
 The ~json-encode-pretty~ function defined here is used to pretty-print
 the above JSON examples.
@@ -908,10 +908,9 @@ the above JSON examples.
 (defun json-encode-pretty (object)
   "Return prettified JSONified version of OBJECT."
   (with-temp-buffer
-    (let ((json-false :false))
-      (insert (json-encode object))
-      (json-pretty-print-buffer)
-      (buffer-substring-no-properties (point-min) (point-max)))))
+    (let ((json-false :false)
+          (json-encoding-pretty-print t))
+      (json-encode object))))
 #+end_src
 * Reference
 [[https://toml.io/en/v1.0.0/][TOML v1.0.0 Spec]]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]