emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Use of attribute :parent in org-element.el


From: Nicolas Goaziou
Subject: Re: [O] Use of attribute :parent in org-element.el
Date: Fri, 19 Apr 2013 17:07:22 +0200

Hello,

Thorsten Jolitz <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]