From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Should comments break paragraphs? Date: Tue, 16 Jul 2013 10:59:25 -0600 Message-ID: <87ppuitp8y.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> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uz8d4-0000nf-Ql for emacs-orgmode@gnu.org; Tue, 16 Jul 2013 13:01:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uz8cz-0000nD-BL for emacs-orgmode@gnu.org; Tue, 16 Jul 2013 13:01:34 -0400 Received: from mail-pb0-x22d.google.com ([2607:f8b0:400e:c01::22d]:56635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uz8cz-0000mU-1O for emacs-orgmode@gnu.org; Tue, 16 Jul 2013 13:01:29 -0400 Received: by mail-pb0-f45.google.com with SMTP id mc8so908146pbc.4 for ; Tue, 16 Jul 2013 10:01:28 -0700 (PDT) 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: Nicolas Goaziou Cc: Christian Wittern , emacs-orgmode@gnu.org Nicolas Goaziou writes: > Hello, > > Eric Schulte 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 >> 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