Function: json--with-indentation

json--with-indentation is a macro defined in json.el.gz.

Signature

(json--with-indentation &rest BODY)

Documentation

Eval BODY with the JSON encoding nesting incremented by one step.

This macro sets up appropriate variable bindings for json--print-indentation to produce the correct indentation when json-encoding-pretty-print is non-nil.

Source Code

;; Defined in /usr/src/emacs/lisp/json.el.gz
(defmacro json--with-indentation (&rest body)
  "Eval BODY with the JSON encoding nesting incremented by one step.
This macro sets up appropriate variable bindings for
`json--print-indentation' to produce the correct indentation when
`json-encoding-pretty-print' is non-nil."
  (declare (debug t) (indent 0))
  `(let ((json--print-indentation-prefix
          (if json-encoding-pretty-print json--print-indentation-prefix ""))
         (json--print-keyval-separator (if json-encoding-pretty-print ": " ":"))
         (json--print-indentation-depth (1+ json--print-indentation-depth)))
     ,@body))