Browse Source

Fix some case issues with comment processing during export

Carsten Dominik 15 years ago
parent
commit
70f9001368
2 changed files with 7 additions and 2 deletions
  1. 3 0
      lisp/ChangeLog
  2. 4 2
      lisp/org-exp.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2010-01-06  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-exp.el (org-export-remove-comment-blocks-and-subtrees): Make
+	sure case-folding works well when processing comment stuff.
+
 	* org-latex.el (org-export-latex-after-save-hook): New hook.
 	(org-export-as-latex): Run the new hook.
 

+ 4 - 2
lisp/org-exp.el

@@ -1866,14 +1866,16 @@ table line.  If it is a link, add it to the line containing the link."
 (defun org-export-remove-comment-blocks-and-subtrees ()
   "Remove the comment environment, and also commented subtrees."
   (let ((re-commented (concat "^\\*+[ \t]+" org-comment-string "\\>"))
-	(case-fold-search nil))
+	case-fold-search)
     ;; Remove comment environment
     (goto-char (point-min))
+    (setq case-fold-search t)
     (while (re-search-forward
-	    "^#\\+BEGIN_COMMENT[ \t]*\n[^\000]*?^#\\+END_COMMENT\\>.*" nil t)
+	    "^#\\+begin_comment[ \t]*\n[^\000]*?^#\\+end_comment\\>.*" nil t)
       (replace-match "" t t))
     ;; Remove subtrees that are commented
     (goto-char (point-min))
+    (setq case-fold-search nil)
     (while (re-search-forward re-commented nil t)
       (goto-char (match-beginning 0))
       (delete-region (point) (org-end-of-subtree t)))))