Function: footnote--insert-footnote

footnote--insert-footnote is a byte-compiled function defined in footnote.el.gz.

Signature

(footnote--insert-footnote ARG)

Documentation

Insert a footnote numbered ARG, at (point).

Source Code

;; Defined in /usr/src/emacs/lisp/mail/footnote.el.gz
(defun footnote--insert-footnote (arg)
  "Insert a footnote numbered ARG, at (point)."
  (push-mark)
  (let ((ptr (footnote--insert-numbered-footnote arg t)))
    (footnote--goto-char-point-max)
    (if (footnote--goto-first)
        (save-restriction
	  (when footnote-narrow-to-footnotes-when-editing
	    (footnote--narrow-to-footnotes))
	  (footnote-goto-footnote (1- arg)) ; evil, FIXME (less evil now)
	  ;; (message "Inserting footnote %d" arg)
	  (or (eq arg 1)
	      (when (re-search-forward
		     (if footnote-spaced-footnotes
			 "\n\n"
		       (concat "\n" (footnote--current-regexp)))
		     nil t)
		(beginning-of-line)
                t)
	      (footnote--goto-char-point-max)
	      (footnote--goto-first)))
      (unless (looking-at "^$")
        (insert "\n"))
      (when (eobp)
        (insert "\n"))
      (unless (string-equal footnote-section-tag "")
        (insert footnote-section-tag "\n")))
    (let ((text (footnote--insert-numbered-footnote arg nil)))
      (footnote--insert-markers arg text ptr))))