From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#70007: [PATCH] native JSON encoder Date: Tue, 2 Apr 2024 19:19:03 +0200 Message-ID: <850DEC32-F318-4F3E-BA87-55FC6DC74CD3@gmail.com> References: <1BF559D1-DB9F-4FEB-90ED-72E0EFD76424@gmail.com> <86wmpphrg7.fsf@gnu.org> <4589243D-C11A-45C1-AF3E-6F4A5BADEB54@gmail.com> <864jcrindg.fsf@gnu.org> <291DD5F1-85B8-4647-A40A-EBBD4C51E253@gmail.com> <8634sbijfx.fsf@gnu.org> <2CF47DA5-A65B-47C4-A28A-6FEE1469BD13@gmail.com> <86cyrdfuai.fsf@gnu.org> <3139C8FE-5C67-4FE3-B940-F449DA73E76C@gmail.com> <86le5zdfbi.fsf@gnu.org> <4C93E902-282D-4408-B449-C8E771B2B3E4@gmail.com> <86cyr7agjo.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22416"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, 70007@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 02 19:20:29 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rrhoB-0005Nc-VF for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Apr 2024 19:20:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rrhnq-0002Lb-6r; Tue, 02 Apr 2024 13:20:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rrhnm-0002LA-HP for bug-gnu-emacs@gnu.org; Tue, 02 Apr 2024 13:20:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rrhnk-0007RW-8j for bug-gnu-emacs@gnu.org; Tue, 02 Apr 2024 13:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rrhnn-0004Sj-8d for bug-gnu-emacs@gnu.org; Tue, 02 Apr 2024 13:20:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Apr 2024 17:20:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70007 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 70007-submit@debbugs.gnu.org id=B70007.171207836016918 (code B ref 70007); Tue, 02 Apr 2024 17:20:03 +0000 Original-Received: (at 70007) by debbugs.gnu.org; 2 Apr 2024 17:19:20 +0000 Original-Received: from localhost ([127.0.0.1]:56132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrhn5-0004Ob-7e for submit@debbugs.gnu.org; Tue, 02 Apr 2024 13:19:20 -0400 Original-Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:60882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrhn2-0004Nv-L2 for 70007@debbugs.gnu.org; Tue, 02 Apr 2024 13:19:17 -0400 Original-Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-516a0b7f864so2360455e87.1 for <70007@debbugs.gnu.org>; Tue, 02 Apr 2024 10:19:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712078347; x=1712683147; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=eip8XF+fdQbsw8sTVeeFplConaC/dOIoJk19myoPvd0=; b=AeeSHmD3nUs7VvbQN+CaDw6MjH9D3I/SavJEwJbdwKh6HwnoSynA8gaycZRcTmeKrv EeeJyG5zROMFP1H1UFHQTyTDLe+MTA8dccZu/nYNCEspSZkn2yE38F1iwwGdWU39kgZL 9zBCCPYeG1GEvlSsxidWTsu8crLiH3EtNtwTckRN4TO8QLVW3aMyqJIWMUjJXFaId+Lr hfTDxs9hLDF+ffDAp22G52QIse/viQ3JANj5OgOK8WX8KfqjXG/kUyogPzqLLvDXDqSK 4Hbcmi0FPyyVJJfOhA5WxPzhMOu3bhw/jPVKkw30DRdQGFlisWS8Y2kDNuxIn+5fOUoF caFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712078347; x=1712683147; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=eip8XF+fdQbsw8sTVeeFplConaC/dOIoJk19myoPvd0=; b=D0q8NYLfjjsrM8yzlt9s/dOZOkVEsIaf5DrTUSGFr+5AOMDKiq2oaXA6iglt9JkevH w28gPECTxgdpBXPBENJVwOf2dhN63F89XPKEL3nUwD888CjjupCF+2Tfk4iR7bkN7pAx qaApx/5K5ImheIdri9hgD7qfN6LA32fhYlUmcUs9OioDhEmyW59WuVZYr+L9Dtt9oTOl xEnC6WS0uWy5pKAOyVMogbAOd4tO4DqUjjpossr1vm4t9etFSVRjbYBsQ4IAqTto66wN sTqOI1H5B525r/RuUfQTYU7Xeiy+ySTvbh42QYQhBbo/DIYoq/FuZJka/2ih3cx2Q7Vw y1bg== X-Forwarded-Encrypted: i=1; AJvYcCU+/7+8Oo9AkPUsGOdBwofMOfKRPhD/FjnSvqMz9eWz25UhY9lZ5ssFYDO0t05R4Fltqm7NG62x9pWuajEqv56wwjL47y4= X-Gm-Message-State: AOJu0YzRAf++mflbMyIjBLqj1ogG33cREYmH3s0r3b7XY0Ew6UMKSEYI jDYS+fUvw+Z5YZOc1pVjbpysRUTwckRIIhq3xdyAcPd2QbPv29qE X-Google-Smtp-Source: AGHT+IH+rj5u2GoseylIExHx7COsgCQDywopljOGXwbQhhryS9AWM9qpymY5+1up9j9TLhrNg+KqqA== X-Received: by 2002:a05:6512:23a1:b0:512:d877:df6f with SMTP id c33-20020a05651223a100b00512d877df6fmr11488394lfv.2.1712078344413; Tue, 02 Apr 2024 10:19:04 -0700 (PDT) Original-Received: from smtpclient.apple (c80-217-1-132.bredband.tele2.se. [80.217.1.132]) by smtp.gmail.com with ESMTPSA id t7-20020a19ad07000000b00516a25e592fsm913815lfc.306.2024.04.02.10.19.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Apr 2024 10:19:03 -0700 (PDT) In-Reply-To: <86cyr7agjo.fsf@gnu.org> X-Mailer: Apple Mail (2.3654.120.0.1.15) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:282534 Archived-At: 2 apr. 2024 kl. 18.13 skrev Eli Zaretskii : >> This made me look at the Fjson_insert logic a bit. I'm probably = betraying my lack of knowledge about buffer subtleties here, but since = the serialiser always produces (correct) UTF-8, shouldn't it be enough = to copy the bytes, don't bother with any decoding, and perform the = buffer insertion ceremonies? >=20 > Yes, I think that's true. Thank you, now pushed with added tests. > One nit, though: if the result could be an empty string, then we > should not do anything at all, not even invalidate_buffer_caches. I don't think json-insert can ever end up inserting the empty string = (unless it signals, and then we won't get to the insertion stage). But I = added an assertion for this.