From 9e15cf4fc296a5a1093aa912b0a6abd37e865f9a Mon Sep 17 00:00:00 2001 From: Nick Dokos Date: Mon, 14 Mar 2011 05:48:15 +0000 Subject: [PATCH] Fix begin/end comment * lisp/org-exp.el (org-export-remove-comment-blocks-and-subtrees): Fix regexp. Rasmus wrote: > Hi, > It seems that > > ,---- > | #+BEGIN_COMMENT > | ... > | #+END_COMMENT > `---- > > Might be broken in Org-mode 7.5. According to the manual, > > ,---- > | Finally, regions surrounded by > | #+BEGIN_COMMENT ... #+END_COMMENT will not be exported. > `---- > > Consider the following example generated with Org-mode 7.5 in Emacs 24.0.50 > (started without config files). > > ,---- > | #+TITLE: this is a test > | > | #+BEGIN_COMMENT > | Don't export me > | #+END_COMMENT > | > | I'd like to be exposed > `---- > > The HTML export is: > > ,---- > | > |

this is a test

> | > |
> |
> |

> |

> | Don't export me > |

> |
> | > | I'd like to be exposed > | > `---- > > The LaTeX export is: > > ,---- > | \begin{verbatim} > | Don't export me > | \end{verbatim} > | I'd like to be exposed > `---- > Indeed. It seems that one of the hair-raising regexps that Carsten manages to come up with is not quite right. Try this patch for now: --8<---------------cut here---------------start------------->8--- --8<---------------cut here---------------end--------------->8--- Nick --- lisp/org-exp.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-exp.el b/lisp/org-exp.el index eb2621bef..8111e1ccc 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1879,7 +1879,7 @@ table line. If it is a link, add it to the line containing the link." (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]*?\n#\\+end_comment\\>.*" nil t) (replace-match "" t t)) ;; Remove subtrees that are commented (goto-char (point-min)) -- 2.11.4.GIT