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")
Hello,
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
Regards,
--
Nicolas Goaziou
next prev parent 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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* 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 \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.