0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-29 18:36:26 +00:00

oc.el (org-cite-register-processor): Silence a compiler warning

* lisp/oc.el:
(org-cite-register-processor): Silence a compiler warning.
This commit is contained in:
Bastien 2021-09-27 12:15:09 +02:00
parent ca441be377
commit 80798fcdbb

View file

@ -19,39 +19,43 @@
;;; Commentary: ;;; Commentary:
;; This library provides tooling to handle citations in Org, e.g, activate, ;; This library provides tooling to handle citations in Org, e.g,
;; follow, insert, and export them, respectively called "activate", "follow", ;; activate, follow, insert, and export them, respectively called
;; "insert" and "export" capabilities. Libraries responsible for providing ;; "activate", "follow", "insert" and "export" capabilities.
;; some, or all, of these capabilities are called "citation processors". ;; Libraries responsible for providing some, or all, of these
;; capabilities are called "citation processors".
;; Such processors are defined using `org-cite-register-processor'. Using this ;; Such processors are defined using `org-cite-register-processor'.
;; function, it is possible, in addition to giving it a name, to attach ;; Using this function, it is possible, in addition to giving it a
;; functions associated to capabilities. As such, a processor handling citation ;; name, to attach functions associated to capabilities. As such, a
;; export must set the `:export-citation' property to an appropriate function. ;; processor handling citation export must set the `:export-citation'
;; Likewise, "activate" capability requires an appropriate `:activate' property, ;; property to an appropriate function. Likewise, "activate"
;; "insert" requires `:insert' property and, unsurprisingly, "follow" capability ;; capability requires an appropriate `:activate' property, "insert"
;; implies `:follow' property. ;; requires `:insert' property and, unsurprisingly, "follow"
;; capability implies `:follow' property.
;; As a user, the first thing to do is setting a bibliography, either globally ;; As a user, the first thing to do is setting a bibliography, either
;; with `org-cite-global-bibliography', or locally using one or more ;; globally with `org-cite-global-bibliography', or locally using one
;; "bibliography" keywords. Then one can select any registered processor for ;; or more "bibliography" keywords. Then one can select any
;; each capability by providing a processor name to the variables ;; registered processor for each capability by providing a processor
;; `org-cite-activate-processor' and `org-cite-follow-processor'. ;; name to the variables `org-cite-activate-processor' and
;; `org-cite-follow-processor'.
;; The "export" capability is slightly more involved as one need to select the ;; The "export" capability is slightly more involved as one need to
;; processor providing it, but may also provide a default style for citations ;; select the processor providing it, but may also provide a default
;; and bibliography. Also, the choice of an export processor may depend of the ;; style for citations and bibliography. Also, the choice of an
;; current export back-end. The association between export back-ends and ;; export processor may depend of the current export back-end. The
;; triplets of parameters can be set in `org-cite-export-processors' variable, ;; association between export back-ends and triplets of parameters can
;; or in a document, through the "cite_export" keyword. ;; be set in `org-cite-export-processors' variable, or in a document,
;; through the "cite_export" keyword.
;; Eventually, this library provides some tools, mainly targeted at processor ;; Eventually, this library provides some tools, mainly targeted at
;; implementors. Most are export-specific and are located in the "Tools only ;; processor implementors. Most are export-specific and are located
;; available during export" and "Tools generating or operating on parsed data" ;; in the "Tools only available during export" and "Tools generating
;; sections. ;; or operating on parsed data" sections.
;; The few others can be used directly from an Org buffer, or operate on ;; The few others can be used directly from an Org buffer, or operate
;; processors. See "Generic tools" section. ;; on processors. See "Generic tools" section.
;;; Code: ;;; Code:
@ -334,79 +338,88 @@ Return nil if no such processor is found."
(defun org-cite-register-processor (name &rest body) (defun org-cite-register-processor (name &rest body)
"Mark citation processor NAME as available. "Mark citation processor NAME as available.
NAME is a symbol. BODY is a property list, where the following optional keys NAME is a symbol. BODY is a property list, where the following
can be set: optional keys can be set:
`:activate' `:activate'
Function activating a citation. It is called with a single argument: a Function activating a citation. It is called with a single
citation object extracted from the current buffer. It may add text argument: a citation object extracted from the current
properties to the buffer. If it is not provided, `org-cite-fontify-default' buffer. It may add text properties to the buffer. If it is
is used. not provided, `org-cite-fontify-default' is used.
`:export-bibliography' `:export-bibliography'
Function rendering a bibliography. It is called with six arguments: the Function rendering a bibliography. It is called with six
list of citation keys used in the document, as strings, a list of arguments: the list of citation keys used in the document, as
bibliography files, the style, as a string or nil, the local properties, as strings, a list of bibliography files, the style, as a string
a property list, the export back-end, as a symbol, and the communication or nil, the local properties, as a property list, the export
channel, as a property list. back-end, as a symbol, and the communication channel, as a
property list.
It is called at each \"print_bibliography\" keyword in the parse tree. It is called at each \"print_bibliography\" keyword in the
It may return a string, a parsed element, a list of parsed elements, or nil. parse tree. It may return a string, a parsed element, a list
When it returns nil, the keyword is ignored. Otherwise, the value it returns of parsed elements, or nil. When it returns nil, the keyword
replaces the keyword in the export output. is ignored. Otherwise, the value it returns replaces the
keyword in the export output.
`:export-citation' (mandatory for \"export\" capability) `:export-citation' (mandatory for \"export\" capability)
Function rendering citations. It is called with four arguments: a citation Function rendering citations. It is called with four
object, the style, as a pair, the export back-end, as a symbol, and the arguments: a citation object, the style, as a pair, the
communication channel, as a property list. export back-end, as a symbol, and the communication channel,
as a property list.
It is called on each citation object in the parse tree. It may return It is called on each citation object in the parse tree. It
a string, a parsed object, a secondary string, or nil. When it returns nil, may return a string, a parsed object, a secondary string, or
the citation is ignored. Otherwise, the value it returns replaces the nil. When it returns nil, the citation is ignored.
citation object in the export output. Otherwise, the value it returns replaces the citation object
in the export output.
`:export-finalizer' `:export-finalizer'
Function called at the end of export process. It must accept six arguments: Function called at the end of export process. It must accept
the output, as a string, a list of citation keys used in the document, a six arguments: the output, as a string, a list of citation
list of bibliography files, the expected bibliography style, as a string or keys used in the document, a list of bibliography files, the
nil, the export back-end, as a symbol, and the communication channel, as a expected bibliography style, as a string or nil, the export
back-end, as a symbol, and the communication channel, as a
property list. property list.
It must return a string, which will become the final output from the export It must return a string, which will become the final output
process, barring subsequent modifications from export filters. from the export process, barring subsequent modifications
from export filters.
`:follow' `:follow'
Function called to follow a citation. It accepts two arguments, the Function called to follow a citation. It accepts two
citation or citation reference object at point, and any prefix argument arguments, the citation or citation reference object at
received during interactive call of `org-open-at-point'. point, and any prefix argument received during interactive
call of `org-open-at-point'.
`:insert' `:insert'
Function called to insert a citation. It accepts two arguments, the Function called to insert a citation. It accepts two
citation or citation reference object at point or nil, and any prefix arguments, the citation or citation reference object at point
argument received. or nil, and any prefix argument received.
`:cite-styles' `:cite-styles'
When the processor has export capability, the value can specify what cite When the processor has export capability, the value can
styles, variants, and their associated shortcuts are supported. It can be specify what cite styles, variants, and their associated
useful information for completion or linting. shortcuts are supported. It can be useful information for
completion or linting.
The expected format is The expected format is
((STYLE . SHORTCUTS) . VARIANTS)) ((STYLE . SHORTCUTS) . VARIANTS))
where STYLE is a string, SHORTCUTS a list of strings or nil, and VARIANTS is where STYLE is a string, SHORTCUTS a list of strings or nil,
a list of pairs (VARIANT . SHORTCUTS), VARIANT being a string and SHORTCUTS and VARIANTS is a list of pairs (VARIANT . SHORTCUTS),
a list of strings or nil. VARIANT being a string and SHORTCUTS a list of strings or
nil.
The \"nil\" style denotes the processor fall-back style. It should have a The \"nil\" style denotes the processor fall-back style. It
corresponding entry in the value. should have a corresponding entry in the value.
Return a non-nil value on a successful operation." Return a non-nil value on a successful operation."
(declare (indent 1)) (declare (indent 1))