From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Should comments break paragraphs? Date: Wed, 17 Jul 2013 11:00:07 +0200 Message-ID: <87ip09k1d4.fsf@gmail.com> References: <51E443F6.2050104@arfer.net> <87mwpnfybn.fsf@gmail.com> <51E47BC1.7010808@gmail.com> <87ip0byoqg.fsf@gmail.com> <87fvvev771.fsf@gmail.com> <87wqoqxznb.fsf@gmail.com> <87ppuitp8y.fsf@gmail.com> <87sizexuj9.fsf@gmail.com> <87li55lpqd.fsf@bzg.ath.cx> <87mwplk645.fsf@gmail.com> <87fvvdk3es.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzNaW-0002qj-LD for emacs-orgmode@gnu.org; Wed, 17 Jul 2013 04:59:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UzNaV-0000yB-I0 for emacs-orgmode@gnu.org; Wed, 17 Jul 2013 04:59:56 -0400 In-Reply-To: <87fvvdk3es.fsf@bzg.ath.cx> (Bastien's message of "Wed, 17 Jul 2013 10:15:55 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: Christian Wittern , emacs-orgmode@gnu.org, Eric Schulte Bastien 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