From: Ihor Radchenko <yantar92@posteo.net>
To: Margaret Patterson <emacs-m@ninecats.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] org-cite-insert fails to open json format bibliographies that contain entries for books with editors but no authors [9.6.6 (release_9.6.6 @ /snap/emacs/current/usr/share/emacs/29.1/lisp/org/)]
Date: Fri, 25 Aug 2023 08:39:14 +0000 [thread overview]
Message-ID: <87zg2fh5xp.fsf@localhost> (raw)
In-Reply-To: <ea0d8557-f67d-c8b1-522f-b5ad37612d99@ninecats.org>
[-- Attachment #1: Type: text/plain, Size: 297 bytes --]
Margaret Patterson <emacs-m@ninecats.org> writes:
> Since upgrading to emacs 29.1 org-cite-insert no longer copes with
> bibliography files in json format where there is an entry for a book
> that has only editors and no author.
Thanks for reporting!
Does the attached patch fix the problem?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-oc-basic.el-Fix-parsing-editor-field-in-json-bi.patch --]
[-- Type: text/x-patch, Size: 1237 bytes --]
From 9ca03cfb827b5691665b472f3c7086a1c033ce0a Mon Sep 17 00:00:00 2001
Message-ID: <9ca03cfb827b5691665b472f3c7086a1c033ce0a.1692952720.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
Date: Fri, 25 Aug 2023 11:37:59 +0300
Subject: [PATCH] * lisp/oc-basic.el: Fix parsing "editor" field in json
bibliographies
(org-cite-basic--parse-json): Parse "editor" field, not "editors".
"editors" is a typo - the common field name is "editor". For example,
see https://www.bibtex.com/e/book-entry/.
---
lisp/oc-basic.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/oc-basic.el b/lisp/oc-basic.el
index c4468e5a8..2b78d85d0 100644
--- a/lisp/oc-basic.el
+++ b/lisp/oc-basic.el
@@ -162,7 +162,7 @@ (defun org-cite-basic--parse-json ()
(puthash (cdr (assq 'id item))
(mapcar (pcase-lambda (`(,field . ,value))
(pcase field
- ((or 'author 'editors)
+ ((or 'author 'editor)
;; Author and editors are arrays of
;; objects, each of them designing a
;; person. These objects may contain
--
2.41.0
[-- Attachment #3: Type: text/plain, Size: 224 bytes --]
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
next prev parent reply other threads:[~2023-08-25 8:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-24 16:50 [BUG] org-cite-insert fails to open json format bibliographies that contain entries for books with editors but no authors [9.6.6 (release_9.6.6 @ /snap/emacs/current/usr/share/emacs/29.1/lisp/org/)] Margaret Patterson
2023-08-25 8:39 ` Ihor Radchenko [this message]
2023-08-26 14:29 ` Margaret Patterson
2023-08-26 16:19 ` Ihor Radchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zg2fh5xp.fsf@localhost \
--to=yantar92@posteo.net \
--cc=emacs-m@ninecats.org \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).