GNU bug report logs - #12634
24.2; [FEATURE REQUEST] JSON pretty printer

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Sat, 13 Oct 2012 08:41:01 UTC

Severity: wishlist

Found in version 24.2

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Ryan Crum <ryan.j.crum <at> gmail.com>
Cc: 12634 <at> debbugs.gnu.org
Subject: bug#12634: Patch for pretty-printing in json.el
Date: Thu, 25 Oct 2012 14:08:59 -0400
> I've consolidated my changes into json.el.  I have not yet received
> the form for copyright assignment in the mail, but I have
> requested it.

Great, thanks.

> Please advise me if you'd like me to make any changes here, and I'll
> be happy to accomodate.  Patch attached.

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




This bug report was last modified 12 years and 219 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.