emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Bastien <bzg@gnu.org>
Cc: Christian Wittern <cwittern@gmail.com>,
	emacs-orgmode@gnu.org, Eric Schulte <schulte.eric@gmail.com>
Subject: Re: Should comments break paragraphs?
Date: Wed, 17 Jul 2013 11:00:07 +0200	[thread overview]
Message-ID: <87ip09k1d4.fsf@gmail.com> (raw)
In-Reply-To: <87fvvdk3es.fsf@bzg.ath.cx> (Bastien's message of "Wed, 17 Jul 2013 10:15:55 +0200")

Bastien <bzg@gnu.org> writes:

> By considered an empty line, I mean this:
>
> This is
> # a comment
> within a paragraph.
>
> If "# a comment" is considered to be an empty line (i.e. a no-line),
> then the above is treated as one single paragraph.  If it is treated
> as a blank line, the above is treated as three paragraphs: a first
> paragraph, a commented paragraph, another paragraph.

Why is it an issue on the Org side? So far, it only seems to be an
annoyance when exporting to HTML (and maybe ODT).

>> More importantly, where, precisely, comments should be
>> allowed to appear in an Org buffer?
>
> I think "no-line" comments they should be allowed anywhere expect in
> src code blocks, where the comment syntax is different.
>
> For example this list:
>
> - an item
> # a comment
> - another item
>
> would be treated as
>
> - an item
> - another item
>
> etc.

Then it requires serious coding in many parts of Org, as I already
explained in this thread.

> I think we have two options: either define comments in Org syntax,
> either treat them as normal lines and delete them before parsing a
> buffer for export purposes.

I already explained why the second "option" wasn't one. Look again at
your example:

  1. an item
  # a normal line breaking the list
  1. an item in another list

but, upon exporting, both items will belong to the same list. This is
just nonsensical.

> A simple (setq org-export-ignore-comments t) would put the user in
> the second situation, where comments are deleted before parsing and
> exporting, and treated as standard citizens when manipulating or
> buffers.  (Eric's patch goes into that direction.)

And the direction is wrong... Parsing shouldn't modify the buffer being
parsed, ever. But you can use a hook for that purpose.

> Then (setq org-export-ignore-comments nil) would put us in the first
> situation, which is the current one, where comments are defines as
> elements within Org syntax, with some constraints when parsing or
> exporting them (such as separating a paragraph.)
>
> What do you think?

I still think the same. Comments belong to Org syntax (if they don't,
you can't even fill them correctly, for example). If you redefine them,
there's no easy workaround. You have to change every part of Org that
assumes there will be no comment in its way (lists, agenda, babel,
parser and probably more I can't think of).

If it's an HTML/ODT export issue, it's far easier to patch the export
back-ends instead. 10 lines of code in each one, maybe.


Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2013-07-17  8:59 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-15 18:48 Should comments break paragraphs? Kodi Arfer
2013-07-15 18:54 ` Nicolas Goaziou
2013-07-15 22:46   ` Christian Wittern
2013-07-16  6:53     ` Rainer M Krug
2013-07-16  6:59     ` Nicolas Goaziou
2013-07-16  7:09       ` Rainer M Krug
2013-07-16  7:40         ` Nicolas Goaziou
2013-07-16  8:09           ` Rainer M Krug
2013-07-16  8:19             ` Andreas Leha
2013-07-16  8:44               ` Nicolas Goaziou
2013-07-16  8:55                 ` Andreas Leha
2013-07-16 17:08                 ` Eric S Fraga
2013-07-16  8:26             ` Nicolas Goaziou
2013-07-16  8:21           ` Fabrice Popineau
2013-07-16  8:27             ` Fabrice Popineau
2013-07-16 15:46       ` Eric Schulte
2013-07-16 16:01         ` Nicolas Goaziou
2013-07-16 16:59           ` Eric Schulte
2013-07-16 17:51             ` Nicolas Goaziou
2013-07-17  5:28               ` Bastien
2013-07-17  7:17                 ` Nicolas Goaziou
2013-07-17  8:15                   ` Bastien
2013-07-17  9:00                     ` Nicolas Goaziou [this message]
2013-07-17 12:57                       ` Bastien
2013-07-17 13:21                         ` Rainer M Krug
2013-07-17 13:52                           ` Rasmus
2013-07-17 16:10                             ` Eric S Fraga
2013-07-18  7:02                               ` Christian Moe
2013-07-18  8:31                                 ` Eric Abrahamsen
2013-07-18  8:50                                   ` Rasmus
2013-07-18  9:50                                     ` Eric Abrahamsen
2013-07-18  8:47                                 ` Rasmus
2013-07-17 13:28                         ` Eric Schulte
2013-07-17 14:30                           ` Bastien
2013-07-17 13:47                         ` Nicolas Goaziou
2013-07-17 18:48                           ` Eric S Fraga
2013-07-17 19:04                             ` Nicolas Goaziou
2013-07-17 20:18                               ` Eric S Fraga
2013-07-17  7:11               ` Suvayu Ali
2013-07-17 12:54               ` Eric Schulte
2013-07-17 13:52                 ` Nicolas Goaziou
2013-07-17 22:05                 ` Andreas Leha
2013-07-17 22:11                   ` Eric Schulte
2013-07-17 22:34                     ` Andreas Leha
2013-07-18 11:23                     ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ip09k1d4.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=bzg@gnu.org \
    --cc=cwittern@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=schulte.eric@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).