bug-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Ryan Crum
Subject: bug#12634: Patch for pretty-printing in json.el
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 <monnier@iro.umontreal.ca> 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

Attachment: json-pretty-printing
Description: Binary data


reply via email to

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