emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals-release/org 8dfc056: oc: Fix failing test about `org-ci


From: ELPA Syncer
Subject: [elpa] externals-release/org 8dfc056: oc: Fix failing test about `org-cite-list-citations'
Date: Sat, 9 Oct 2021 17:57:21 -0400 (EDT)

branch: externals-release/org
commit 8dfc056fcca7d668dee9660323b5204477eb7082
Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Commit: Nicolas Goaziou <mail@nicolasgoaziou.fr>

    oc: Fix failing test about `org-cite-list-citations'
    
    * lisp/oc.el (org-cite-list-citations): Properly implement
    a simplified version of `org-export-get-footnote-definition'.
---
 lisp/oc.el | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/lisp/oc.el b/lisp/oc.el
index 2f74176..f9883ba 100644
--- a/lisp/oc.el
+++ b/lisp/oc.el
@@ -789,6 +789,20 @@ Citations are ordered by appearance in the document, when 
following footnotes.
 INFO is the export communication channel, as a property list."
   (or (plist-get info :citations)
       (letrec ((cites nil)
+               (tree (plist-get info :parse-tree))
+               (find-definition
+                ;; Find definition for standard reference LABEL.  At
+                ;; this point, it is impossible to rely on
+                ;; `org-export-get-footnote-definition' because the
+                ;; function caches results that could contain
+                ;; un-processed citation objects.  So we use
+                ;; a simplified version of the function above.
+                (lambda (label)
+                  (org-element-map tree 'footnote-definition
+                    (lambda (d)
+                      (and (equal label (org-element-property :label d))
+                           (or (org-element-contents d) "")))
+                    info t)))
                (search-cites
                 (lambda (data)
                   (org-element-map data '(citation footnote-reference)
@@ -798,22 +812,13 @@ INFO is the export communication channel, as a property 
list."
                        ;; Do not force entering inline definitions, since
                        ;; `org-element-map' is going to enter it anyway.
                         ((guard (eq 'inline (org-element-property :type 
datum))))
-                        ;; Find definition for current standard
-                        ;; footnote reference.  Unlike to
-                        ;; `org-export-get-footnote-definition', do
-                        ;; not cache results as they would contain
-                        ;; un-processed citation objects.
+                        ;; Walk footnote definition.
                         (_
                          (let ((label (org-element-property :label datum)))
-                           (funcall
-                            search-cites
-                            (org-element-map data 'footnote-definition
-                              (lambda (d)
-                                (and
-                                 (equal label (org-element-property :label d))
-                                 (or (org-element-contents d) "")))))))))
+                           (funcall search-cites
+                                    (funcall find-definition label))))))
                     info nil 'footnote-definition t))))
-        (funcall search-cites (plist-get info :parse-tree))
+        (funcall search-cites tree)
         (let ((result (nreverse cites)))
           (plist-put info :citations result)
           result))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]