From unknown Sun Aug 17 01:00:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34160: json-pretty-print deletes everything after first JSON object Resent-From: Albert Heinle Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Jan 2019 18:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34160 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 34160@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.154809361314913 (code B ref -1); Mon, 21 Jan 2019 18:01:01 +0000 Received: (at submit) by debbugs.gnu.org; 21 Jan 2019 18:00:13 +0000 Received: from localhost ([127.0.0.1]:40410 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gldro-0003sT-BT for submit@debbugs.gnu.org; Mon, 21 Jan 2019 13:00:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37413) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gldey-0003Ye-Em for submit@debbugs.gnu.org; Mon, 21 Jan 2019 12:46:56 -0500 Received: from lists.gnu.org ([209.51.188.17]:56624) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gldet-0002SM-6n for submit@debbugs.gnu.org; Mon, 21 Jan 2019 12:46:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gldes-0007IT-9E for bug-gnu-emacs@gnu.org; Mon, 21 Jan 2019 12:46:51 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,FREEMAIL_FROM, HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1glder-0002RL-A1 for bug-gnu-emacs@gnu.org; Mon, 21 Jan 2019 12:46:50 -0500 Received: from mail-ua1-x929.google.com ([2607:f8b0:4864:20::929]:34638) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1glder-0002QN-1i for bug-gnu-emacs@gnu.org; Mon, 21 Jan 2019 12:46:49 -0500 Received: by mail-ua1-x929.google.com with SMTP id c24so7197263uak.1 for ; Mon, 21 Jan 2019 09:46:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=ln+Rk4+tMvXvLv1GgucXzJeOnRsMetnWfQzPjDOi/dI=; b=cdA/Gtsb0sCBz2R7XtySGoYNSlYWYDRNyrFlit77/X1WBiwcwxkJnDJsiyj/x/NKEh Q8TIfh3XxselsaJRwPHph77VyMX9c1Msh5Oez+HoVlgacg6R4octajYc3XceY4d/C56L vUfzzPeG4l7rk+/teUi2+ki8Zivxm690MGvsAivMV9CYkB2U2RjM8yf/Um9rm2pxCLoX GgpuiFYpDsd0Se7PSOPr9r3NV6sjyrHnN2FhcVfkF79bBr7N37M4Ek5JQKWe3uLYMVSm ftF0kfYbCdk9DakURJMxiF57gFp1UCGlibBuN7XtcFlU/LpLAqVCYXZN7l+YCIO1UR8w N9Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ln+Rk4+tMvXvLv1GgucXzJeOnRsMetnWfQzPjDOi/dI=; b=NtBJiEwYje3JYHjBJxuAouVDF9J8unj9+pSqbBJAaE0KkuEv0CBxcU+O76XXTGVnn5 pgV9cbLrA/hbcbmMbS4P35Hpqp92sEn4zHp/EMCllCTrL4wT18gA+vapshkDpiOffdLm OmeCsYqeirEPCooAvu59em4nYVVE7B8y96Gpeig4lUaRty812M+d4J3rXosWutLC4cb7 z5yLz4pLGuQjrOkGp4+YmzwCcd0+ci+6Mz9ZXsM6q1712RkIa/2uK2LlaaA5mwq/Vg84 C3ZW0E3xCCwYbsjoU4GTxQj3Gj03s4yePHMP6H3DEUXBFf0NpJPdCqi3SAe7tFPfiZeL ftVw== X-Gm-Message-State: AJcUukfbe1QTrGAqgj/vdGTDLduN+7Pq7lQQ8uXPC0Gl6EaIYHg9/glF bPhN9iGKsMk4PqJrmgYKZaLDpG87MFktZHz9AcYv1hvt X-Google-Smtp-Source: ALg8bN4LFl695/YI+rDwfPm56cBeAPcxmtACfBcnGSMLGtd87nb6/2GtimWBJ1nNE6Mh7/HaiSAu4AfaOfKHCm5UNDM= X-Received: by 2002:ab0:7698:: with SMTP id v24mr8132895uaq.133.1548092805973; Mon, 21 Jan 2019 09:46:45 -0800 (PST) MIME-Version: 1.0 From: Albert Heinle Date: Mon, 21 Jan 2019 12:46:35 -0500 Message-ID: Content-Type: multipart/alternative; boundary="000000000000c7a076057ffb7103" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::929 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.0 (+) X-Mailman-Approved-At: Mon, 21 Jan 2019 13:00:09 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --000000000000c7a076057ffb7103 Content-Type: text/plain; charset="UTF-8" Dear Emacs-dev team, I have observed the following behavior of the command json-pretty-print (http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/json.el#n740): Write {"a": 1}{"b": 2} into any Emacs buffer. Then, mark the whole section and run M-x json-pretty-print. The line is afterwards altered as { "a": 1 } This means, that any string after the first completely parsed JSON-object is being removed by this function. I would consider this unexpected, because information gets lost after calling a function that is just supposed to prettify things. My Emacs version: GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2017-09-20 on lcy01-07, modified by Debian I also have an Arch-linux system at home where I could also reproduce this behavior. Let me know if you have any other questions. Thank you very much, Albert Heinle --000000000000c7a076057ffb7103 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dear Emacs-dev team,

I have observe= d the following behavior of the command json-pretty-print
<= div>
Write

{"a": 1}{"= b": 2}

into any Emacs buffer. Then, mark the = whole section and run M-x json-pretty-print.
The line is afterwar= ds altered as
{
=C2=A0 "a": 1
}

=
This means, that any string after the first completely parsed JSON-obj= ect is being removed by this function. I would consider this unexpected, be= cause information gets lost after calling a function that is just supposed = to prettify things.

My Emacs version:
GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2017-09-20= on lcy01-07, modified by Debian

I also have an Ar= ch-linux system at home where I could also reproduce this behavior.

Let me know if you have any other questions.
Thank you very much,

Albert Heinle
--000000000000c7a076057ffb7103-- From unknown Sun Aug 17 01:00:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34160: json-pretty-print deletes everything after first JSON object Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Jul 2019 18:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34160 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Albert Heinle Cc: 34160@debbugs.gnu.org Received: via spool by 34160-submit@debbugs.gnu.org id=B34160.15626976744779 (code B ref 34160); Tue, 09 Jul 2019 18:42:01 +0000 Received: (at 34160) by debbugs.gnu.org; 9 Jul 2019 18:41:14 +0000 Received: from localhost ([127.0.0.1]:34192 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkv3B-0001F1-Ur for submit@debbugs.gnu.org; Tue, 09 Jul 2019 14:41:14 -0400 Received: from quimby.gnus.org ([80.91.231.51]:51382) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkv39-0001Es-BU for 34160@debbugs.gnu.org; Tue, 09 Jul 2019 14:41:11 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hkv35-0008Fn-1r; Tue, 09 Jul 2019 20:41:09 +0200 From: Lars Ingebrigtsen References: Date: Tue, 09 Jul 2019 20:41:06 +0200 In-Reply-To: (Albert Heinle's message of "Mon, 21 Jan 2019 12:46:35 -0500") Message-ID: <87bly3qce5.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Albert Heinle writes: > Write > > {"a": 1}{"b": 2} > > into any Emacs buffer. Then, mark the whole section and run M-x json-pretty-print. > The line is afterwards altered as > { > "a": 1 > } Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Albert Heinle writes: > Write > > {"a": 1}{"b": 2} > > into any Emacs buffer. Then, mark the whole section and run M-x json-pretty-print. > The line is afterwards altered as > { > "a": 1 > } I think I've now fixed this on the Emacs trunk. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 09 14:41:31 2019 Received: (at control) by debbugs.gnu.org; 9 Jul 2019 18:41:31 +0000 Received: from localhost ([127.0.0.1]:34195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkv3T-0001FY-6o for submit@debbugs.gnu.org; Tue, 09 Jul 2019 14:41:31 -0400 Received: from quimby.gnus.org ([80.91.231.51]:51396) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkv3R-0001FQ-EZ for control@debbugs.gnu.org; Tue, 09 Jul 2019 14:41:29 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hkv3O-0008Fy-T9 for control@debbugs.gnu.org; Tue, 09 Jul 2019 20:41:28 +0200 Date: Tue, 09 Jul 2019 20:41:26 +0200 Message-Id: <87a7dnqcdl.fsf@mouse.gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #34160 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 34160 fixed close 34160 27.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 34160 fixed close 34160 27.1 quit From unknown Sun Aug 17 01:00:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34160: json-pretty-print deletes everything after first JSON object Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Jul 2019 08:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34160 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: Lars Ingebrigtsen Cc: Albert Heinle , 34160@debbugs.gnu.org Received: via spool by 34160-submit@debbugs.gnu.org id=B34160.156274882819064 (code B ref 34160); Wed, 10 Jul 2019 08:54:02 +0000 Received: (at 34160) by debbugs.gnu.org; 10 Jul 2019 08:53:48 +0000 Received: from localhost ([127.0.0.1]:34814 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hl8MG-0004xQ-C8 for submit@debbugs.gnu.org; Wed, 10 Jul 2019 04:53:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51976) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hl8ME-0004xC-Di for 34160@debbugs.gnu.org; Wed, 10 Jul 2019 04:53:47 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40242) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hl8M7-0001cM-PC; Wed, 10 Jul 2019 04:53:41 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1hl8M4-0001jJ-T7; Wed, 10 Jul 2019 04:53:37 -0400 From: Glenn Morris References: <87bly3qce5.fsf@mouse.gnus.org> X-Spook: Execution Baranyi CipherTAC-2000 Home grown Tremor X-Ran: P^^:+Xn~7Yp6ZC0mQsz/[-U;TcxKugn{}5(%lnawN3wL!tKLF_uG,RT{wOgZ:(TxU,(y_m X-Hue: green X-Attribution: GM Date: Wed, 10 Jul 2019 04:53:36 -0400 In-Reply-To: <87bly3qce5.fsf@mouse.gnus.org> (Lars Ingebrigtsen's message of "Tue, 09 Jul 2019 20:41:06 +0200") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) After the change, test-json-pretty-print-object fails. Ref eg https://hydra.nixos.org/build/95978732 From unknown Sun Aug 17 01:00:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34160: json-pretty-print deletes everything after first JSON object Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Jul 2019 11:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34160 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: Glenn Morris Cc: Albert Heinle , 34160@debbugs.gnu.org Received: via spool by 34160-submit@debbugs.gnu.org id=B34160.156275785417024 (code B ref 34160); Wed, 10 Jul 2019 11:25:01 +0000 Received: (at 34160) by debbugs.gnu.org; 10 Jul 2019 11:24:14 +0000 Received: from localhost ([127.0.0.1]:34919 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlAhp-0004QT-So for submit@debbugs.gnu.org; Wed, 10 Jul 2019 07:24:14 -0400 Received: from quimby.gnus.org ([80.91.231.51]:35944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlAhn-0004QK-Q5 for 34160@debbugs.gnu.org; Wed, 10 Jul 2019 07:24:12 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hlAhi-0008Az-SK; Wed, 10 Jul 2019 13:24:09 +0200 From: Lars Ingebrigtsen References: <87bly3qce5.fsf@mouse.gnus.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXa2djt7eyjoZ/k5OL+ //79/f3Ozcu+vbvUGkYsAAACbUlEQVQ4jbWPQY/bIBCFh0WBayjr3WuWSuYKQeucI/UHxHV3eyWx CleHaJm/38HaVlXV3tqJjZT38d4bw6e/DPx7cDF7Y2q25e03oGiCV2q8/0PUZfeftjq+3Hfq2L2o o3pR6mXsuu44fulGoEXGsaOD1hpV9/OAcZWaOoZf2Ahk7byaVOg6HVZxZR1FKa2U95ruB0Ws+YhQ lOp8mJra3uC1Hn3rUJ4FPWn6T4Te8Bx8iwOvp4n0QIhuB6b96u1g9DTPwXnwIfjANScLdQIn3Tnt mQPVHrZtcUqDnk5bz3jYauD0bGFq1knDc+BnDm7LuGuyage1KdDMnU6nLUuOicSAB9AuTCHA9kT3 4TwLnkJKWmzIwjcENvG8YVwMbhbRJSYiSQBaw0m8PgyCz3FwaR4ag+iBeQDGYT7HNMxcJC7mB0qE LVUxYFEMwyNUASk+JJfgAZgL8CpeJYF4wxQhrSxA8hTzFq/fzkuSoqYoq6s8UWjUQM3DkHOOi0h1 wDkvcxKO3CKKKOPtVnNMOeYKGA8pugjzTCqmLCUdGDFK5DHR13wVj4d9fjzkijXiInHIbb9E5fVa r0tfMdvaLIQjgIBHKQeUWC5YsdTcJ6yyEoElStpJ1l2PtVhpF8RKKwS41Xrtn2xvS7HZNEaEKkDu P8jL57LfX9BYNLJUakIiy7I87eyut9YWUw2tkGtCRDgcqDkXNIVeYn2h76Ef1Frxcil3xVqDpjem VbStbsuu7z9SEmm2WCxmbeBw16Y57ooxxVBeM2Gl8h1ZemNNG4KNWCqnCkTzY2zT1qEoqqZpl1eX pYpWbvr3eQ9bc4h9B6WuB3+i6A6mAAAAAElFTkSuQmCC Date: Wed, 10 Jul 2019 13:24:06 +0200 In-Reply-To: (Glenn Morris's message of "Wed, 10 Jul 2019 04:53:36 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Glenn Morris writes: > After the change, test-json-pretty-print-object fails. > Ref eg https://hydra.nixos.org/build/95978732 Thanks; should be fixed now... Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Glenn Morris writes: > After the change, test-json-pretty-print-object fails. > Ref eg https://hydra.nixos.org/build/95978732 Thanks; should be fixed now... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sun Aug 17 01:00:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34160: About commit bff64115a0ad081282e0f99305f41c8dd1917d67, bug#34160, json.el References: In-Reply-To: Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 31 Jul 2019 07:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34160 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: emacs-devel@gnu.org Cc: Lars Ingebrigtsen , 34160@debbugs.gnu.org Received: via spool by 34160-submit@debbugs.gnu.org id=B34160.15645587574480 (code B ref 34160); Wed, 31 Jul 2019 07:40:01 +0000 Received: (at 34160) by debbugs.gnu.org; 31 Jul 2019 07:39:17 +0000 Received: from localhost ([127.0.0.1]:51505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsjCf-0001AB-8Q for submit@debbugs.gnu.org; Wed, 31 Jul 2019 03:39:17 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsjCc-00019u-CM for 34160@debbugs.gnu.org; Wed, 31 Jul 2019 03:39:15 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45031) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hsjCW-0006Zt-1W; Wed, 31 Jul 2019 03:39:08 -0400 Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:45263) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1hsjCT-0003qi-JE; Wed, 31 Jul 2019 03:39:05 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id 19191223BE; Wed, 31 Jul 2019 03:39:05 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Wed, 31 Jul 2019 03:39:05 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrleeggdduvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgfgggtsehttdertddtredtnecuhfhrohhmpefvrghsshhilhho ucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqnecukfhppedufeegrdduudelrddvge drudelheenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomhgvshhmthhprghu thhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdelkedqthhsughhpe epghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from jiffyarch (j289989.servers.jiffybox.net [134.119.24.195]) by mail.messagingengine.com (Postfix) with ESMTPA id 12226380079; Wed, 31 Jul 2019 03:39:03 -0400 (EDT) From: Tassilo Horn Date: Wed, 31 Jul 2019 09:39:00 +0200 Message-ID: <87ef26ac17.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Lars, when fixing bug#34160 you've reverted my changes that made json pretty printing use replace-region-contents. That had the major benefit that pretty printing the JSON object at point didn't move point. I use that many times a week on large JSON objects using the following command. --8<---------------cut here---------------start------------->8--- (defun th/json-pretty-print-snippet-at-point (&optional minimize) "Pretty-print the json snippet at point." (interactive "P") (save-excursion (when-let ((beg (car (nth 9 (syntax-ppss))))) (goto-char beg) (forward-sexp) (when (looking-back "\n" beg) (backward-char)) (json-pretty-print beg (point) minimize)))) --8<---------------cut here---------------end--------------->8--- AFAICS, the problem in bug#34160 was not caused by my changes (the user used Emacs 24 and not a 27 snapshot) so I see no justification for removing my feature. Could you please reinstall the feature or describe why it is not feasible to keep it? Thanks, Tassilo From unknown Sun Aug 17 01:00:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34160: About commit bff64115a0ad081282e0f99305f41c8dd1917d67, bug#34160, json.el Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 31 Jul 2019 15:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34160 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: Tassilo Horn Cc: larsi@gnus.org, 34160@debbugs.gnu.org, emacs-devel@gnu.org Received: via spool by 34160-submit@debbugs.gnu.org id=B34160.156458755711254 (code B ref 34160); Wed, 31 Jul 2019 15:40:02 +0000 Received: (at 34160) by debbugs.gnu.org; 31 Jul 2019 15:39:17 +0000 Received: from localhost ([127.0.0.1]:52927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsqhA-0002vS-PV for submit@debbugs.gnu.org; Wed, 31 Jul 2019 11:39:17 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47921) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsqh8-0002v8-8w for 34160@debbugs.gnu.org; Wed, 31 Jul 2019 11:39:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hsqh3-0007Ey-2n; Wed, 31 Jul 2019 11:39:09 -0400 Received: from [176.228.60.248] (port=1990 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hsqh1-0002Va-Ti; Wed, 31 Jul 2019 11:39:08 -0400 Date: Wed, 31 Jul 2019 18:38:57 +0300 Message-Id: <837e7yi57y.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87ef26ac17.fsf@gnu.org> (message from Tassilo Horn on Wed, 31 Jul 2019 09:39:00 +0200) References: <87ef26ac17.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Tassilo Horn > Date: Wed, 31 Jul 2019 09:39:00 +0200 > Cc: Lars Ingebrigtsen , 34160@debbugs.gnu.org > > Hi Lars, > > when fixing bug#34160 you've reverted my changes that made json pretty > printing use replace-region-contents. That had the major benefit that > pretty printing the JSON object at point didn't move point. I use that > many times a week on large JSON objects using the following command. > > --8<---------------cut here---------------start------------->8--- > (defun th/json-pretty-print-snippet-at-point (&optional minimize) > "Pretty-print the json snippet at point." > (interactive "P") > (save-excursion > (when-let ((beg (car (nth 9 (syntax-ppss))))) > (goto-char beg) > (forward-sexp) > (when (looking-back "\n" beg) > (backward-char)) > (json-pretty-print beg (point) minimize)))) > --8<---------------cut here---------------end--------------->8--- > > AFAICS, the problem in bug#34160 was not caused by my changes (the user > used Emacs 24 and not a 27 snapshot) so I see no justification for > removing my feature. > > Could you please reinstall the feature or describe why it is not > feasible to keep it? Oops, sorry about that. I think Lars is on vacation. If he doesn't respond in a day or two, I will revert the change until this issue is resolved. From unknown Sun Aug 17 01:00:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34160: About commit bff64115a0ad081282e0f99305f41c8dd1917d67, bug#34160, json.el Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 31 Jul 2019 18:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34160 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: Eli Zaretskii Cc: larsi@gnus.org, 34160@debbugs.gnu.org, emacs-devel@gnu.org Received: via spool by 34160-submit@debbugs.gnu.org id=B34160.156459841331481 (code B ref 34160); Wed, 31 Jul 2019 18:41:02 +0000 Received: (at 34160) by debbugs.gnu.org; 31 Jul 2019 18:40:13 +0000 Received: from localhost ([127.0.0.1]:53068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hstWH-0008Bh-Ez for submit@debbugs.gnu.org; Wed, 31 Jul 2019 14:40:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42240) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hstWF-0008BK-EX for 34160@debbugs.gnu.org; Wed, 31 Jul 2019 14:40:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hstWA-0001WC-6N; Wed, 31 Jul 2019 14:40:06 -0400 Received: from auth1-smtp.messagingengine.com ([66.111.4.227]:49005) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1hstW9-00021x-Bu; Wed, 31 Jul 2019 14:40:05 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id B790822302; Wed, 31 Jul 2019 14:40:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Wed, 31 Jul 2019 14:40:04 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrleehgdduvdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvfffkjghffgfugggtgfesthekgidttdervdenucfhrhhomhepvfgrshhs ihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucfkphepgeeirdektddrje dtrddvheenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomhgvshhmthhprghu thhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdelkedqthhsughhpe epghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.0.107] (p2e504619.dip0.t-ipconnect.de [46.80.70.25]) by mail.messagingengine.com (Postfix) with ESMTPA id 1C5DB380074; Wed, 31 Jul 2019 14:40:03 -0400 (EDT) From: Tassilo Horn Date: Wed, 31 Jul 2019 20:40:00 +0200 Message-ID: <16c4954f400.27dc.69bc538c4644581689883e654f15bce0@gnu.org> In-Reply-To: <837e7yi57y.fsf@gnu.org> References: <87ef26ac17.fsf@gnu.org> <837e7yi57y.fsf@gnu.org> User-Agent: AquaMail/1.20.0-1462 (build: 102100002) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="us-ascii" Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi chaps, > I think Lars is on vacation. If he doesn't respond in a day or two, I > will revert the change until this issue is resolved. Thanks, Eli. If nobody is faster, I'll try to fix bug#34160 on the weekend in a way that satisfies all of us. Bye, Tassilo From unknown Sun Aug 17 01:00:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34160: About commit bff64115a0ad081282e0f99305f41c8dd1917d67, bug#34160, json.el Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 31 Jul 2019 18:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34160 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: Tassilo Horn Cc: 34160@debbugs.gnu.org, emacs-devel@gnu.org Received: via spool by 34160-submit@debbugs.gnu.org id=B34160.156459850031666 (code B ref 34160); Wed, 31 Jul 2019 18:42:01 +0000 Received: (at 34160) by debbugs.gnu.org; 31 Jul 2019 18:41:40 +0000 Received: from localhost ([127.0.0.1]:53072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hstXf-0008Ef-S6 for submit@debbugs.gnu.org; Wed, 31 Jul 2019 14:41:40 -0400 Received: from quimby.gnus.org ([80.91.231.51]:53824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hstXd-0008ET-Gb for 34160@debbugs.gnu.org; Wed, 31 Jul 2019 14:41:37 -0400 Received: from 77.18.62.220.tmi.telenormobil.no ([77.18.62.220] helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hstXZ-0007ss-Id; Wed, 31 Jul 2019 20:41:36 +0200 From: Lars Ingebrigtsen References: <87ef26ac17.fsf@gnu.org> Date: Wed, 31 Jul 2019 20:41:32 +0200 In-Reply-To: <87ef26ac17.fsf@gnu.org> (Tassilo Horn's message of "Wed, 31 Jul 2019 09:39:00 +0200") Message-ID: <87a7cuvyg3.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Tassilo Horn writes: > when fixing bug#34160 you've reverted my changes that made json pretty > printing use replace-region-contents. That had the major benefit that > pretty printing the JSON object at point didn't move [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Tassilo Horn writes: > when fixing bug#34160 you've reverted my changes that made json pretty > printing use replace-region-contents. That had the major benefit that > pretty printing the JSON object at point didn't move point. I use that > many times a week on large JSON objects using the following command. [...] > AFAICS, the problem in bug#34160 was not caused by my changes (the user > used Emacs 24 and not a 27 snapshot) so I see no justification for > removing my feature. The user referred to "http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/json.el#n740", which doesn't look like Emacs 24? > Could you please reinstall the feature or describe why it is not > feasible to keep it? As the bug in question described -- pretty-printing a JSON region would silently delete everything but the first JSON object, which doesn't seem like optimal behaviour for a pretty-printing function. If there's a problem where point is moved unnecessarily, then that should be fixed, of course. Do you have a test case? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sun Aug 17 01:00:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34160: About commit bff64115a0ad081282e0f99305f41c8dd1917d67, bug#34160, json.el Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 31 Jul 2019 18:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34160 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: Tassilo Horn Cc: larsi@gnus.org, 34160@debbugs.gnu.org, emacs-devel@gnu.org Received: via spool by 34160-submit@debbugs.gnu.org id=B34160.156459891732471 (code B ref 34160); Wed, 31 Jul 2019 18:49:01 +0000 Received: (at 34160) by debbugs.gnu.org; 31 Jul 2019 18:48:37 +0000 Received: from localhost ([127.0.0.1]:53084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsteP-0008Re-Ak for submit@debbugs.gnu.org; Wed, 31 Jul 2019 14:48:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsteO-0008RT-4b for 34160@debbugs.gnu.org; Wed, 31 Jul 2019 14:48:36 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hsteI-0005s8-VA; Wed, 31 Jul 2019 14:48:30 -0400 Received: from [176.228.60.248] (port=1795 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hsteH-0002ip-UT; Wed, 31 Jul 2019 14:48:30 -0400 Date: Wed, 31 Jul 2019 21:48:20 +0300 Message-Id: <834l32hwgb.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <16c4954f400.27dc.69bc538c4644581689883e654f15bce0@gnu.org> (message from Tassilo Horn on Wed, 31 Jul 2019 20:40:00 +0200) References: <87ef26ac17.fsf@gnu.org> <837e7yi57y.fsf@gnu.org> <16c4954f400.27dc.69bc538c4644581689883e654f15bce0@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Tassilo Horn > CC: , , <34160@debbugs.gnu.org> > Date: Wed, 31 Jul 2019 20:40:00 +0200 > > > I think Lars is on vacation. If he doesn't respond in a day or two, I > > will revert the change until this issue is resolved. > > Thanks, Eli. If nobody is faster, I'll try to fix bug#34160 on the weekend > in a way that satisfies all of us. Great, thanks. From unknown Sun Aug 17 01:00:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34160: About commit bff64115a0ad081282e0f99305f41c8dd1917d67, bug#34160, json.el Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 31 Jul 2019 19:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34160 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: Lars Ingebrigtsen Cc: 34160@debbugs.gnu.org, emacs-devel@gnu.org Received: via spool by 34160-submit@debbugs.gnu.org id=B34160.15646014304667 (code B ref 34160); Wed, 31 Jul 2019 19:31:01 +0000 Received: (at 34160) by debbugs.gnu.org; 31 Jul 2019 19:30:30 +0000 Received: from localhost ([127.0.0.1]:53110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsuIu-0001DA-AE for submit@debbugs.gnu.org; Wed, 31 Jul 2019 15:30:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57021) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsuIr-0001Ct-F8 for 34160@debbugs.gnu.org; Wed, 31 Jul 2019 15:30:25 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hsuIi-00050p-BE; Wed, 31 Jul 2019 15:30:18 -0400 Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:33567) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1hsuIi-0005Nb-2W; Wed, 31 Jul 2019 15:30:16 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id 57D9D222C4; Wed, 31 Jul 2019 15:30:15 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Wed, 31 Jul 2019 15:30:15 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrleehgddufeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvfffkjghffgfugggtgfesthekgidttdervdenucfhrhhomhepvfgrshhs ihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucffohhmrghinhepghhnuh drohhrghenucfkphepgeeirdektddrjedtrddvheenucfrrghrrghmpehmrghilhhfrhho mhepthhhohhrnhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeeijeefke ejkeegqdeifeehvdelkedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhf mhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.0.107] (p2e504619.dip0.t-ipconnect.de [46.80.70.25]) by mail.messagingengine.com (Postfix) with ESMTPA id 4F2ED80059; Wed, 31 Jul 2019 15:30:14 -0400 (EDT) From: Tassilo Horn Date: Wed, 31 Jul 2019 21:30:12 +0200 Message-ID: <16c4982bea8.27dc.69bc538c4644581689883e654f15bce0@gnu.org> In-Reply-To: <87a7cuvyg3.fsf@mouse.gnus.org> References: <87ef26ac17.fsf@gnu.org> <87a7cuvyg3.fsf@mouse.gnus.org> User-Agent: AquaMail/1.20.0-1462 (build: 102100002) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="us-ascii" Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > The user referred to > "http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/json.el#n740", > which doesn't look like Emacs 24? Ah, might be. >> Could you please reinstall the feature or describe why it is not >> feasible to keep it? > > As the bug in question described -- pretty-printing a JSON region would > silently delete everything but the first JSON object, which doesn't seem > like optimal behaviour for a pretty-printing function. Obviously not. :-) > If there's a problem where point is moved unnecessarily, then that > should be fixed, of course. Do you have a test case? It's not just moving point. replace-region-contents also keeps marks, text properties and fontification intact. So we should definitely be using it here. The loop over all json objects in the region you've added is correct. It's just that I beg you to drop the delete-region / insert in favor of replace-region-contents. json-read advances point until the end of the read json. This can be used to give the right region (not the complete region as I did) to the repeated replace-region-contents calls. Feel free to give it a try. Otherwise I'll do it on the weekend. For a test case for point keeping its position in the json: use my command from my original mail and an arbitrary json file and invoke it while point is somewhere inside the json object. Bye, Tassilo From unknown Sun Aug 17 01:00:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34160: About commit bff64115a0ad081282e0f99305f41c8dd1917d67, bug#34160, json.el Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 31 Jul 2019 20:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34160 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: Tassilo Horn Cc: 34160@debbugs.gnu.org, emacs-devel@gnu.org Received: via spool by 34160-submit@debbugs.gnu.org id=B34160.156460447910258 (code B ref 34160); Wed, 31 Jul 2019 20:22:01 +0000 Received: (at 34160) by debbugs.gnu.org; 31 Jul 2019 20:21:19 +0000 Received: from localhost ([127.0.0.1]:53145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsv66-0002fL-Nd for submit@debbugs.gnu.org; Wed, 31 Jul 2019 16:21:18 -0400 Received: from quimby.gnus.org ([80.91.231.51]:55148) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsv63-0002f5-HW for 34160@debbugs.gnu.org; Wed, 31 Jul 2019 16:21:15 -0400 Received: from 77.18.62.220.tmi.telenormobil.no ([77.18.62.220] helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hsv5z-00005z-Dw; Wed, 31 Jul 2019 22:21:13 +0200 From: Lars Ingebrigtsen References: <87ef26ac17.fsf@gnu.org> <87a7cuvyg3.fsf@mouse.gnus.org> <16c4982bea8.27dc.69bc538c4644581689883e654f15bce0@gnu.org> Date: Wed, 31 Jul 2019 22:21:10 +0200 In-Reply-To: <16c4982bea8.27dc.69bc538c4644581689883e654f15bce0@gnu.org> (Tassilo Horn's message of "Wed, 31 Jul 2019 21:30:12 +0200") Message-ID: <87v9vinefd.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Tassilo Horn writes: > It's not just moving point. replace-region-contents also keeps marks, > text properties and fontification intact. So we should definitely be > using it here. Ah, I see. I only gave that function a cursory look-over when fixing this bug and I didn't quite understand what it was doing here, since I couldn't recall any other pretty-printer doing anything simi [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Tassilo Horn writes: > It's not just moving point. replace-region-contents also keeps marks, > text properties and fontification intact. So we should definitely be > using it here. Ah, I see. I only gave that function a cursory look-over when fixing this bug and I didn't quite understand what it was doing here, since I couldn't recall any other pretty-printer doing anything similar. Sorry for the confusion here; I've now restored the replace-region-contents logic. Or at least I think so; it works with the test cases in this bug report, at least. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sun Aug 17 01:00:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34160: About commit bff64115a0ad081282e0f99305f41c8dd1917d67, bug#34160, json.el Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Aug 2019 04:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34160 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: Lars Ingebrigtsen Cc: 34160@debbugs.gnu.org, emacs-devel@gnu.org Received: via spool by 34160-submit@debbugs.gnu.org id=B34160.156463525911912 (code B ref 34160); Thu, 01 Aug 2019 04:55:01 +0000 Received: (at 34160) by debbugs.gnu.org; 1 Aug 2019 04:54:19 +0000 Received: from localhost ([127.0.0.1]:53366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ht36Y-000363-1k for submit@debbugs.gnu.org; Thu, 01 Aug 2019 00:54:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57926) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ht36W-00035s-Rl for 34160@debbugs.gnu.org; Thu, 01 Aug 2019 00:54:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60040) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ht36R-0003eT-Js; Thu, 01 Aug 2019 00:54:11 -0400 Received: from auth1-smtp.messagingengine.com ([66.111.4.227]:52389) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1ht36R-0007eO-De; Thu, 01 Aug 2019 00:54:11 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id B204F21F82; Thu, 1 Aug 2019 00:54:10 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Thu, 01 Aug 2019 00:54:10 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrleeigdekiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufhffjgfkfgggtgesthdtredttdertdenucfhrhhomhepvfgrshhsihhl ohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucfkphepudefgedrudduledrvd egrdduleehnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhorhhnodhmvghsmhhtphgr uhhthhhpvghrshhonhgrlhhithihqdekieejfeekjeekgedqieefhedvleekqdhtshguhh eppehgnhhurdhorhhgsehfrghsthhmrghilhdrfhhmnecuvehluhhsthgvrhfuihiivgep td X-ME-Proxy: Received: from jiffyarch (j289989.servers.jiffybox.net [134.119.24.195]) by mail.messagingengine.com (Postfix) with ESMTPA id D91CC80059; Thu, 1 Aug 2019 00:54:09 -0400 (EDT) From: Tassilo Horn References: <87ef26ac17.fsf@gnu.org> <87a7cuvyg3.fsf@mouse.gnus.org> <16c4982bea8.27dc.69bc538c4644581689883e654f15bce0@gnu.org> <87v9vinefd.fsf@mouse.gnus.org> Date: Thu, 01 Aug 2019 06:54:08 +0200 In-Reply-To: <87v9vinefd.fsf@mouse.gnus.org> (Lars Ingebrigtsen's message of "Wed, 31 Jul 2019 22:21:10 +0200") Message-ID: <877e7xjxjj.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen writes: Hi Lars, >> It's not just moving point. replace-region-contents also keeps marks, >> text properties and fontification intact. So we should definitely be >> using it here. > > Ah, I see. I only gave that function a cursory look-over when fixing > this bug and I didn't quite understand what it was doing here, since I > couldn't recall any other pretty-printer doing anything similar. No worries! You probably didn't see it more often because it's quite new. But pretty-printing is definitely a very good use-case for it. > Sorry for the confusion here; I've now restored the > replace-region-contents logic. Or at least I think so; it works with > the test cases in this bug report, at least. Yes, it works again. Thanks! It can still be a bit improved in understandability and efficiency. 1. The function passed to replace-region-contents runs on the narrowed buffer anyway, so no need to narrow it yourself. 2. It would be better to create a temporary buffer, json-read repeatedly from the original buffer, json-encode/insert to the temp one, and then return the temp buffer. The reason for point 2 is that if the function passed to replace-region-contents returns a string, it'll put that in a temporary buffer anyhow so that it can use replace-buffer-contents to perform the actual replacement (replace-region-contents is just a wrapper around that). And we might want to cater for the situation where the region starts or ends inside a json object by copying the buffer substring from (point) to end to the temp buffer in case json-read fails. I think right now, we'd lose such half json objects and everything which follows them. Bye, Tassilo From unknown Sun Aug 17 01:00:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34160: About commit bff64115a0ad081282e0f99305f41c8dd1917d67, bug#34160, json.el Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Aug 2019 11:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34160 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: Tassilo Horn Cc: 34160@debbugs.gnu.org, emacs-devel@gnu.org Received: via spool by 34160-submit@debbugs.gnu.org id=B34160.156465789022619 (code B ref 34160); Thu, 01 Aug 2019 11:12:02 +0000 Received: (at 34160) by debbugs.gnu.org; 1 Aug 2019 11:11:30 +0000 Received: from localhost ([127.0.0.1]:53559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ht8zZ-0005sk-TB for submit@debbugs.gnu.org; Thu, 01 Aug 2019 07:11:30 -0400 Received: from quimby.gnus.org ([80.91.231.51]:38026) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ht8zY-0005sd-Uu for 34160@debbugs.gnu.org; Thu, 01 Aug 2019 07:11:29 -0400 Received: from 77.18.62.220.tmi.telenormobil.no ([77.18.62.220] helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ht8zV-0006EY-MJ; Thu, 01 Aug 2019 13:11:28 +0200 From: Lars Ingebrigtsen References: <87ef26ac17.fsf@gnu.org> <87a7cuvyg3.fsf@mouse.gnus.org> <16c4982bea8.27dc.69bc538c4644581689883e654f15bce0@gnu.org> <87v9vinefd.fsf@mouse.gnus.org> <877e7xjxjj.fsf@gnu.org> Date: Thu, 01 Aug 2019 13:11:24 +0200 In-Reply-To: <877e7xjxjj.fsf@gnu.org> (Tassilo Horn's message of "Thu, 01 Aug 2019 06:54:08 +0200") Message-ID: <87ef25nns3.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Tassilo Horn writes: > It can still be a bit improved in understandability and efficiency. > > 1. The function passed to replace-region-contents runs on the narrowed > buffer anyway, so no need to narrow it yourself. > > [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.0 TVD_RCVD_IP Message was received from an IP address -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Tassilo Horn writes: > It can still be a bit improved in understandability and efficiency. > > 1. The function passed to replace-region-contents runs on the narrowed > buffer anyway, so no need to narrow it yourself. > > 2. It would be better to create a temporary buffer, json-read repeatedly > from the original buffer, json-encode/insert to the temp one, and > then return the temp buffer. > > The reason for point 2 is that if the function passed to > replace-region-contents returns a string, it'll put that in a temporary > buffer anyhow so that it can use replace-buffer-contents to perform the > actual replacement (replace-region-contents is just a wrapper around > that). Sounds like a good idea; please go ahead. > And we might want to cater for the situation where the region starts or > ends inside a json object by copying the buffer substring from (point) > to end to the temp buffer in case json-read fails. I think right now, > we'd lose such half json objects and everything which follows them. Yes, that sounds like a good fix. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sun Aug 17 01:00:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34160: About commit bff64115a0ad081282e0f99305f41c8dd1917d67, bug#34160, json.el Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Aug 2019 12:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34160 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: Lars Ingebrigtsen Cc: 34160@debbugs.gnu.org, emacs-devel@gnu.org Received: via spool by 34160-submit@debbugs.gnu.org id=B34160.15646617764563 (code B ref 34160); Thu, 01 Aug 2019 12:17:01 +0000 Received: (at 34160) by debbugs.gnu.org; 1 Aug 2019 12:16:16 +0000 Received: from localhost ([127.0.0.1]:53624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1htA0E-0001BV-BI for submit@debbugs.gnu.org; Thu, 01 Aug 2019 08:16:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59121) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1htA0A-0001BG-Od for 34160@debbugs.gnu.org; Thu, 01 Aug 2019 08:16:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:36634) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1htA05-0006kq-7a; Thu, 01 Aug 2019 08:16:05 -0400 Received: from auth1-smtp.messagingengine.com ([66.111.4.227]:44723) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1htA04-000589-V4; Thu, 01 Aug 2019 08:16:05 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id 8034A21BBF; Thu, 1 Aug 2019 08:16:04 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Thu, 01 Aug 2019 08:16:04 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrleejgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufhffjgfkfgggtgesthdtredttdertdenucfhrhhomhepvfgrshhsihhl ohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucfkphepudefgedrudduledrvd egrdduleehnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhorhhnodhmvghsmhhtphgr uhhthhhpvghrshhonhgrlhhithihqdekieejfeekjeekgedqieefhedvleekqdhtshguhh eppehgnhhurdhorhhgsehfrghsthhmrghilhdrfhhmnecuvehluhhsthgvrhfuihiivgep td X-ME-Proxy: Received: from jiffyarch (j289989.servers.jiffybox.net [134.119.24.195]) by mail.messagingengine.com (Postfix) with ESMTPA id CCB6F80065; Thu, 1 Aug 2019 08:16:03 -0400 (EDT) From: Tassilo Horn References: <87ef26ac17.fsf@gnu.org> <87a7cuvyg3.fsf@mouse.gnus.org> <16c4982bea8.27dc.69bc538c4644581689883e654f15bce0@gnu.org> <87v9vinefd.fsf@mouse.gnus.org> <877e7xjxjj.fsf@gnu.org> <87ef25nns3.fsf@mouse.gnus.org> Date: Thu, 01 Aug 2019 14:16:02 +0200 In-Reply-To: <87ef25nns3.fsf@mouse.gnus.org> (Lars Ingebrigtsen's message of "Thu, 01 Aug 2019 13:11:24 +0200") Message-ID: <8736iljd31.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen writes: >> It can still be a bit improved in understandability and efficiency. >> >> 1. The function passed to replace-region-contents runs on the narrowed >> buffer anyway, so no need to narrow it yourself. >> >> 2. It would be better to create a temporary buffer, json-read repeatedly >> from the original buffer, json-encode/insert to the temp one, and >> then return the temp buffer. >> >> The reason for point 2 is that if the function passed to >> replace-region-contents returns a string, it'll put that in a temporary >> buffer anyhow so that it can use replace-buffer-contents to perform the >> actual replacement (replace-region-contents is just a wrapper around >> that). > > Sounds like a good idea; please go ahead. Will do at the weekend. Bye, Tassilo From unknown Sun Aug 17 01:00:27 2025 X-Loop: help-debbugs@gnu.org Subject: bug#34160: About commit bff64115a0ad081282e0f99305f41c8dd1917d67, bug#34160, json.el Resent-From: Tassilo Horn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Aug 2019 16:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34160 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed To: Lars Ingebrigtsen Cc: 34160@debbugs.gnu.org, emacs-devel@gnu.org Received: via spool by 34160-submit@debbugs.gnu.org id=B34160.156476263426124 (code B ref 34160); Fri, 02 Aug 2019 16:18:01 +0000 Received: (at 34160) by debbugs.gnu.org; 2 Aug 2019 16:17:14 +0000 Received: from localhost ([127.0.0.1]:57636 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1htaF0-0006nI-81 for submit@debbugs.gnu.org; Fri, 02 Aug 2019 12:17:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50862) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1htaEx-0006n6-Uz for 34160@debbugs.gnu.org; Fri, 02 Aug 2019 12:17:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41548) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1htaEs-0007hW-Oz; Fri, 02 Aug 2019 12:17:06 -0400 Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:52069) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1htaEr-0000bK-Gh; Fri, 02 Aug 2019 12:17:06 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id D181F21F5A; Fri, 2 Aug 2019 12:17:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Fri, 02 Aug 2019 12:17:04 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrleelgdejudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufhffjgfkfgggtgesthdtredttdertdenucfhrhhomhepvfgrshhsihhl ohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucfkphepgeeirdektddrjedtrd dvheenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomhgvshhmthhprghuthhh phgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdelkedqthhsughhpeepgh hnuhdrohhrghesfhgrshhtmhgrihhlrdhfmhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from thinkpad-t440p (p2e504619.dip0.t-ipconnect.de [46.80.70.25]) by mail.messagingengine.com (Postfix) with ESMTPA id 3C96B380075; Fri, 2 Aug 2019 12:17:03 -0400 (EDT) From: Tassilo Horn References: <87ef26ac17.fsf@gnu.org> <87a7cuvyg3.fsf@mouse.gnus.org> <16c4982bea8.27dc.69bc538c4644581689883e654f15bce0@gnu.org> <87v9vinefd.fsf@mouse.gnus.org> <877e7xjxjj.fsf@gnu.org> <87ef25nns3.fsf@mouse.gnus.org> <8736iljd31.fsf@gnu.org> Mail-Followup-To: Lars Ingebrigtsen , 34160@debbugs.gnu.org, emacs-devel@gnu.org Date: Fri, 02 Aug 2019 18:16:59 +0200 In-Reply-To: <8736iljd31.fsf@gnu.org> (Tassilo Horn's message of "Thu, 01 Aug 2019 14:16:02 +0200") Message-ID: <87imrfa6f8.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Tassilo Horn writes: Hi Lars, >>> It can still be a bit improved in understandability and efficiency. >>> >>> 1. The function passed to replace-region-contents runs on the narrowed >>> buffer anyway, so no need to narrow it yourself. >>> >>> 2. It would be better to create a temporary buffer, json-read >>> repeatedly from the original buffer, json-encode/insert to the temp >>> one, and then return the temp buffer. >> >> Sounds like a good idea; please go ahead. > > Will do at the weekend. Ok, I did it just now (10065010a6). Seems to work very well. Bye, Tassilo