summaryrefslogtreecommitdiff
path: root/lisp/org/oc.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/org/oc.el')
-rw-r--r--lisp/org/oc.el22
1 files changed, 21 insertions, 1 deletions
diff --git a/lisp/org/oc.el b/lisp/org/oc.el
index dcda8d7d084..41fd688c060 100644
--- a/lisp/org/oc.el
+++ b/lisp/org/oc.el
@@ -638,6 +638,24 @@ in the current buffer. Positions include leading \"@\" character."
(re-search-forward org-element-citation-key-re end t)
(cons (match-beginning 0) (match-end 0)))))
+(defun org-cite-main-affixes (citation)
+ "Return main affixes for CITATION object.
+
+Some export back-ends only support a single pair of affixes per
+citation, even if it contains multiple keys. This function
+decides what affixes are the most appropriate.
+
+Return a pair (PREFIX . SUFFIX) where PREFIX and SUFFIX are
+parsed data."
+ (let ((source
+ ;; When there are multiple references, use global affixes.
+ ;; Otherwise, local affixes have priority.
+ (pcase (org-cite-get-references citation)
+ (`(,reference) reference)
+ (_ citation))))
+ (cons (org-element-property :prefix source)
+ (org-element-property :suffix source))))
+
(defun org-cite-supported-styles (&optional processors)
"List of supported citation styles and variants.
@@ -872,7 +890,9 @@ When non-nil, the return value if the footnote container."
INFO is the export state, as a property list.
White space before the citation, if any, are removed. The parse tree is
-modified by side-effect."
+modified by side-effect.
+
+Return newly created footnote object."
(let ((footnote
(list 'footnote-reference
(list :label nil