Function: org-footnote-at-definition-p

org-footnote-at-definition-p is a byte-compiled function defined in org-footnote.el.gz.

Signature

(org-footnote-at-definition-p)

Documentation

Non-nil if point is within a footnote definition.

This matches only pure definitions like [fn:name] 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 is nil if not at a footnote definition, and a list with label, start, end and definition of the footnote otherwise.

Source Code

;; Defined in /usr/src/emacs/lisp/org/org-footnote.el.gz
(defun org-footnote-at-definition-p ()
  "Non-nil if point is within a footnote definition.

This matches only pure definitions like [fn:name] 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 is nil if not at a footnote definition, and
a list with label, start, end and definition of the footnote
otherwise."
  (pcase (org-element-lineage (org-element-at-point) 'footnote-definition t)
    (`nil nil)
    (definition
      (let* ((label (org-element-property :label definition))
	     (begin (org-element-property :post-affiliated definition))
	     (end (save-excursion
		    (goto-char (org-element-property :end definition))
		    (skip-chars-backward " \r\t\n")
		    (line-beginning-position 2)))
	     (contents-begin (org-element-property :contents-begin definition))
	     (contents-end (org-element-property :contents-end definition))
	     (contents
	      (if (not contents-begin) ""
		(org-trim
		 (buffer-substring-no-properties contents-begin
						 contents-end)))))
	(list label begin end contents)))))