Function: org-footnote-get-next-reference

org-footnote-get-next-reference is a byte-compiled function defined in org-footnote.el.gz.

Signature

(org-footnote-get-next-reference &optional LABEL BACKWARD LIMIT)

Documentation

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.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-footnote.el.gz
;;;; Navigation

(defun 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."
  (let ((label-regexp (if label (format "\\[fn:%s[]:]" label) org-footnote-re)))
    (catch :exit
      (save-excursion
	(while (funcall (if backward #'re-search-backward #'re-search-forward)
			label-regexp limit t)
	  (unless backward (backward-char))
	  (pcase (org-footnote-at-reference-p)
	    (`nil nil)
	    (reference (throw :exit reference))))))))