emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Thorsten Jolitz <tjolitz@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Use of attribute :parent in org-element.el
Date: Fri, 19 Apr 2013 17:07:22 +0200	[thread overview]
Message-ID: <871ua6pnit.fsf@gmail.com> (raw)
In-Reply-To: <871ua6ejxr.fsf@gmail.com> (Thorsten Jolitz's message of "Fri, 19 Apr 2013 15:20:16 +0200")


Thorsten Jolitz <tjolitz@gmail.com> writes:

> The use of the :parent attribute is surprising for me. I would have
> expected something like ':parent org-mode everywhere' in the second
> example, i.e. the title of the 1st level subtree containing the 2nd
> level headline at point.

`org-element-at-point' and `org-element-context' return information
about the close neighbourhood of point, which is the current section. In
other words, each element at top level within the section get
a nil :parent property.

As a special case, when point is at a headline, each function returns
the parsed headline, without any :parent property defined (it would be
out of the scope of these functions).

> I'm not sure what I would have expected in the first example. What is
> the parent of an element that is contained in a greater element that has
> a parent? Is it nil, or is it the parent of its containing greater
> element?

If you parse completely the buffer with `org-element-parse-buffer', you
will see that genealogy for property drawer goes like this:

  property-drawer > section > headline > headline > org-data


Nicolas Goaziou

  reply	other threads:[~2013-04-19 15:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19 13:20 Use of attribute :parent in org-element.el Thorsten Jolitz
2013-04-19 15:07 ` Nicolas Goaziou [this message]
2013-04-19 15:37   ` Thorsten Jolitz

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:

  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=871ua6pnit.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tjolitz@gmail.com \


* 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


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).