mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-22 07:09:47 +00:00
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'.
This commit is contained in:
parent
b71474ff7f
commit
8dfc056fcc
31
lisp/oc.el
31
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))))
|
||||
|
Loading…
Reference in New Issue
Block a user