From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#12634: Patch for pretty-printing in json.el Date: Thu, 25 Oct 2012 14:08:59 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1351188613 1960 80.91.229.3 (25 Oct 2012 18:10:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Oct 2012 18:10:13 +0000 (UTC) Cc: 12634@debbugs.gnu.org To: Ryan Crum Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 25 20:10:21 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 1TRRsm-0002oC-DW for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Oct 2012 20:10:16 +0200 Original-Received: from localhost ([::1]:35729 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRRsd-0002bm-4d for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Oct 2012 14:10:07 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRRsV-0002ZV-IM for bug-gnu-emacs@gnu.org; Thu, 25 Oct 2012 14:10:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRRsU-0001LQ-4t for bug-gnu-emacs@gnu.org; Thu, 25 Oct 2012 14:09:59 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51596) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRRsU-0001LK-1n for bug-gnu-emacs@gnu.org; Thu, 25 Oct 2012 14:09:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TRRuU-0004Hm-5S for bug-gnu-emacs@gnu.org; Thu, 25 Oct 2012 14:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Oct 2012 18:12:02 +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.135118867416411 (code B ref 12634); Thu, 25 Oct 2012 18:12:02 +0000 Original-Received: (at 12634) by debbugs.gnu.org; 25 Oct 2012 18:11:14 +0000 Original-Received: from localhost ([127.0.0.1]:33614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TRRth-0004Gd-Hz for submit@debbugs.gnu.org; Thu, 25 Oct 2012 14:11:13 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:48751) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TRRtc-0004GI-4E for 12634@debbugs.gnu.org; Thu, 25 Oct 2012 14:11:10 -0400 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q9PI90tn011324; Thu, 25 Oct 2012 14:09:00 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 58220B4278; Thu, 25 Oct 2012 14:09:00 -0400 (EDT) In-Reply-To: (Ryan Crum's message of "Thu, 25 Oct 2012 10:55:39 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4382=0 X-NAI-Spam-Version: 2.2.0.9309 : core <4382> : streams <845326> : uri <1252281> 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 (newer, 2) 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:66043 Archived-At: > 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, =E0 la Lisp ;-) Stefan