GNU bug report logs -
#12634
24.2; [FEATURE REQUEST] JSON pretty printer
Previous Next
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
Message #35 received at 12634 <at> debbugs.gnu.org (full text, mbox):
> 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.
Thanks. More questions/remarks:
- 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)?
> I've also created a var called `json-encoding-lisp-style-closings' per your
> request. :-)
Thanks.
> Just let me know if there's anything else.
I think that's enough nitpicking for now.
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.