Org API
Table of Contents
- Org-Footnote API functions (org-footnote.el)
- org-footnote-action
&optional special - org-footnote-all-labels
&optional with-defs - org-footnote-at-definition-p
- org-footnote-at-reference-p
- org-footnote-auto-adjust-maybe
- org-footnote-create-definition
label - org-footnote-delete
&optional label - org-footnote-delete-definitions
label - org-footnote-delete-references
label - org-footnote-get-definition
label - org-footnote-get-next-reference
&optional label backward limit - org-footnote-goto-definition
label - org-footnote-goto-local-insertion-point
- org-footnote-goto-previous-reference
label - org-footnote-in-valid-context-p
- org-footnote-new
- org-footnote-next-reference-or-definition
limit - org-footnote-normalize
&optional sort-only export-props - org-footnote-normalize-label
label - org-footnote-renumber-fn:N
- org-footnote-unique-label
&optional current
- org-footnote-action
Org-Footnote API functions (org-footnote.el)
org-footnote-action &optional special
Do the right thing for footnotes.
When at a footnote reference, jump to the definition.
When at a definition, jump to the references if they exist, offer to create them otherwise.
When neither at definition or reference, create a new footnote, interactively.
With prefix arg special, offer additional commands in a menu.
org-footnote-all-labels &optional with-defs
Return list with all defined foot labels used in the buffer.
If with-defs is non-nil, also associate the definition to each
label. The function will then return an alist whose key is label
and value definition.
org-footnote-at-definition-p
Is point within a footnote definition?
This matches only pure definitions like 1 or 2 at the beginning of a line. It does not match references like [fn:name:definition], where the footnote text is included and defined locally.
The return value will be nil if not at a footnote definition, and a list with label, start, end and definition of the footnote otherwise.
org-footnote-at-reference-p
Is the cursor at a footnote reference?
If so, return a list containing its label, beginning and ending positions, and the definition, when inlined.
org-footnote-auto-adjust-maybe
Renumber and/or sort footnotes according to user settings.
org-footnote-create-definition label
Start the definition of a footnote with label label.
org-footnote-delete &optional label
Delete the footnote at point. This will remove the definition (even multiple definitions if they exist) and all references of a footnote label.
If label is non-nil, delete that footnote instead.
org-footnote-delete-definitions label
Delete every definition of the footnote label.
Return the number of footnotes removed.
org-footnote-delete-references label
Delete every reference to footnote label.
Return the number of footnotes removed.
org-footnote-get-definition label
Return label, boundaries and definition of the footnote label.
org-footnote-get-next-reference &optional label backward limit
Return complete reference of the next footnote.
If label is provided, get the next reference of that footnote. If
backward is non-nil, find previous reference instead. limit is
the buffer position bounding the search.
Return value is a list like those provided by org-footnote-at-reference-p. If no footnote is found, return nil.
org-footnote-goto-definition label
Move point to the definition of the footnote label.
Return a non-nil value when a definition has been found.
org-footnote-goto-local-insertion-point
Find insertion point for footnote, just before next outline heading.
org-footnote-goto-previous-reference label
Find the first closest (to point) reference of footnote with label label.
org-footnote-in-valid-context-p
Is point in a context where footnotes are allowed?
org-footnote-new
Insert a new footnote. This command prompts for a label. If this is a label referencing an existing label, only insert the label. If the footnote label is empty or new, let the user edit the definition of the footnote.
org-footnote-next-reference-or-definition limit
Move point to next footnote reference or definition.
limit is the buffer position bounding the search.
Return value is a list like those provided by org-footnote-at-reference-p or org-footnote-at-definition-p. If no footnote is found, return nil.
org-footnote-normalize &optional sort-only export-props
Collect the footnotes in various formats and normalize them.
This finds the different sorts of footnotes allowed in Org, and normalizes them to the usual [N] format that is understood by the Org-mode exporters.
When sort-only is set, only sort the footnote definitions into the
referenced sequence.
If Org is amidst an export process, export-props will hold the
export properties of the buffer.
When export-props is non-nil, the default action is to insert
normalized footnotes towards the end of the pre-processing
buffer. Some exporters (docbook, odt…) expect footnote
definitions to be available before any references to them. Such
exporters can let bind org-footnote-insert-pos-for-preprocessor
to symbol point-min to achieve the desired behaviour.
Additional note on org-footnote-insert-pos-for-preprocessor:
- This variable has not effect when FOR-PREPROCESSOR is nil.
- This variable (potentially) obviates the need for extra scan of pre-processor buffer as witnessed in `org-export-docbook-get-footnotes'.
org-footnote-normalize-label label
Return label as an appropriate string.
org-footnote-renumber-fn:N
Renumber the simple footnotes like fn:17 into a sequence in the document.