emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "András Simonyi" <andras.simonyi@gmail.com>
To: emacs-orgmode list <emacs-orgmode@gnu.org>
Subject: [PATCH] oc-csl: Fix footnote status reporting for wrapped citations
Date: Tue, 2 Nov 2021 17:51:03 +0100	[thread overview]
Message-ID: <CAOWRwxBKhrJ5RUQ=wmoeWHrHyv9MMkmoLW_apzg4G4fXab52fw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 229 bytes --]

Dear All,

the attached simple patch fixes a problem in oc-csl.el which led to
missing footnote number information for citations that were
automatically footnote-wrapped based on the used CSL style.

best wishes,
András

[-- Attachment #2: 0001-oc-csl-Fix-footnote-status-reporting-for-wrapped-cit.patch --]
[-- Type: text/x-patch, Size: 1119 bytes --]

From 1423e0f600d8e4e29f275faa9c9117db9b081b19 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A1s=20Simonyi?= <andras.simonyi@gmail.com>
Date: Tue, 2 Nov 2021 16:44:37 +0100
Subject: [PATCH] oc-csl: Fix footnote status reporting for wrapped citations

* lisp/oc-csl.el (org-cite-csl--create-structure): Update footnote information
when citation is wrapped in a footnote.
---
 lisp/oc-csl.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/oc-csl.el b/lisp/oc-csl.el
index 42886dc44..f59b14a88 100644
--- a/lisp/oc-csl.el
+++ b/lisp/oc-csl.el
@@ -506,7 +506,9 @@ INFO is the export state, as a property list."
     ;; a footnote, but isn't yet.
     (when (and (not footnote) (org-cite-csl--note-style-p info))
       (org-cite-adjust-note citation info)
-      (org-cite-wrap-citation citation info))
+      (org-cite-wrap-citation citation info)
+      (setq footnote (org-element-lineage citation
+                                          '(footnote-definition footnote-reference))))
     ;; Return structure.
     (apply #'citeproc-citation-create
            `(:note-index
-- 
2.25.1


             reply	other threads:[~2021-11-02 16:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-02 16:51 András Simonyi [this message]
2021-11-02 17:35 ` [PATCH] oc-csl: Fix footnote status reporting for wrapped citations Nicolas Goaziou

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='CAOWRwxBKhrJ5RUQ=wmoeWHrHyv9MMkmoLW_apzg4G4fXab52fw@mail.gmail.com' \
    --to=andras.simonyi@gmail.com \
    --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).