Function: footnote--get-area-point-min

footnote--get-area-point-min is a byte-compiled function defined in footnote.el.gz.

Signature

(footnote--get-area-point-min &optional BEFORE-TAG)

Documentation

Return start of the first footnote.

If there is no footnote area, returns point-max. With optional arg BEFORE-TAG, return position of the footnote-section-tag instead, if applicable.

Source Code

;; Defined in /usr/src/emacs/lisp/mail/footnote.el.gz
(defun footnote--get-area-point-min (&optional before-tag)
  "Return start of the first footnote.
If there is no footnote area, returns `point-max'.
With optional arg BEFORE-TAG, return position of the `footnote-section-tag'
instead, if applicable."
  (cond
   ;; FIXME: Shouldn't we use `footnote--get-area-point-max' instead?
   ((not footnote--markers-alist) (point-max))
   ((not before-tag) (cadr (car footnote--markers-alist)))
   ((string-equal footnote-section-tag "") (cadr (car footnote--markers-alist)))
   (t
    (save-excursion
      (goto-char (cadr (car footnote--markers-alist)))
      (if (re-search-backward (concat "^" footnote-section-tag-regexp) nil t)
          (point)
        (message "Footnote section tag not found!")
        ;; This `else' should never happen, and indicates an error,
        ;; ie. footnotes already exist and a footnote-section-tag is defined,
        ;; but the section tag hasn't been found. We choose to assume that the
        ;; user deleted it intentionally and wants us to behave in this buffer
        ;; as if the section tag was set "", so we do that, now.
        ;;(setq footnote-section-tag "")
        ;;
        ;; HOWEVER: The rest of footnote mode does not currently honor or
        ;; account for this.
        ;;
        ;; To illustrate the difference in behavior, create a few footnotes,
        ;; delete the section tag, and create another footnote. Then undo,
        ;; comment the above line (that sets the tag to ""), re-evaluate this
        ;; function, and repeat.
        ;;
        ;; TODO: integrate sanity checks at reasonable operational points.
        (point))))))