Nicolas Goaziou <n.goaz...@gmail.com> writes: > Hello, > > Thorsten Jolitz <tjol...@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
I understand, thanks, so the whole info is only available when parsing the complete buffer. -- cheers, Thorsten