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#21488: json-pretty-print-buffer works,but... Date: Sat, 03 Oct 2015 13:54:55 -0400 Message-ID: References: <55F840B1.87A9B6.02747@m50-133.163.com> <87r3lcf4qm.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1443894930 22635 80.91.229.3 (3 Oct 2015 17:55:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 3 Oct 2015 17:55:30 +0000 (UTC) Cc: Junqi Cai , 21488@debbugs.gnu.org To: Simen =?UTF-8?Q?Heggest=C3=B8yl?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 03 19:55:17 2015 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 1ZiR1b-0001oU-3m for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Oct 2015 19:55:11 +0200 Original-Received: from localhost ([::1]:39526 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZiR1a-0004ki-8N for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Oct 2015 13:55:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZiR1W-0004jB-A5 for bug-gnu-emacs@gnu.org; Sat, 03 Oct 2015 13:55:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZiR1T-0006WL-3K for bug-gnu-emacs@gnu.org; Sat, 03 Oct 2015 13:55:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZiR1T-0006W9-0d for bug-gnu-emacs@gnu.org; Sat, 03 Oct 2015 13:55:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZiR1S-0000Jx-Qd for bug-gnu-emacs@gnu.org; Sat, 03 Oct 2015 13:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Oct 2015 17:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21488 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21488-submit@debbugs.gnu.org id=B21488.14438948991221 (code B ref 21488); Sat, 03 Oct 2015 17:55:02 +0000 Original-Received: (at 21488) by debbugs.gnu.org; 3 Oct 2015 17:54:59 +0000 Original-Received: from localhost ([127.0.0.1]:53895 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZiR1O-0000Jc-O9 for submit@debbugs.gnu.org; Sat, 03 Oct 2015 13:54:59 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:60239) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZiR1M-0000JT-P3 for 21488@debbugs.gnu.org; Sat, 03 Oct 2015 13:54:57 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AxFgA731xV/wihxEVcgxCEAoVVu0CHSwQCAoE8OxIBAQEBAQEBgQpBBYNdAQEDAVYjBQsLNBIUGA0kiDcIzyMBAQEHAQEBAR6LOoUFB4QtAQSQNI5jg2uQPYFFI4QUIoJ4AQEB X-IPAS-Result: A0AxFgA731xV/wihxEVcgxCEAoVVu0CHSwQCAoE8OxIBAQEBAQEBgQpBBYNdAQEDAVYjBQsLNBIUGA0kiDcIzyMBAQEHAQEBAR6LOoUFB4QtAQSQNI5jg2uQPYFFI4QUIoJ4AQEB X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="167225069" Original-Received: from 69-196-161-8.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([69.196.161.8]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Oct 2015 13:54:57 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 5522AAE22D; Sat, 3 Oct 2015 13:54:55 -0400 (EDT) In-Reply-To: <87r3lcf4qm.fsf@gmail.com> ("Simen =?UTF-8?Q?Heggest=C3=B8yl?="'s message of "Sat, 03 Oct 2015 15:42:25 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.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:107274 Archived-At: > JSON objects are by definition unordered, but I agree that it would be > nicer if the prettification functions maintained the ordering by > default. Agreed. > @@ -400,7 +401,9 @@ Please see the documentation of `json-object-type' and `json-key-type'." > (signal 'json-object-format (list "," (json-peek)))))) > ;; Skip over the "}" > (json-advance) > - elements)) > + (if (eq json-object-type 'alist) > + (nreverse elements) > + elements))) Don't we also need to reverse (tho differently) if json-object-type is `plist'? Stefan