OK, let's try this again.
New patch attached.
- Your patch does not apply to the trunk version of json.el where
alist/plist keys are encoded with a new json-encode-key.
- I don't understand this helper function. Why not store the leading "\n"
directly in json-encoding-current-indentation so that
we can use json-encoding-current-indentation directly instead of
calling json--current-whitespace?
- BTW your patch calls json-encoding-current-indentation as a function in
json-encode-plist.
- OTOH, I wouldn't mind a helper function/macro to consolidate all the
(let ((json-encoding-current-indentation
(if json-encoding-pretty-print
(concat json-encoding-current-indentation
json-encoding-default-indentation)
"")))
in a single spot.
- Why use ", " rather than "," for json-encoding-default-separator?
- json-encoding-default-separator is a bad name since it holds the
*current* separator, rather than the default.
- Why (format "%s" (json--current-whitespace)) rather than
(json--current-whitespace)?