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 iM80AOeQU2MNTAEAbAwnHQ (envelope-from ) for ; Sat, 22 Oct 2022 08:42:47 +0200 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 QF40AOeQU2N3fAEAauVa8A (envelope-from ) for ; Sat, 22 Oct 2022 08:42:47 +0200 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 A6D7B3BCF for ; Sat, 22 Oct 2022 08:42:46 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1om895-0007W3-Ba; Sat, 22 Oct 2022 02:38:11 -0400 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 1om892-0007TE-Vi for emacs-orgmode@gnu.org; Sat, 22 Oct 2022 02:38:09 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1om890-0003Zb-Gh for emacs-orgmode@gnu.org; Sat, 22 Oct 2022 02:38:08 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 5731B240027 for ; Sat, 22 Oct 2022 08:38:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1666420684; bh=7YudzudW+YWopaLZyWdhV8pChHHZFGuFrEY0RX1jvIQ=; h=From:To:Cc:Subject:Date:From; b=bfRNRGTJuGe9qtkrkZjpL07NPjwE1izzbPP7KW1vELhlMkShan1ZiUeu/Z6WT8eL7 mZqHlNIvvQGsQTyMK9kTnYLnVrgmGtbeW800lXhhgW2txhM48zlV3ma/4o9cTJL+JW 06V4XXoFOFOQpvlUH8COMzDJgV7YmkSB0qAEMowvn+LtxkvS3cE3v8O8tjwek/1sDe 9McL6fO6b3YHmXMFnlCvSQW29hx5/QuDdu3RYKZ86DP7KIxuf+Z8M3qXUnPm+YfZb8 vP2h6N6ryzkGC4ftRp7AkbWQgOTFaVvmJGPaBGKimhZGs5MdYde+C8KjWyaeG3N9IS SgxhRQqlUTJPA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MvWqZ5pKNz9rxM; Sat, 22 Oct 2022 08:38:02 +0200 (CEST) From: Ihor Radchenko To: Ihor Radchenko Cc: Kaushal Modi , emacs-org list Subject: [PATCH] Re: oc-basic "Wrong value for ENTRY-OR-KEY" error on emacs master (29.x) [Was: Bibliographies on export with ox-context and ox-epub] In-Reply-To: <87o804jo6w.fsf@localhost> References: <2fcf6b95-c3c1-0885-e3b0-99479a580dc2@mailbox.org> <1f18a566-415e-0742-58e3-5a46fc550ae2@mailbox.org> <87o804jo6w.fsf@localhost> Date: Sat, 22 Oct 2022 06:38:46 +0000 Message-ID: <87mt9o1hxl.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, 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: , Sender: "Emacs-orgmode" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1666420966; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=I4tk6Cksmk8j6JKpyrf9GRqGdaqenRiUXB2KbT34WZw=; b=t+v0qvrWvIjpA/18dZnWD3ShGuMkByLLHLKCD1NcYNJmIIxE1QEjRRf7xtykI1RgZV48sG mdWRphUBVe3dBD+IF6le0vKJzUF4kVsaXXetZFgyB6qL/7mnfVtGq2JDoz153BRkdXJZct 1az2C1hlweRNtY1ibfw5kSGarWs4qV+Ri3/KrOswb1mTfvnsYUWtIF3A2IbcDO8a2HbJD3 uACRMnTy04wrAV/MK8WVgiQIWbQTJnKh3QrJ5nyZz39riUZL0s5ZhdBwRsfgnJa5pxRtVy Xp7cfhk1KEh0HCypwn9y81Pp6OUTg6sLF7wX4FwQiznpfBU+/08cY7yca+sgww== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666420966; a=rsa-sha256; cv=none; b=Uui6gEx+4qLRvOAoJTGM5YTfoCrh2eoErgHWwx5hwdmEDdSZoVMo6rWNn4FPSRlxcCOWZU GRz5n7dA8tG9FD2uu6qvj7/wWc0DSHgSnezQfKVALpNqYdguiiYbszq4TofDQAzcUEJ20h hSawmdNUkz/HV5LnzkznbW8eUL9ZX/LJhytu6MKaWTZnVlfhFHVaad9sEp4mth/xl4kxpy CJhgQFs/J+c3OZ+JUKiZXHthAI2a8WaoRNK2EGFDsukGaKB7lpbwwWv97k2LRxKct5mNg/ tVrsNKZa6sjCIVZ+/KpXLeR4sJNNuU7AT7QDDwkMf6YmmAeatkZ2oEzNAy/pfA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=bfRNRGTJ; dmarc=pass (policy=none) header.from=posteo.net; 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-Spam-Score: -5.54 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=bfRNRGTJ; dmarc=pass (policy=none) header.from=posteo.net; 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-Queue-Id: A6D7B3BCF X-Spam-Score: -5.54 X-Migadu-Scanner: scn0.migadu.com X-TUID: Q2eAavB23Ahi --=-=-= Content-Type: text/plain Ihor Radchenko writes: > Note that apart from the problem on Emacs side, there appears to be a > problem with org-cite-basic-export-bibliography. > > org-cite-basic-export-bibliography uses org-cite-basic--print-entry, > which fails to print keys, which are not in .bib files. As a result, > #+print_bibliography: appears to fail all the time when the document > contains invalid cite keys. > > I consider this as a bug. At least org-cite-basic-export-bibliography > could provide a more useful error message. Or maybe even skip the > invalid keys. Or, similar to LaTeX, print ???. I am not sure which way > will be more canonical according to general oc.el design. I am suggesting to merge the attached patch. It will simply skip keys that are not in the bibliography when printing it. WDYT? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-cite-basic-export-bibliography-Skip-missing-bibl.patch >From 943b070b7e0f2b6d0bed261f831589fb918c214f Mon Sep 17 00:00:00 2001 Message-Id: <943b070b7e0f2b6d0bed261f831589fb918c214f.1666420664.git.yantar92@posteo.net> From: Ihor Radchenko Date: Sat, 22 Oct 2022 14:32:17 +0800 Subject: [PATCH] org-cite-basic-export-bibliography: Skip missing bibliography keys * lisp/oc-basic.el (org-cite-basic-export-bibliography): Ignore citation keys that are not present in bibliography. Previously, an error was thrown. --- lisp/oc-basic.el | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lisp/oc-basic.el b/lisp/oc-basic.el index f1b7c8263..3ef7a37e3 100644 --- a/lisp/oc-basic.el +++ b/lisp/oc-basic.el @@ -713,15 +713,17 @@ (defun org-cite-basic-export-bibliography (keys _files style _props backend info style, as a string. BACKEND is the export back-end, as a symbol. INFO is the export state, as a property list." (mapconcat - (lambda (k) - (let ((entry (org-cite-basic--get-entry k info))) - (org-export-data - (org-cite-make-paragraph - (and (org-export-derived-backend-p backend 'latex) - (org-export-raw-string "\\noindent\n")) - (org-cite-basic--print-entry entry style info)) - info))) - (org-cite-basic--sort-keys keys info) + (lambda (entry) + (org-export-data + (org-cite-make-paragraph + (and (org-export-derived-backend-p backend 'latex) + (org-export-raw-string "\\noindent\n")) + (org-cite-basic--print-entry entry style info)) + info)) + (delq nil + (mapcar + (lambda (k) (org-cite-basic--get-entry k info)) + (org-cite-basic--sort-keys keys info))) "\n")) -- 2.35.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--