emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Should comments break paragraphs?


From: Eric Schulte
Subject: Re: [O] Should comments break paragraphs?
Date: Tue, 16 Jul 2013 10:59:25 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Nicolas Goaziou <address@hidden> writes:

> Hello,
>
> Eric Schulte <address@hidden> writes:
>
>> When Org-mode is used as a document preparation language inline comments
>> are very useful.  The use case being notes on the surrounding material
>> which are not to be published.  Both HTML and LaTeX support comments and
>> at least in LaTeX they are extensively used (in my experience) and can
>> be very helpful.
>
> Again, Org is neither LaTeX nor HTML.
>

I did not intend to suggest that Org was either LaTeX or HTML.

Org-mode is a document preparation system, and I think there is a strong
motivation for the inline comment use case in any document preparation
system.

>
>> Stripping lines starting with "^ *#[^+]" is a trivial pre-processing
>> step, and would support the traditional Org-mode comments which (as I
>> recall) could previously appear mid paragraph without causing
>> problems.
>
>> The attached patch worked on some small example files for me.
>
> As I explained in a previous post, it's only a kludge hiding the real
> problem: comments cannot appear anywhere, even if we don't take export
> into account.

So are you proposing to remove comments from Org-mode entirely?  I think
this would be a significant regression.

> Actually, handling comments during export is the easiest part of the
> problem.
>

Yes, I can see how teaching e.g., the new list parser to ignore comments
could be tricky.

>
>> From ce4c30ebe56d4cd66810bca48824d8841e7b130d Mon Sep 17 00:00:00 2001
>> From: Eric Schulte <address@hidden>
>> Date: Tue, 16 Jul 2013 09:44:59 -0600
>> Subject: [PATCH] support inline comments w/o breaking paragraphs
>>
>> * lisp/org-element.el (org-element-parse-buffer): Strip inline comments
>>   as a pre-processing step before exporting.
>
> The parser is unrelated to the export process, so export pre-processing
> shouldn't happen in org-element.el. Also, parsing a buffer mustn't
> modify it in the process.
>

But if we treat comments as semantically empty, then maybe they should
be ignored by the parser?

>
> Even if you move it to ox.el, this is not an acceptable solution. Think
> about the following example
>
>  - item 1
>
>    # with a comment
>
>  - item 2
>
> If you simply delete matching lines, you break the list.
>

Yes, I would argue that this list should be broken, because with or
without the comment the items are separated by two blank lines.  In my
opinion comments as semantically empty lines is a simple rule for both
users and parsers to understand.

Cheers,

>
>
> Regards,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



reply via email to

[Prev in Thread] Current Thread [Next in Thread]