From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ryan Crum Newsgroups: gmane.emacs.bugs Subject: bug#12634: Patch Date: Thu, 13 Dec 2012 21:56:16 -0500 Message-ID: <9DBAAE5C-F22D-43BB-9CBE-79A2AECCD881@ryancrum.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: multipart/mixed; boundary="Apple-Mail=_CDED852E-242B-40C4-B201-C5F03B1319FB" X-Trace: ger.gmane.org 1355454075 8300 80.91.229.3 (14 Dec 2012 03:01:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Dec 2012 03:01:15 +0000 (UTC) To: 12634@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 14 04:01:30 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TjLWj-0006Ph-Gf for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Dec 2012 04:01:29 +0100 Original-Received: from localhost ([::1]:38263 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjLWW-0007xw-87 for geb-bug-gnu-emacs@m.gmane.org; Thu, 13 Dec 2012 22:01:16 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:50076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjLWR-0007x9-Uh for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2012 22:01:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjLWP-0002JC-8k for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2012 22:01:11 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59579) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjLWP-0002J4-5f for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2012 22:01:09 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TjLXI-0008SU-AN for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2012 22:02:04 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Ryan Crum Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Dec 2012 03:02:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12634 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12634-submit@debbugs.gnu.org id=B12634.135545411632494 (code B ref 12634); Fri, 14 Dec 2012 03:02:03 +0000 Original-Received: (at 12634) by debbugs.gnu.org; 14 Dec 2012 03:01:56 +0000 Original-Received: from localhost ([127.0.0.1]:41597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjLX8-0008S1-KU for submit@debbugs.gnu.org; Thu, 13 Dec 2012 22:01:55 -0500 Original-Received: from mail-gg0-f172.google.com ([209.85.161.172]:61348) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjLX4-0008Rr-Fh for 12634@debbugs.gnu.org; Thu, 13 Dec 2012 22:01:51 -0500 Original-Received: by mail-gg0-f172.google.com with SMTP id r1so629660ggn.3 for <12634@debbugs.gnu.org>; Thu, 13 Dec 2012 19:00:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:content-type:subject:date:message-id:to:mime-version:x-mailer :x-gm-message-state; bh=w6GXgqXdQW+J/whzTPB8HCJ2VV30aW7aSVm8Wkf+cPw=; b=eoeyDapWTLwCOmboqPPdl0C7A32ga1fAcX4TbcCtQrO61HVL/rTitu6oMQ/akioMS5 IC0HHq904RFAt3q5gRTzVJDnSlC3rPRI9AzN96o/xMVjiIsB2vQ2eoCryR6VcwHFAS/w KMntyxIn+lJY02dpIhYYSpcPPZB+BKK51CaUBZjQc73CN8qGnIiyIF7YvJuExvt4agiD gp/PSFY2dEiABCFSKphN9Ys68HXaJ+op+dVobcyFifOX4JfjVIoZeZ1/JBIKJeil84Ye iU++yekjGT+jcxhdqEB+V4MC5qOQEmqM0YaKndmFCjafTwBXsQWIT6bomjNBInj2gF40 Huhw== Original-Received: by 10.236.131.239 with SMTP id m75mr4407765yhi.2.1355454053356; Thu, 13 Dec 2012 19:00:53 -0800 (PST) Original-Received: from [192.168.1.46] ([24.49.197.147]) by mx.google.com with ESMTPS id u49sm3397749yhd.18.2012.12.13.19.00.52 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 13 Dec 2012 19:00:52 -0800 (PST) X-Mailer: Apple Mail (2.1278) X-Gm-Message-State: ALoCoQlbrysIlBubgcwni9AGqEzBY5UxiduJBjEFEbgepGJEbprTrOiAB9zP40+hHrAKvPfQ03NK X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:68489 Archived-At: --Apple-Mail=_CDED852E-242B-40C4-B201-C5F03B1319FB Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii The attached patch applied successfully for me against trunk at rev. 111221. --Apple-Mail=_CDED852E-242B-40C4-B201-C5F03B1319FB Content-Disposition: attachment; filename=json-pretty-print.diff Content-Type: application/octet-stream; name="json-pretty-print.diff" Content-Transfer-Encoding: quoted-printable ***=20a/json.el=0A---=20b/json.el=0A***************=0A***=203,9=20****=0A= =20=20;;=20Copyright=20(C)=202006-2012=20Free=20Software=20Foundation,=20= Inc.=0A=20=20=0A=20=20;;=20Author:=20Edward=20O'Connor=20= =0A!=20;;=20Version:=201.3=0A=20=20;;=20Keywords:=20= convenience=0A=20=20=0A=20=20;;=20This=20file=20is=20part=20of=20GNU=20= Emacs.=0A---=203,9=20----=0A=20=20;;=20Copyright=20(C)=202006-2012=20= Free=20Software=20Foundation,=20Inc.=0A=20=20=0A=20=20;;=20Author:=20= Edward=20O'Connor=20=0A!=20;;=20Version:=201.4=0A=20=20= ;;=20Keywords:=20convenience=0A=20=20=0A=20=20;;=20This=20file=20is=20= part=20of=20GNU=20Emacs.=0A***************=0A***=2048,53=20****=0A---=20= 48,54=20----=0A=20=20;;=202006-12-29=20-=20XEmacs=20support,=20from=20= Aidan=20Kehoe=20.=0A=20=20;;=202008-02-21=20-=20= Installed=20in=20GNU=20Emacs.=0A=20=20;;=202011-10-17=20-=20Patch=20= `json-alist-p'=20and=20`json-plist-p'=20to=20avoid=20recursion=20-tzz=0A= +=20;;=202012-10-25=20-=20Added=20pretty-printed=20reformatting=20-Ryan=20= Crum=20(ryan@ryancrum.org)=0A=20=20=0A=20=20;;;=20Code:=0A=20=20=0A= ***************=0A***=2099,104=20****=20If=20this=20has=20the=20same=20= value=20as=20`json-false',=20you=20might=20not=20be=20able=20to=0A---=20= 100,122=20----=0A=20=20tell=20the=20difference=20between=20`false'=20and=20= `null'.=20=20Consider=20let-binding=0A=20=20this=20around=20your=20call=20= to=20`json-read'=20instead=20of=20`setq'ing=20it.")=0A=20=20=0A+=20= (defvar=20json-encoding-separator=20","=0A+=20=20=20"Value=20to=20use=20= as=20an=20element=20seperator=20when=20encoding.")=0A+=20=0A+=20(defvar=20= json-encoding-default-indentation=20"=20=20"=0A+=20=20=20"The=20default=20= indentation=20level=20for=20encoding.=0A+=20Used=20only=20when=20= `json-encoding-pretty-print'=20is=20non-nil.")=0A+=20=0A+=20(defvar=20= json--encoding-current-indentation=20"\n"=0A+=20=20=20"Internally=20used=20= to=20keep=20track=20of=20the=20current=20indentation=20level=20of=20= encoding.=0A+=20Used=20only=20when=20`json-encoding-pretty-print'=20is=20= non-nil.")=0A+=20=0A+=20(defvar=20json-encoding-pretty-print=20nil=0A+=20= =20=20"If=20non-nil,=20then=20the=20output=20of=20`json-encode'=20will=20= be=20pretty-printed.")=0A+=20=0A+=20(defvar=20= json-encoding-lisp-style-closings=20nil=0A+=20=20=20"If=20non-nil,=20]=20= and=20}=20closings=20will=20be=20formatted=20lisp-style,=20without=20= indentation.")=0A+=20=0A=20=20=0C=0A=20=20=0A=20=20;;;=20Utilities=0A= ***************=0A***=20124,129=20****=20this=20around=20your=20call=20= to=20`json-read'=20instead=20of=20`setq'ing=20it.")=0A---=20142,155=20= ----=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= 'not-plist)))=0A=20=20=20=20(null=20list))=0A=20=20=0A+=20(defmacro=20= json--with-indentation=20(body)=0A+=20=20=20`(let=20= ((json--encoding-current-indentation=0A+=20=20=20=20=20=20=20=20=20=20=20= (if=20json-encoding-pretty-print=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(concat=20json--encoding-current-indentation=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= json-encoding-default-indentation)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20"")))=0A+=20=20=20=20=20=20,body))=0A+=20=0A=20=20;;=20Reader=20= utilities=0A=20=20=0A=20=20(defsubst=20json-advance=20(&optional=20n)=0A= ***************=0A***=20402,442=20****=20Please=20see=20the=20= documentation=20of=20`json-object-type'=20and=20`json-key-type'."=0A=20=20= =0A=20=20(defun=20json-encode-hash-table=20(hash-table)=0A=20=20=20=20= "Return=20a=20JSON=20representation=20of=20HASH-TABLE."=0A!=20=20=20= (format=20"{%s}"=0A=20=20=20=20=20=20=20=20=20=20=20=20(json-join=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20(let=20(r)=0A!=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(maphash=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (lambda=20(k=20v)=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (push=20(format=20"%s:%s"=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(json-encode-key=20k)=0A= !=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(json-encode=20v))=0A!=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20r))=0A!=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20hash-table)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20r)=0A!=20=20=20=20=20=20=20=20=20=20=20=20",=20")))=0A=20=20=0A=20=20= ;;=20List=20encoding=20(including=20alists=20and=20plists)=0A=20=20=0A=20= =20(defun=20json-encode-alist=20(alist)=0A=20=20=20=20"Return=20a=20JSON=20= representation=20of=20ALIST."=0A!=20=20=20(format=20"{%s}"=0A!=20=20=20=20= =20=20=20=20=20=20=20(json-join=20(mapcar=20(lambda=20(cons)=0A!=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(format=20"%s:%s"=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(json-encode-key=20(car=20cons))=0A!=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(json-encode=20(cdr=20cons))))=0A!=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20alist)=0A!=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20",=20")))=0A= =20=20=0A=20=20(defun=20json-encode-plist=20(plist)=0A=20=20=20=20= "Return=20a=20JSON=20representation=20of=20PLIST."=0A=20=20=20=20(let=20= (result)=0A!=20=20=20=20=20(while=20plist=0A!=20=20=20=20=20=20=20(push=20= (concat=20(json-encode-key=20(car=20plist))=0A!=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20":"=0A!=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(json-encode=20(cadr=20plist)))=0A!=20=20= =20=20=20=20=20=20=20=20=20=20=20result)=0A!=20=20=20=20=20=20=20(setq=20= plist=20(cddr=20plist)))=0A!=20=20=20=20=20(concat=20"{"=20(json-join=20= (nreverse=20result)=20",=20")=20"}")))=0A=20=20=0A=20=20(defun=20= json-encode-list=20(list)=0A=20=20=20=20"Return=20a=20JSON=20= representation=20of=20LIST.=0A---=20428,497=20----=0A=20=20=0A=20=20= (defun=20json-encode-hash-table=20(hash-table)=0A=20=20=20=20"Return=20a=20= JSON=20representation=20of=20HASH-TABLE."=0A!=20=20=20(format=20"{%s%s}"=0A= =20=20=20=20=20=20=20=20=20=20=20=20(json-join=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20(let=20(r)=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (json--with-indentation=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (maphash=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(lambda=20(k=20= v)=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(push=20= (format=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(if=20json-encoding-pretty-print=0A!=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20"%s%s:=20%s"=0A= !=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20"%s%s:%s")=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20json--encoding-current-indentation=0A!=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (json-encode-key=20k)=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(json-encode=20v))=0A!=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20r))=0A!=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20hash-table))=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20r)=0A!=20=20=20=20=20=20=20=20=20=20=20=20= json-encoding-separator)=0A!=20=20=20=20=20=20=20=20=20=20=20(if=20(or=20= (not=20json-encoding-pretty-print)=0A!=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20json-encoding-lisp-style-closings)=0A!=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20""=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20= json--encoding-current-indentation)))=0A=20=20=0A=20=20;;=20List=20= encoding=20(including=20alists=20and=20plists)=0A=20=20=0A=20=20(defun=20= json-encode-alist=20(alist)=0A=20=20=20=20"Return=20a=20JSON=20= representation=20of=20ALIST."=0A!=20=20=20(format=20"{%s%s}"=0A!=20=20=20= =20=20=20=20=20=20=20=20(json-join=0A!=20=20=20=20=20=20=20=20=20=20=20=20= (json--with-indentation=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20= (mapcar=20(lambda=20(cons)=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(format=20(if=20json-encoding-pretty-print=0A!=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20"%s%s:=20%s"=0A!=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= "%s%s:%s")=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20json--encoding-current-indentation=0A!=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(json-encode-key=20(car=20cons))=0A!=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (json-encode=20(cdr=20cons))))=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20alist))=0A!=20=20=20=20=20=20=20=20=20=20=20=20= json-encoding-separator)=0A!=20=20=20=20=20=20=20=20=20=20=20(if=20(or=20= (not=20json-encoding-pretty-print)=0A!=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20json-encoding-lisp-style-closings)=0A!=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20""=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20= json--encoding-current-indentation)))=0A=20=20=0A=20=20(defun=20= json-encode-plist=20(plist)=0A=20=20=20=20"Return=20a=20JSON=20= representation=20of=20PLIST."=0A=20=20=20=20(let=20(result)=0A!=20=20=20=20= =20(json--with-indentation=0A!=20=20=20=20=20=20=20(while=20plist=0A!=20=20= =20=20=20=20=20=20=20(push=20(concat=0A!=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20json--encoding-current-indentation=0A!=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(json-encode-key=20(car=20plist))=0A!=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(if=20json-encoding-pretty-print=0A= !=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20":=20"=0A!=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20":")=0A!=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(json-encode=20(cadr=20plist)))=0A!=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20result)=0A!=20=20=20=20=20=20=20=20= =20(setq=20plist=20(cddr=20plist))))=0A!=20=20=20=20=20(concat=20"{"=0A!=20= =20=20=20=20=20=20=20=20=20=20=20=20(json-join=20(nreverse=20result)=20= json-encoding-separator)=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20= (and=20json-encoding-pretty-print=0A!=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(not=20json-encoding-lisp-style-closings))=0A= !=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= json--encoding-current-indentation=0A!=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20"")=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20"}")))=0A=20=20=0A= =20=20(defun=20json-encode-list=20(list)=0A=20=20=20=20"Return=20a=20= JSON=20representation=20of=20LIST.=0A***************=0A***=20475,481=20= ****=20become=20JSON=20objects."=0A=20=20=0A=20=20(defun=20= json-encode-array=20(array)=0A=20=20=20=20"Return=20a=20JSON=20= representation=20of=20ARRAY."=0A!=20=20=20(concat=20"["=20(mapconcat=20= 'json-encode=20array=20",=20")=20"]"))=0A=20=20=0A=20=20=0C=0A=20=20=0A= ---=20530,551=20----=0A=20=20=0A=20=20(defun=20json-encode-array=20= (array)=0A=20=20=20=20"Return=20a=20JSON=20representation=20of=20ARRAY."=0A= !=20=20=20(if=20(and=20json-encoding-pretty-print=0A!=20=20=20=20=20=20=20= =20=20=20=20=20(>=20(length=20array)=200))=0A!=20=20=20=20=20=20=20= (concat=0A!=20=20=20=20=20=20=20=20(json--with-indentation=0A!=20=20=20=20= =20=20=20=20=20=20(concat=20(format=20"[%s"=20= json--encoding-current-indentation)=0A!=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(json-join=20(mapcar=20'json-encode=20array)=0A!=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(format=20"%s%s"=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= json-encoding-separator=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= json--encoding-current-indentation))))=0A!=20=20=20=20=20=20=20=20= (format=20"%s]"=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(if=20= json-encoding-lisp-style-closings=0A!=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20""=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20json--encoding-current-indentation)))=0A!=20=20=20=20=20(concat=20= "["=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20(mapconcat=20'json-encode=20= array=20json-encoding-separator)=0A!=20=20=20=20=20=20=20=20=20=20=20=20=20= "]")))=0A=20=20=0A=20=20=0C=0A=20=20=0A***************=0A***=20542,547=20= ****=20Advances=20point=20just=20past=20JSON=20object."=0A---=20612,644=20= ----=0A=20=20=20=20=20=20=20=20=20=20((listp=20object)=20=20=20=20=20=20=20= =20(json-encode-list=20object))=0A=20=20=20=20=20=20=20=20=20=20(t=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(signal=20= 'json-error=20(list=20object)))))=0A=20=20=0A+=20;;=20Pretty=20printing=0A= +=20=0A+=20(defun=20json-pretty-print-buffer=20()=0A+=20=20=20= "Pretty-print=20current=20buffer."=0A+=20=20=20(interactive)=0A+=20=20=20= (let*=20((json-encoding-pretty-print=20t)=0A+=20=20=20=20=20=20=20=20=20=20= (json-string=20(json-encode=20(json-read-from-string=20= (buffer-string))))=0A+=20=20=20=20=20=20=20=20=20=20(buf=20= (current-buffer)))=0A+=20=20=20=20=20(with-current-buffer=20buf=0A+=20=20= =20=20=20=20=20(erase-buffer)=0A+=20=20=20=20=20=20=20(insert=20= json-string))))=0A+=20=0A+=20(defun=20json-pretty-print=20()=0A+=20=20=20= "Pretty-print=20selected=20region."=0A+=20=20=20(interactive)=0A+=20=20=20= (unless=20mark-active=0A+=20=20=20=20=20(error=20"No=20region=20= selected."))=0A+=20=20=20(let=20((begin=20(region-beginning))=0A+=20=20=20= =20=20=20=20=20=20(end=20(region-end))=0A+=20=20=20=20=20=20=20=20=20= (json-encoding-pretty-print=20t))=0A+=20=20=20=20=20(kill-region=20begin=20= end)=0A+=20=20=20=20=20(condition-case-unless-debug=20err=0A+=20=20=20=20= =20=20=20=20=20(insert=20(json-encode=20(json-read-from-string=20= (current-kill=200))))=0A+=20=20=20=20=20=20=20(error=0A+=20=20=20=20=20=20= =20=20=20(insert=20(current-kill=200))=0A+=20=20=20=20=20=20=20=20=20= (error=20"Unable=20to=20parse=20JSON.")))))=0A+=20=0A=20=20(provide=20= 'json)=0A=20=20=0A=20=20;;;=20json.el=20ends=20here=0A= --Apple-Mail=_CDED852E-242B-40C4-B201-C5F03B1319FB Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii --Apple-Mail=_CDED852E-242B-40C4-B201-C5F03B1319FB--