Subject: bug#12634: Patch for pretty-printing in json.el

From: Ryan Crum <[email-masked]>
Date: Sat, 27 Oct 2012 15:31:46 -0400

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

On Thu, Oct 25, 2012 at 2:08 PM, Stefan Monnier <[email-masked]>wrote:

> 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
>