org-odt.el: Fix earlier commit

This commit is contained in:
Jambunathan K 2012-01-27 13:13:27 +05:30
parent 90beabb7ab
commit 4beec074d0
1 changed files with 3 additions and 3 deletions

View File

@ -33,17 +33,17 @@
:tag "Org Export ODT"
:group 'org-export)
(defvar org-lparse-dyn-first-heading-pos) ; let bound during org-do-lparse
(defun org-odt-insert-toc ()
(goto-char (point-min))
(cond
((re-search-forward
"\\(<text:p [^>]*>\\)?\\s-*\\[TABLE-OF-CONTENTS\\]\\s-*\\(</text:p>\\)?"
nil t)
(goto-char (match-beginning 0))
(replace-match ""))
(t
(goto-char org-lparse-dyn-first-heading-pos))
(insert (org-odt-format-toc))))
(goto-char org-lparse-dyn-first-heading-pos)))
(insert (org-odt-format-toc)))
(defun org-odt-end-export ()
(org-odt-insert-toc)