emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: Mark Edgington <edgimar@gmail.com>,
	emacs-orgmode <emacs-orgmode@gnu.org>,
	Nicolas Girard <girard.nicolas@gmail.com>
Subject: Re: proposal to have ignoreheading tags/properties
Date: Sat, 14 Jun 2014 14:43:10 +0200	[thread overview]
Message-ID: <87mwdfzmox.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <871tutx4t4.fsf@gmail.com> (Eric Schulte's message of "Thu, 12 Jun 2014 16:13:27 -0400")

Hello,

Eric Schulte <schulte.eric@gmail.com> 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: « Can
I close an outline section without starting a new section? »
(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,

-- 
Nicolas Goaziou

  parent reply	other threads:[~2014-06-14 12:42 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-12 16:49 proposal to have ignoreheading tags/properties Mark Edgington
2014-06-12 17:32 ` Thorsten Jolitz
2014-06-12 17:41   ` Ken Mankoff
2014-06-12 18:11     ` Thorsten Jolitz
2014-06-12 18:16       ` Ken Mankoff
2014-06-13 14:32       ` Rasmus
2014-06-13 15:02         ` Thorsten Jolitz
2014-06-12 18:09   ` Mark Edgington
2014-06-12 18:12 ` Eric Schulte
2014-06-12 18:54   ` Aaron Ecay
2014-06-12 19:21     ` Nicolas Girard
2014-06-12 19:26       ` Ken Mankoff
2014-06-12 19:52         ` Nicolas Girard
2014-06-13  1:20         ` Samuel Wales
2014-06-12 19:34       ` Nicolas Girard
2014-06-12 20:13       ` Eric Schulte
2014-06-12 22:42         ` Nicolas Girard
2014-06-12 23:36           ` Eric Schulte
2014-06-13  0:35         ` Ken Mankoff
2014-06-13  0:46           ` Eric Schulte
2014-06-13  2:35             ` Ken Mankoff
2014-06-13 11:11               ` Eric Schulte
2014-06-13  3:28             ` Mark Edgington
2014-06-13 14:23         ` Rasmus
2014-06-14 12:43         ` Nicolas Goaziou [this message]
2014-06-14 16:48           ` Mark Edgington
2014-06-14 18:12             ` Aaron Ecay
2014-06-14 18:12             ` Nicolas Goaziou
2014-06-14 18:07           ` Aaron Ecay
2014-06-14 18:22             ` Nicolas Goaziou
2014-06-14 22:39               ` Aaron Ecay
2014-06-16  1:14           ` Eric Schulte
2014-06-16  8:08             ` Nicolas Goaziou
2014-06-16 12:19               ` Mark Edgington
2014-06-16 13:29               ` Eric Schulte
2014-06-22  2:03                 ` Aaron Ecay
2014-06-22 23:52                   ` Eric Schulte
2014-07-27 17:21                     ` Bastien
2014-07-28 18:15                       ` Mark Edgington
2014-07-28 18:27                       ` Rasmus
2014-07-28 19:21                         ` Mark Edgington
2014-07-28 19:43                       ` Nicolas Goaziou
2014-07-28 22:01                         ` Rasmus
2014-07-29 14:31                         ` Bastien
2014-08-02  5:16                           ` Mark Edgington
2014-08-06  4:09                             ` Aaron Ecay
2014-06-13  2:38 ` Eric Abrahamsen
2014-06-13  4:07   ` Mark Edgington
2014-06-13  4:44     ` Eric Abrahamsen

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=87mwdfzmox.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=edgimar@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=girard.nicolas@gmail.com \
    --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).