From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#40693: 28.0.50; json-encode-alist changes alist Date: Thu, 21 May 2020 23:16:30 +0100 Message-ID: <87imgp2atd.fsf@gmail.com> References: <87a738jotd.fsf@tcd.ie> <87mu6utxd1.fsf@tcd.ie> <83r1w6ziql.fsf@gnu.org> <82572c3f-fb24-0b01-06ec-47067d9219ca@yandex.ru> <83blnazdly.fsf@gnu.org> <87wo5yqrqo.fsf@tcd.ie> <87ftbyavbq.fsf@tcd.ie> <87zha43ira.fsf@gmail.com> <87367t9ej7.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="98745"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.91 (gnu/linux) Cc: darthandrus@gmail.com, 40693@debbugs.gnu.org, Dmitry Gutov To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 22 00:17:10 2020 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 1jbtV0-000PYx-QW for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 May 2020 00:17:10 +0200 Original-Received: from localhost ([::1]:54496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbtUz-0000Gn-So for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 May 2020 18:17:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbtUs-0000BU-Iu for bug-gnu-emacs@gnu.org; Thu, 21 May 2020 18:17:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45933) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jbtUs-0000nf-9b for bug-gnu-emacs@gnu.org; Thu, 21 May 2020 18:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jbtUs-0000Rs-2j for bug-gnu-emacs@gnu.org; Thu, 21 May 2020 18:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 May 2020 22:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40693 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 40693-submit@debbugs.gnu.org id=B40693.15900994011678 (code B ref 40693); Thu, 21 May 2020 22:17:02 +0000 Original-Received: (at 40693) by debbugs.gnu.org; 21 May 2020 22:16:41 +0000 Original-Received: from localhost ([127.0.0.1]:57474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jbtUX-0000R0-4f for submit@debbugs.gnu.org; Thu, 21 May 2020 18:16:41 -0400 Original-Received: from mail-wr1-f65.google.com ([209.85.221.65]:35676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jbtUV-0000Qm-Mo for 40693@debbugs.gnu.org; Thu, 21 May 2020 18:16:40 -0400 Original-Received: by mail-wr1-f65.google.com with SMTP id x14so2841340wrp.2 for <40693@debbugs.gnu.org>; Thu, 21 May 2020 15:16:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=BZmr8an91y5fvoSUkyfO74dCYw7Wii/dcsn82vcII1k=; b=XcrKfr45JB2+zTvdv8A0hj+J4NoL4tMHc338dbcOQKMoNjJzd1273XmI+iDKg0uAdr LeUoytjtNgyt9x2jVs+ftGvMjfA1sPkOIQNI2EsebkxET0GXRNRhnVIWXdUMKSYSemEt fnA24rvsSzMM10mLd6uX+REbHUkUAoAimV8MLt8w4M82G10UtlZksXD9KwzjN0xUF7Ux dw9lT26g26e9qEbIl0HS2Ma2sm5F9qQ4vLngNOoLrhWnlzYfOutyXyPla5dPIjIw0eoX 8zKsZMdxz2bsK5r9SJtp3BR4V0lVeD9A59uVUp2o8f9iViIePnfKrcsqNoOGCcfT7meu Ovjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=BZmr8an91y5fvoSUkyfO74dCYw7Wii/dcsn82vcII1k=; b=XGw25NtIvjxAqnQvyP26lZquqVPpNL8BKa/tlJesCdzgy6jXjPH55jS1YDwow7D2yE 4eCl8tYS02idnNMp6djqoW9eqSu5VFPOnhSvB0MhJfpln7ZqC2qPDMxtOVKKqtQcAc8Q 7HcQuAVejXmfrkRD6J+MWb65ikmhqT+qgjIh/wO6jCRQrWn53k6f2GfVVe29hOj6BDSY zZRZnBGtpuzcxVbYclAMIsF1VX02jeO2Z5FwAtumFGqyB/BdzBnI/v6EIZ/SmRGQNK4g poZ/dIAu5Hlzbyfqx8hSl0+nQc//VzmQAyzi7YQ3IJMNOfxo+KaKi0koft1SFboYe6QF KDVQ== X-Gm-Message-State: AOAM530yWUPa61ZLV481BFx1uHcRZWGMgCF6KyEGYJtN36UVliMlqaGO 9o6o2t336PKHJ/h77DQNL/tQGtutdEQ= X-Google-Smtp-Source: ABdhPJybnZjR12ef5q6enLfCOJFCV/f29y93nmpd1GqDV04kg1DNlWwUzUtW5BnnNa+Y8v8Pxh9skA== X-Received: by 2002:a5d:4d0f:: with SMTP id z15mr560531wrt.411.1590099393548; Thu, 21 May 2020 15:16:33 -0700 (PDT) Original-Received: from krug ([89.180.155.44]) by smtp.gmail.com with ESMTPSA id m13sm7575900wmi.42.2020.05.21.15.16.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 May 2020 15:16:32 -0700 (PDT) In-Reply-To: <87367t9ej7.fsf@tcd.ie> (Basil L. Contovounesios's message of "Thu, 21 May 2020 22:14:20 +0100") 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" Xref: news.gmane.io gmane.emacs.bugs:180722 Archived-At: "Basil L. Contovounesios" writes: > The declarations are needed because the byte-compiler does not know that > loading json.el will e.g. define a dynamically bound variable > json-object-type and a nullary function symbol json-read. It therefore > not only complains but also generates invalid byte-code. Basil, I understand the need for the declarations, but I was suggesting something different. This, at the top, near all the other requires. (eval-and-compile (unless (fboundp 'json-parse-buffer) (require 'json))) and then do the defalias without the declarations below. (defalias blabla (if (fboundp 'json-parse-buffer) (lambda () json-c-things...) (lambda () json-el-things...))) Am I missing something or doesn't this work like you want? We're checking json.c function thrice instead of twice, but doesn't seem very bad, only a 50% increase :-) > But I find this more heavy handed and intrusive, since it > unconditionally loads json.el during byte-compilation, even when > json-parse-buffer is available. I think the snippet above doesn't have this problem. Anyway, this is a minor nitpick, push whatever you think is better. Jo=C3=A3o