Sfoglia il codice sorgente

Make sure Drawers are not exported, also before the first headline.
This bug was reported by Daniel J. Sinder.

Carsten Dominik 18 anni fa
parent
commit
563e947c85
2 ha cambiato i file con 19 aggiunte e 13 eliminazioni
  1. 6 0
      ChangeLog
  2. 13 13
      org.el

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2008-02-09  Carsten Dominik  <dominik@science.uva.nl>
+
+	* 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  <dominik@science.uva.nl>
 
 	* org.el (org-clock-report): Show the clocktable when found.

+ 13 - 13
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))