Cool, new patch attached. I've consolidated current-separator into current-indentation and created a little private helper function `json--current-whitespace' for the newline/indentation.
I've also created a var called `json-encoding-lisp-style-closings' per your request. :-)
Just let me know if there's anything else.
Thanks,
-Ryan
It looks OK overall, but I do have some comments:
- it would be better not to re-compute json-encoding-current-separator
every time we call json-encode, since that function is called all
the time.
IOW, build it once in an external caller. Or better yet: get rid of
json-encoding-current-separator and add a "\n" at the beginning of
json-encoding-current-indentation instead.
- you can use the "json--" prefix to indicate it is an internal
variable/function.
- You could also prefer to place the closing ] at the end of the
previous line, à la Lisp ;-)
Stefan