diff --git a/lisp/oc-csl.el b/lisp/oc-csl.el index 9bbe5e29d..b8691bf6f 100644 --- a/lisp/oc-csl.el +++ b/lisp/oc-csl.el @@ -423,11 +423,6 @@ Label is in match group 1.") ;;; Internal functions -;; FIXME: We use `org-require-package' in other places. -(defun org-cite-csl--barf-without-citeproc () - "Raise an error if Citeproc library is not loaded." - (unless (featurep 'citeproc) - (error "Citeproc library is not loaded"))) (defun org-cite-csl--note-style-p (info) "Non-nil when bibliography style implies wrapping citations in footnotes. @@ -813,7 +808,7 @@ INFO is the export state, as a property list." (defun org-cite-csl-render-citation (citation _style _backend info) "Export CITATION object. INFO is the export state, as a property list." - (org-cite-csl--barf-without-citeproc) + (org-require-package 'citeproc) (let ((output (cdr (assq citation (org-cite-csl--rendered-citations info))))) (if (not (eq 'org (org-cite-csl--output-format info))) output @@ -824,7 +819,7 @@ INFO is the export state, as a property list." (defun org-cite-csl-render-bibliography (_keys _files _style props _backend info) "Export bibliography. INFO is the export state, as a property list." - (org-cite-csl--barf-without-citeproc) + (org-require-package 'citeproc) (pcase-let* ((format (org-cite-csl--output-format info)) (`(,outputs ,parameters) (org-cite-csl--rendered-bibliographies info)) (output (cdr (assoc props outputs)))) @@ -862,7 +857,7 @@ INFO is the export state, as a property list." "Add \"hanging\" package if missing from LaTeX output. OUTPUT is the export document, as a string. INFO is the export state, as a property list." - (org-cite-csl--barf-without-citeproc) + (org-require-package 'citeproc) (if (not (eq 'org-latex (org-cite-csl--output-format info))) output (with-temp-buffer