Ver código fonte

oc: Make `org-cite-try-load-process' public

* lisp/oc.el (org-cite-try-load-processor): New function.
(org-cite--try-load-processor): Remove function.
(org-cite-store-export-processor):
(org-cite-follow):
(org-cite-insert): Use new function.
Nicolas Goaziou 4 anos atrás
pai
commit
e83a04b5af
1 arquivos alterados com 10 adições e 10 exclusões
  1. 10 10
      lisp/oc.el

+ 10 - 10
lisp/oc.el

@@ -418,6 +418,13 @@ Return a non-nil value on a successful operation."
               (seq-remove (lambda (p) (eq name (org-cite-processor-name p)))
               (seq-remove (lambda (p) (eq name (org-cite-processor-name p)))
                           org-cite--processors))))
                           org-cite--processors))))
 
 
+(defun org-cite-try-load-processor (name)
+  "Try loading citation processor NAME if unavailable.
+NAME is a symbol.  When the NAME processor is unregistered, try
+loading \"oc-NAME\" library beforehand, then cross fingers."
+  (unless (org-cite-get-processor name)
+    (require (intern (format "oc-%s" name)) nil t)))
+
 (defun org-cite-get-processor (name)
 (defun org-cite-get-processor (name)
   "Return citation processor named after symbol NAME.
   "Return citation processor named after symbol NAME.
 Return nil if no such processor is found."
 Return nil if no such processor is found."
@@ -451,13 +458,6 @@ PROCESSOR is the name of a cite processor, as a symbol.  CAPABILITY is
 
 
 
 
 ;;; Internal functions
 ;;; Internal functions
-(defun org-cite--try-load-processor (name)
-  "Try loading citation processor NAME if unavailable.
-NAME is a symbol.  When the NAME processor is unregistered, try
-loading \"oc-NAME\" library beforehand, then cross fingers."
-  (unless (org-cite-get-processor name)
-    (require (intern (format "oc-%s" name)) nil t)))
-
 (defun org-cite--set-post-blank (datum blanks)
 (defun org-cite--set-post-blank (datum blanks)
   "Set `:post-blank' property from element or object before DATUM to BLANKS.
   "Set `:post-blank' property from element or object before DATUM to BLANKS.
 DATUM is an element or object.  BLANKS is an integer.  DATUM is modified
 DATUM is an element or object.  BLANKS is an integer.  DATUM is modified
@@ -1283,7 +1283,7 @@ side-effect."
     (pcase processor
     (pcase processor
       ('nil nil)
       ('nil nil)
       (`(,name . ,_)
       (`(,name . ,_)
-       (org-cite--try-load-processor name)
+       (org-cite-try-load-processor name)
        (cond
        (cond
         ((not (org-cite-get-processor name))
         ((not (org-cite-get-processor name))
          (user-error "Unknown processor %S" name))
          (user-error "Unknown processor %S" name))
@@ -1435,7 +1435,7 @@ Following is done according to the processor set in `org-cite-follow-processor'.
 ARG is the prefix argument received when calling `org-open-at-point', or nil."
 ARG is the prefix argument received when calling `org-open-at-point', or nil."
   (unless org-cite-follow-processor
   (unless org-cite-follow-processor
     (user-error "No processor set to follow citations"))
     (user-error "No processor set to follow citations"))
-  (org-cite--try-load-processor org-cite-follow-processor)
+  (org-cite-try-load-processor org-cite-follow-processor)
   (let ((name org-cite-follow-processor))
   (let ((name org-cite-follow-processor))
     (cond
     (cond
      ((not (org-cite-get-processor name))
      ((not (org-cite-get-processor name))
@@ -1657,7 +1657,7 @@ ARG is the prefix argument received when calling interactively the function."
   (interactive "P")
   (interactive "P")
   (unless org-cite-insert-processor
   (unless org-cite-insert-processor
     (user-error "No processor set to insert citations"))
     (user-error "No processor set to insert citations"))
-  (org-cite--try-load-processor org-cite-insert-processor)
+  (org-cite-try-load-processor org-cite-insert-processor)
   (let ((name org-cite-insert-processor))
   (let ((name org-cite-insert-processor))
     (cond
     (cond
      ((not (org-cite-get-processor name))
      ((not (org-cite-get-processor name))