emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] Did COMMENT break?
@ 2011-03-13 23:33 Rasmus
  2011-03-14  0:48 ` Nick Dokos
  0 siblings, 1 reply; 5+ messages in thread
From: Rasmus @ 2011-03-13 23:33 UTC (permalink / raw)
  To: emacs-orgmode

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:

,----
| <snip>
| <h1 class="title">this is a test</h1>
| 
| <div class="org-comment">
| </br>
| <p>
| <p>
| Don't export me
| </p>
| </div>
| 
| I'd like to be exposed
| <snip>
`----

The LaTeX export is:

,----
| \begin{verbatim}
| Don't export me
| \end{verbatim}
| I'd like to be exposed
`----

On another note, on the official Org-site, the link to the pdf-manual is
wrong. It links to 

    http://orgmode.org/manual/release_7.5/ 

which doesn't exists. I guess it should be linking to 

    http://orgmode.org/org.pdf

-- 
Thanks,
Rasmus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] Did COMMENT break?
  2011-03-13 23:33 [BUG] Did COMMENT break? Rasmus
@ 2011-03-14  0:48 ` Nick Dokos
  2011-03-14 11:40   ` Rasmus
  2011-04-08 10:11   ` Carsten Dominik
  0 siblings, 2 replies; 5+ messages in thread
From: Nick Dokos @ 2011-03-14  0:48 UTC (permalink / raw)
  To: Rasmus; +Cc: nicholas.dokos, emacs-orgmode

Rasmus <rasmus.pank@gmail.com> 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:
> 
> ,----
> | <snip>
> | <h1 class="title">this is a test</h1>
> | 
> | <div class="org-comment">
> | </br>
> | <p>
> | <p>
> | Don't export me
> | </p>
> | </div>
> | 
> | I'd like to be exposed
> | <snip>
> `----
> 
> 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---
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index 34f101d..e1dcea0 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -1834,7 +1834,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))
--8<---------------cut here---------------end--------------->8---

Nick

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [BUG] Did COMMENT break?
  2011-03-14  0:48 ` Nick Dokos
@ 2011-03-14 11:40   ` Rasmus
  2011-03-14 15:40     ` Rasmus
  2011-04-08 10:11   ` Carsten Dominik
  1 sibling, 1 reply; 5+ messages in thread
From: Rasmus @ 2011-03-14 11:40 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

Hi Thanks,

> 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:

Hmm, it still does not seem to work for me, but I might not have changed 
the files correctly.

--Rasmus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] Did COMMENT break?
  2011-03-14 11:40   ` Rasmus
@ 2011-03-14 15:40     ` Rasmus
  0 siblings, 0 replies; 5+ messages in thread
From: Rasmus @ 2011-03-14 15:40 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

>> 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:
>
> Hmm, it still does not seem to work for me, but I might not have changed
> the files correctly.

Please ignore the above. Nicholas' patch works as described. I'd just 
forgotten to bite-compile ex post.

Thanks Nicholas.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] Did COMMENT break?
  2011-03-14  0:48 ` Nick Dokos
  2011-03-14 11:40   ` Rasmus
@ 2011-04-08 10:11   ` Carsten Dominik
  1 sibling, 0 replies; 5+ messages in thread
From: Carsten Dominik @ 2011-04-08 10:11 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode, Rasmus

I have applied the patch.

- Carsten

On Mar 14, 2011, at 1:48 AM, Nick Dokos wrote:

> Rasmus <rasmus.pank@gmail.com> 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:
>> 
>> ,----
>> | <snip>
>> | <h1 class="title">this is a test</h1>
>> | 
>> | <div class="org-comment">
>> | </br>
>> | <p>
>> | <p>
>> | Don't export me
>> | </p>
>> | </div>
>> | 
>> | I'd like to be exposed
>> | <snip>
>> `----
>> 
>> 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---
> diff --git a/lisp/org-exp.el b/lisp/org-exp.el
> index 34f101d..e1dcea0 100644
> --- a/lisp/org-exp.el
> +++ b/lisp/org-exp.el
> @@ -1834,7 +1834,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))
> --8<---------------cut here---------------end--------------->8---
> 
> Nick
> 
> 

- Carsten

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-04-08 10:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-13 23:33 [BUG] Did COMMENT break? Rasmus
2011-03-14  0:48 ` Nick Dokos
2011-03-14 11:40   ` Rasmus
2011-03-14 15:40     ` Rasmus
2011-04-08 10:11   ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).