From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 3iM2BtYDomNuLwEAbAwnHQ (envelope-from ) for ; Tue, 20 Dec 2022 19:49:58 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id sDI2BdYDomMzKAAAauVa8A (envelope-from ) for ; Tue, 20 Dec 2022 19:49:58 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BBD6CEF62 for ; Tue, 20 Dec 2022 19:49:57 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p7g2a-0008Th-H5; Tue, 20 Dec 2022 12:04:32 -0500 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 1p7g2X-0008TT-Jt for emacs-orgmode@gnu.org; Tue, 20 Dec 2022 12:04:29 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p7g2L-0001NP-82 for emacs-orgmode@gnu.org; Tue, 20 Dec 2022 12:04:29 -0500 Received: by mail-wm1-x335.google.com with SMTP id m5-20020a7bca45000000b003d2fbab35c6so9320536wml.4 for ; Tue, 20 Dec 2022 09:04:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=0wxkNK9NcnQDvytAHVpqsWcvwyUn/N92rS1W9IfkDMg=; b=D5mV4qp++ZMAC3PcmH14IVVwRvS8aMt3ARdUbw9gIANrk5jCY/v0zFVKII15v+yTFm pV2VyRhAsyWw5cO/LgTY0I8DaIwINi0eo9/NrboafyzMhdyaqGeulrXgPMFQHBs/T1df Vb12hqF2W1DVYTNmHVvR70IGMmYq78aR4zjcn26qBEhnjAZ0PdtSAuTDIcBJ9q3OLBLm YrBVBOw570hCzvmIhxmB6w1F65Ky8Y0Vvzvo01g8SRMxEG4rqSkv8DMvVmF6pBONIB/B Za/QrGSA3fBNnZZscqXuG/tD3rHSn0mTtWA2bqb0YkHX2dLNkOQtbXXGrmaANbbIs4rH pL/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=0wxkNK9NcnQDvytAHVpqsWcvwyUn/N92rS1W9IfkDMg=; b=4loSJQrkB0Kynwn5e/Y4cIEd21CAXYAVUePeXsAuko5d8Eha1nZUgb/mwA65cxe0wb KpHSipd+I5t1TXgIS4zu+bH6GZL7Z9HlHuDyd2H69KkJpmDP/hPCtGdkn5LXHNPPaINo A2Oron2wB/gb5YMv4dh2WtCiw2JkVLxcaomHBt6D6VykMX8KrY2F2/kVl9Ha2bwYcwf+ sOYRQtVHiuE8s+vn+s7zrM44wXEEQGVls7kLbSRDwqZSZyHtdZYsGyQrcI9m0EWS8oKv NbK77BAkNByGXY9zIBr/g/lIv5k7gOndYY0KAiQuRBjqUElZd5CTERLNkZRtAHo4gK5O hLXQ== X-Gm-Message-State: AFqh2kob6lw4ICnikNUXu0RHtzbwYsfRg0AtwnPXKlMfqyyuI/qgDjks P2PXc+Vd9XP6R0QV7Ki4RnCp/ACeImvzOw== X-Google-Smtp-Source: AMrXdXuM+/YnfuSwnDUADx6ZO2GEenRV6vUkTSabaqClxQWj4kuvpxIeThQrQCEuTy56JRFQHGifog== X-Received: by 2002:a05:600c:34cd:b0:3d3:5a42:bd5d with SMTP id d13-20020a05600c34cd00b003d35a42bd5dmr5017606wmq.32.1671555833737; Tue, 20 Dec 2022 09:03:53 -0800 (PST) Received: from smtpclient.apple ([2a01:e34:ec69:8b70:14b0:6a16:44b1:cc12]) by smtp.gmail.com with ESMTPSA id k12-20020adff28c000000b0022e57e66824sm15168890wro.99.2022.12.20.09.03.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Dec 2022 09:03:53 -0800 (PST) From: Hugo Cisneros Content-Type: multipart/mixed; boundary="Apple-Mail=_11277578-92E3-4C64-8ED3-7474D8A8FE08" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: [PATCH] oc-basic.el: Fix wrong type for the editors field when parsing JSON. Message-Id: <6964C697-B085-4554-9BA3-54A2E3C6DC22@gmail.com> Date: Tue, 20 Dec 2022 18:03:42 +0100 To: emacs-orgmode@gnu.org X-Mailer: Apple Mail (2.3731.300.101.1.3) Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=hmj.cisneros@gmail.com; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=D5mV4qp+; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1671562197; a=rsa-sha256; cv=none; b=gdJ0ht5mk15StE1t+paRjWbL+NZx+XRz0iHizFxQAsHXrkcu62NMXiCvr+zm0y3aJrT/R9 8uubwbt4n1eMcsDKLOUSFHMZ50RdyrDF4/q8jaJ8yzppT/M5e4XxnbfYE9N3gwICEi9fNS FmDKKyQvqksAcuF/ZRYcTgx9hyq5h+eaNyUsT2kP+BnY7jVOkseDeURGFpLx12S+IwN8Qv llwC3xaGbVoNQMUZg5szvCV9stAjw293WpXu1JNTVDi9oiQeJaRjWNuG/2BSsxK7jPllqu raKwSWL0rMDrsHW6a5m2QnVlpT1gBg9/9g31loa4NpLUMF5l4FVJxPhFPcChRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1671562197; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=0wxkNK9NcnQDvytAHVpqsWcvwyUn/N92rS1W9IfkDMg=; b=NyMicfAEvfK70RQnXJHzdYDGu9M+HuNnHZy2xjWT9q3RQjrGJ9xAEcQXeZC98JPNHnS4Eg /S7WDjFXO6PK3972BF4r69GJy0qmm7HSav4ioIIDiZkno3Hs9yGzHP6nUx/DOILMEa+fiO Ah8wSUXovWY9YkfSHt9ezQ6oe7mS15HJwG3P6qea8mpYPMxvVjlBDnvecN1DXiaYK7zgWv YqUUFqdhBdVFm2ZsjGijqTdOjUVDX8k4OllwUHgJPvaXdpj3K9olUAme0y4QgJD481Wq2J KnoWMlU3W1S3YxXLmpu6u3mWPL4H1fjqM2GOzmI1/RKuso89JB9bIgkwVNoVWQ== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=D5mV4qp+; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -5.52 X-Spam-Score: -5.52 X-Migadu-Queue-Id: BBD6CEF62 X-TUID: YyK39cV2USKz --Apple-Mail=_11277578-92E3-4C64-8ED3-7474D8A8FE08 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I use org-cite with a JSON bibliography and noticed a bug when an entry = only has an "editors" field but no "authors" field. The function `org-cite-basic=E2=80=94get-author' correctly falls back to using the = editors instead of the authors, but `org-cite-basic--parse-json=E2=80=99 stringifies only = the "authors" field and not the "editors." This creates an error when other functions = assume they got a string from `org-cite-basic=E2=80=94get-author'. The patch = fixes the issue by applying the same transformation to both "authors" and "editors". As explained in the ChangeLog entry, this points to a more general issue = where `org-cite-basic--get-field' is expected to return nil or a string, but = calls `org-cite-basic--get-entry' that may return an association list. I am = not sure how to fix that since it means converting anything that `org-cite-basic--get-entry' may return into a string. --Apple-Mail=_11277578-92E3-4C64-8ED3-7474D8A8FE08 Content-Disposition: attachment; filename=oc-basic.el.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="oc-basic.el.patch" Content-Transfer-Encoding: quoted-printable =46rom=20132a63faecdd4b78a3d2aaaa3fd6082b1c4a4fe7=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20hugcis=20=0ADate:=20= Tue,=2020=20Dec=202022=2017:15:20=20+0100=0ASubject:=20[PATCH]=20= oc-basic.el:=20Fix=20wrong=20type=20for=20the=20editors=20field=20when=0A= =20parsing=20JSON.=0A=0A*=20lisp/oc-basic.el=20= (org-cite-basic--parse-json):=20Make=20sure=0A= `org-cite-basic--parse-json'=20produces=20a=20string=20for=20the=20= editors=20field.=0AThe=20function=20`org-cite-basic--get-author'=20= expects=20a=20string=20for=20both=20the=0A"authors"=20field=20and=20the=20= "editors"=20field.=0AThe=20conversion=20to=20string=20was=20only=20done=20= for=20the=20"authors"=20field=20in=0A`org-cite-basic--parse-json'.=20= This=20patch=20fixes=20the=20issue=20by=20applying=20the=0A= transformation=20to=20both=20"authors"=20and=20"editors".=0A=0AThis=20= points=20to=20a=20more=20general=20issue=20where=20= `org-cite-basic--get-field'=20is=0Aexpected=20to=20return=20nil=20or=20a=20= string,=20but=20calls=0A`org-cite-basic--get-entry'=20that=20may=20= return=20an=20association=20list.=0A=0ATINYCHANGE=0A---=0A=20= lisp/oc-basic.el=20|=2018=20+++++++++---------=0A=201=20file=20changed,=20= 9=20insertions(+),=209=20deletions(-)=0A=0Adiff=20--git=20= a/lisp/oc-basic.el=20b/lisp/oc-basic.el=0Aindex=203ef7a37e3..01e314bfd=20= 100644=0A---=20a/lisp/oc-basic.el=0A+++=20b/lisp/oc-basic.el=0A@@=20= -162,17=20+162,17=20@@=20Return=20a=20hash=20table=20with=20citation=20= references=20as=20keys=20and=20fields=20alist=20as=20values.=0A=20=20=20=20= =20=20=20=20=20(puthash=20(cdr=20(assq=20'id=20item))=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(mapcar=20(pcase-lambda=20(`(,field=20= .=20,value))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(pcase=20field=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20('author=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20;;=20Author=20is=20an=20array=20of=20objects,=20each=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20;;=20of=20them=20designing=20a=20person.=20=20These=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20objects=20may=20contain=20multiple=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= properties,=20but=20for=20this=20basic=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20processor,=20= we'll=20focus=20on=20`given'=20and=0A-=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20`family'.=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20((or=20'author=20'editors)=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20Author=20and=20= editors=20are=20arrays=20of=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20objects,=20each=20= of=20them=20designing=20a=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20person.=20=20These=20= objects=20may=20contain=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20multiple=20properties,=20= but=20for=20this=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20;;=20basic=20processor,=20we'll=20= focus=20on=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20;;=20`given'=20and=20`family'.=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20;;=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20;;=20For=20compatibility=20with=20BibTeX,=20= add=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20;;=20"and"=20between=20authors.=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (cons=20'author=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20;;=20"and"=20between=20authors=20and=20= editors.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(cons=20field=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(mapconcat=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(lambda=20= (alist)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(concat=20= (alist-get=20'family=20alist)=0A--=20=0A2.38.1=0A=0A= --Apple-Mail=_11277578-92E3-4C64-8ED3-7474D8A8FE08 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Hugo Cisneros --Apple-Mail=_11277578-92E3-4C64-8ED3-7474D8A8FE08--