forked from mirrors/org-mode
org-footnote: Clean-up `org-footnote-normalize'
* lisp/org-footnote.el (org-footnote-normalize): Remove an useless part of the function. (org-insert-footnote-reference-near-definition): Remove function.
This commit is contained in:
parent
6b91eb9e65
commit
c8020dd42e
|
@ -817,7 +817,7 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
|
||||||
(when export-props (setq org-export-footnotes-seen ref-table)))
|
(when export-props (setq org-export-footnotes-seen ref-table)))
|
||||||
;; Each footnote definition has to be inserted at the end of
|
;; Each footnote definition has to be inserted at the end of
|
||||||
;; the section where its first reference belongs.
|
;; the section where its first reference belongs.
|
||||||
((not sort-only)
|
(t
|
||||||
(mapc
|
(mapc
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
(let ((pos (nth 4 x)))
|
(let ((pos (nth 4 x)))
|
||||||
|
@ -826,24 +826,7 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
|
||||||
(set-marker pos nil))
|
(set-marker pos nil))
|
||||||
(org-footnote-goto-local-insertion-point)
|
(org-footnote-goto-local-insertion-point)
|
||||||
(insert (format "\n[%s] %s\n" (nth 1 x) (nth 2 x))))
|
(insert (format "\n[%s] %s\n" (nth 1 x) (nth 2 x))))
|
||||||
ref-table))
|
ref-table))))))
|
||||||
;; Else, insert each definition at the end of the section
|
|
||||||
;; containing their first reference. Happens only in Org files
|
|
||||||
;; with no special footnote section, and only when doing
|
|
||||||
;; sorting.
|
|
||||||
(t (mapc 'org-insert-footnote-reference-near-definition
|
|
||||||
ref-table))))))
|
|
||||||
|
|
||||||
(defun org-insert-footnote-reference-near-definition (entry)
|
|
||||||
"Find first reference of footnote ENTRY and insert the definition there.
|
|
||||||
ENTRY is (fn-label num-mark definition)."
|
|
||||||
(when (car entry)
|
|
||||||
(goto-char (point-min))
|
|
||||||
(let ((ref (org-footnote-get-next-reference (car entry))))
|
|
||||||
(when ref
|
|
||||||
(goto-char (nth 2 ref))
|
|
||||||
(org-footnote-goto-local-insertion-point)
|
|
||||||
(insert (format "\n[%s] %s\n" (car entry) (nth 2 entry)))))))
|
|
||||||
|
|
||||||
(defun org-footnote-goto-local-insertion-point ()
|
(defun org-footnote-goto-local-insertion-point ()
|
||||||
"Find insertion point for footnote, just before next outline heading."
|
"Find insertion point for footnote, just before next outline heading."
|
||||||
|
|
Loading…
Reference in New Issue