Export: Handle empty drawers, and drawers that are missing the :END:

Export could loose large parts of a document if an empty drawer was
present.
This commit is contained in:
Carsten Dominik 2009-04-22 06:37:00 +02:00
parent 7596db2d78
commit ec773949d1
2 changed files with 17 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2009-04-22 Carsten Dominik <carsten.dominik@gmail.com>
* org-exp.el (org-export-remove-or-extract-drawers): Handle empty
drawers, and drawers that are missing the :END: line.
2009-04-21 Carsten Dominik <carsten.dominik@gmail.com>
* org-clock.el (org-clock-goto): Go to recently clocked task if no

View File

@ -1447,10 +1447,20 @@ whose content to keep."
(org-delete-all exp-drawers
(copy-sequence all-drawers))
"\\|")
"\\):[ \t]*\n\\([^\000]*?\n\\)?[ \t]*:END:[ \t]*\n")))
"\\):[ \t]*$"))
beg eol)
(while (re-search-forward re nil t)
(org-if-unprotected
(replace-match ""))))))
(setq beg (match-beginning 0)
eol (match-end 0))
(if (re-search-forward "^\\([ \t]*:END:[ \t]*\n?\\)\\|^\\*+[ \t]"
nil t)
(if (match-end 1)
;; terminated in this entry
(progn
(delete-region beg (match-end 1))
(goto-char beg))
(goto-char eol))))))))
(defun org-export-handle-export-tags (select-tags exclude-tags)
"Modify the buffer, honoring SELECT-TAGS and EXCLUDE-TAGS.