org-footnote: update changes for odt exporter

* lisp/org-footnote.el (org-footnote-normalize): make use of
  `org-footnote-insert-pos-for-preprocessor'.
This commit is contained in:
Nicolas Goaziou 2011-06-26 10:46:15 +02:00
parent 30944f228e
commit 28bfc26024
1 changed files with 12 additions and 6 deletions

View File

@ -482,11 +482,11 @@ When SORT-ONLY is set, only sort the footnote definitions into the
referenced sequence. referenced sequence.
When PRE-PROCESS-P is non-nil, the default action, is to insert When PRE-PROCESS-P is non-nil, the default action, is to insert
normalized footnotes towards the end of the pre-processing normalized footnotes towards the end of the pre-processing buffer.
buffer. Some exporters like docbook, odt etc expect that footnote Some exporters like docbook, odt, etc. expect that footnote
definitions be available before any references to them. Such definitions be available before any references to them. Such
exporters can let bind `org-footnote-insert-pos-for-preprocessor' exporters can let bind `org-footnote-insert-pos-for-preprocessor' to
to symbol 'point-min to achieve the desired behaviour. symbol 'point-min to achieve the desired behaviour.
Additional note on `org-footnote-insert-pos-for-preprocessor': Additional note on `org-footnote-insert-pos-for-preprocessor':
1. This variable has not effect when FOR-PREPROCESSOR is nil. 1. This variable has not effect when FOR-PREPROCESSOR is nil.
@ -607,8 +607,14 @@ Additional note on `org-footnote-insert-pos-for-preprocessor':
(t x))) (t x)))
ref-table))) ref-table)))
(setq ref-table (nreverse ref-table)) (setq ref-table (nreverse ref-table))
;; 4. Insert the footnotes again in the buffer, at INS-POINT. ;; 4. Insert the footnotes again in the buffer, at the
(goto-char (or ins-point (point-max))) ;; appropriate spot.
(goto-char (or
(and pre-process-p
(eq org-footnote-insert-pos-for-preprocessor 'point-min)
(point-min))
ins-point
(point-max)))
(cond (cond
((not ref-table)) ; no footnote: exit ((not ref-table)) ; no footnote: exit
;; Cases when footnotes should be inserted together in one place. ;; Cases when footnotes should be inserted together in one place.