From 56b558d15a0e0330aa8b5cb96fad31d0daac8b38 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 28 Jun 2011 17:07:37 +0200 Subject: [PATCH] org-exp: normalize footnotes after removing commented subtrees * lisp/org-exp.el (org-export-preprocess-string): if the last subtree is commented, footnotes inserted during normalizing at the end of the buffer may get deleted. This patch ensures deletion comes first, normalization second. --- lisp/org-exp.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 3674d19cb..a00a71ffd 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1119,10 +1119,6 @@ on this string to produce the exported version." (org-export-handle-include-files-recurse) (run-hooks 'org-export-preprocess-after-include-files-hook) - ;; Normalize footnotes - (when (plist-get parameters :footnotes) - (org-footnote-normalize nil 'pre-process-p)) - ;; Change lists ending. Other parts of export may insert blank ;; lines and lists' structure could be altered. (org-export-mark-list-end) @@ -1130,7 +1126,7 @@ on this string to produce the exported version." ;; Process the macros (org-export-preprocess-apply-macros) (run-hooks 'org-export-preprocess-after-macros-hook) - + ;; Get rid of archived trees (org-export-remove-archived-trees archived-trees) @@ -1142,6 +1138,10 @@ on this string to produce the exported version." (plist-get parameters :exclude-tags)) (run-hooks 'org-export-preprocess-after-tree-selection-hook) + ;; Normalize footnotes + (when (plist-get parameters :footnotes) + (org-footnote-normalize nil 'pre-process-p)) + ;; Get rid of tasks, depending on configuration (org-export-remove-tasks (plist-get parameters :tasks))