From 563e947c850c599552d7a2ad12c75a56bf59d006 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Sat, 9 Feb 2008 08:22:44 +0100 Subject: [PATCH] Make sure Drawers are not exported, also before the first headline. This bug was reported by Daniel J. Sinder. --- ChangeLog | 6 ++++++ org.el | 26 +++++++++++++------------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index bec34b841..093261638 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-09 Carsten Dominik + + * org.el (org-cleaned-string-for-export): Get rid of drawers + first, so that they will be removed also in the text before the + first headline. + 2008-02-08 Carsten Dominik * org.el (org-clock-report): Show the clocktable when found. diff --git a/org.el b/org.el index 285683c2b..15c8e375a 100644 --- a/org.el +++ b/org.el @@ -23887,6 +23887,19 @@ translations. There is currently no way for users to extend this.") (let ((org-inhibit-startup t)) (org-mode)) (untabify (point-min) (point-max)) + ;; Get rid of drawers + (unless (eq t exp-drawers) + (goto-char (point-min)) + (let ((re (concat "^[ \t]*:\\(" + (mapconcat + 'identity + (org-delete-all exp-drawers + (copy-sequence drawers)) + "\\|") + "\\):[ \t]*\n\\([^@]*?\n\\)?[ \t]*:END:[ \t]*\n"))) + (while (re-search-forward re nil t) + (replace-match "")))) + ;; Get the correct stuff before the first headline (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) @@ -23910,19 +23923,6 @@ translations. There is currently no way for users to extend this.") b (org-end-of-subtree t)) (if (> b a) (delete-region a b))))) - ;; Get rid of drawers - (unless (eq t exp-drawers) - (goto-char (point-min)) - (let ((re (concat "^[ \t]*:\\(" - (mapconcat - 'identity - (org-delete-all exp-drawers - (copy-sequence drawers)) - "\\|") - "\\):[ \t]*\n\\([^@]*?\n\\)?[ \t]*:END:[ \t]*\n"))) - (while (re-search-forward re nil t) - (replace-match "")))) - ;; Find targets in comments and move them out of comments, ;; but mark them as targets that should be invisible (goto-char (point-min))