Function: org-cite-store-export-processor
org-cite-store-export-processor is a byte-compiled function defined in
oc.el.gz.
Signature
(org-cite-store-export-processor INFO)
Documentation
Store export processor in the :cite-export property during export.
Export processor is stored as a triplet, or nil.
When non-nil, it is defined as (NAME BIBLIOGRAPHY-STYLE CITATION-STYLE) where NAME is a symbol, whereas BIBLIOGRAPHY-STYLE and CITATION-STYLE are strings, or nil.
INFO is the communication channel, as a plist. It is modified by side-effect.
Source Code
;; Defined in /usr/src/emacs/lisp/org/oc.el.gz
(defun org-cite-store-export-processor (info)
"Store export processor in the `:cite-export' property during export.
Export processor is stored as a triplet, or nil.
When non-nil, it is defined as (NAME BIBLIOGRAPHY-STYLE
CITATION-STYLE) where NAME is a symbol, whereas
BIBLIOGRAPHY-STYLE and CITATION-STYLE are strings, or nil.
INFO is the communication channel, as a plist. It is modified by
side-effect."
(let* ((err
(lambda (s)
(user-error "Invalid cite export processor declaration: %S" s)))
(processor
(pcase (plist-get info :cite-export)
((or "" `nil) nil)
;; Value is a string. It comes from a "cite_export"
;; keyword.
((and (pred stringp) s)
(org-cite-read-processor-declaration s))
;; Value is an alist. It must come from
;; `org-cite-export-processors' variable. Find the most
;; appropriate processor according to current export
;; backend.
((and (pred consp) alist)
(let* ((backend (plist-get info :back-end))
(candidates
;; Limit candidates to processors associated to
;; backends derived from or equal to the current
;; one.
(sort (seq-filter
(pcase-lambda (`(,key . ,_))
(org-export-derived-backend-p backend key))
alist)
(lambda (a b)
(org-export-derived-backend-p (car a) (car b))))))
;; Select the closest candidate, or fallback to t.
(pcase (or (car candidates) (assq t alist))
('nil nil)
(`(,_ . ,p)
;; Normalize value by turning it into a triplet.
(pcase p
(`(,(pred symbolp))
(append p (list nil nil)))
(`(,(pred symbolp) ,(pred string-or-null-p))
(append p (list nil)))
(`(,(pred symbolp)
,(pred string-or-null-p)
,(pred string-or-null-p))
p)
(_ (funcall err p))))
(other (funcall err (cdr other))))))
(other (funcall err other)))))
(pcase processor
('nil nil)
(`(,name . ,_)
(org-cite-try-load-processor name)
(cond
((not (org-cite-get-processor name))
(user-error "Unknown processor %S" name))
((not (org-cite-processor-has-capability-p name 'export))
(user-error "Processor %S is unable to handle citation export" name)))))
(plist-put info :cite-export processor)))