diff options
author | Nicolas Goaziou <n.goaziou@gmail.com> | 2011-06-26 18:44:27 +0200 |
---|---|---|
committer | Nicolas Goaziou <n.goaziou@gmail.com> | 2011-06-29 12:00:43 +0200 |
commit | 06a4c2c8d0737fd4a2b405dec435648b19b4578a (patch) | |
tree | 39e9fabd81a09b235fec7baa5d6da11b91eb0229 | |
parent | 28bfc2602459553f7a9380d65a419a3020fd6f56 (diff) | |
download | org-mode-06a4c2c8d0737fd4a2b405dec435648b19b4578a.tar.gz |
org-footnote: better normalization during export
* lisp/org-footnote.el (org-footnote-normalize): remember footnotes
seen so far by the exporter when choosing the new marker.
-rw-r--r-- | lisp/org-footnote.el | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el index f12d018..052a55e 100644 --- a/lisp/org-footnote.el +++ b/lisp/org-footnote.el @@ -508,10 +508,11 @@ Additional note on `org-footnote-insert-pos-for-preprocessor': (outline-regexp (concat "\\*" (if nstars (format "\\{1,%d\\} " nstars) "+ "))) ;; Determine the highest marker used so far. - (count (if (and pre-process-p org-export-footnotes-markers) - (apply 'max (mapcar 'car org-export-footnotes-markers)) + (ref-table (when pre-process-p org-export-footnotes-markers)) + (count (if (and pre-process-p ref-table) + (apply 'max (mapcar (lambda (e) (nth 1 e)) ref-table)) 0)) - ref-table ins-point ref) + ins-point ref) (save-excursion ;; 1. Find every footnote reference, extract the definition, and ;; collect that data in REF-TABLE. If SORT-ONLY is nil, also @@ -629,10 +630,7 @@ Additional note on `org-footnote-insert-pos-for-preprocessor': ;; When exporting, add newly insert markers along with their ;; associated definition to `org-export-footnotes-markers'. (when pre-process-p - (setq org-export-footnotes-markers - (append (mapcar (lambda (ref) (cons (nth 1 ref) (nth 2 ref))) - ref-table) - org-export-footnotes-markers)))) + (setq org-export-footnotes-markers 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 |