From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: proposal to have ignoreheading tags/properties Date: Sat, 14 Jun 2014 14:43:10 +0200 Message-ID: <87mwdfzmox.fsf@nicolasgoaziou.fr> References: <87tx7qxahl.fsf@gmail.com> <87ppie2c2h.fsf@gmail.com> <871tutx4t4.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51238) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvnIB-00087z-B2 for emacs-orgmode@gnu.org; Sat, 14 Jun 2014 08:42:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WvnI3-00040T-6P for emacs-orgmode@gnu.org; Sat, 14 Jun 2014 08:42:43 -0400 Received: from relay6-d.mail.gandi.net ([2001:4b98:c:538::198]:41335) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvnI2-00040J-ST for emacs-orgmode@gnu.org; Sat, 14 Jun 2014 08:42:35 -0400 In-Reply-To: <871tutx4t4.fsf@gmail.com> (Eric Schulte's message of "Thu, 12 Jun 2014 16:13:27 -0400") 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: Eric Schulte Cc: Mark Edgington , emacs-orgmode , Nicolas Girard Hello, Eric Schulte writes: > Why TODO types rather than a tag? IMO using a TODO type would conflate > task management and document structuring. What do you think about the > attached patch which should add this functionality to the core. Thank you. Unfortunately, in many cases this code will make the parse tree invalid. Consider the example below: * H1 Text1 ** H2 :inline: Text2 A simplified version of the parse tree is: (headline (section (paragraph "Text1")) (headline (section (paragraph "Text2")))) With your function, it becomes (headline (section (paragraph "Text1")) (section (paragraph "Text2"))) which is invalid, as a given headline is not expected to have more than one section. Of course, it is possible to add code in order to merge both sections and get (headline (section (paragraph "Text1") (paragraph "Text2"))) which is exactly what you obtain in the first answer of the FAQ, along with its limitations (see the :noexport: example in the same question). Actually, the problem is deeper than that. This :inline: tag is just a convoluted way to ask for a positive answer to another FAQ: =C2=AB Can I close an outline section without starting a new section? =C2=BB (http://orgmode.org/worg/org-faq.html#closing-outline-sections). Indeed, allowing :include: tags is equivalent to allowing to close sections before the next one, at least at the export level: * Section one Some text ** Subsection one Some text ** Subsection two Some text ** end Subsection Two = :inline: Continue text in section one. This is not possible and goes against so many assumptions in Org that it will always introduce problems, as your function does. Since it cannot work in the general case, I do not think it should go in core. Fortunately, a simple function in `org-export-before-parsing-hook' provides a decent solution already. Users requiring more sophistication can always implement their own function and add it to that hook. OTOH, the situation could be improved wrt :export: and :noexport: tags. We could allow nesting :export: tags within :noexport: tags with the following rule: the :export: headline with the lowest level within the :noexport: tree gets promoted to the root of the tree. Other :export: headlines have their level set relatively to this one. Thus: Text before first headline * H1 Body1 ** H2 :noexport: Body2 *** H3 Body3 *** H4 :export: Body4 **** H5 Body5 will be seen as Text before first headline * H1 Body1 ** H4 Body4 *** H5 Body5 This is not inlining, since "Body2" is lost anyway, and it may require to tag all children of a given headline, but it's already better than the current situation, is robust enough for inclusion in core, and doesn't require introducing a plethora of new special tags. The reverse situation (with swapped :noexport: and :export: tags) is already handled by the exporter. Also, I recall that it is possible to exclude from export some parts of the document with drawers and an appropriate value for `org-export-with-drawers'. The only limitation is that you cannot have a headline or another drawer within a drawer. Regards, --=20 Nicolas Goaziou