[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Use of attribute :parent in org-element.el
From: |
Thorsten Jolitz |
Subject: |
Re: [O] Use of attribute :parent in org-element.el |
Date: |
Fri, 19 Apr 2013 17:37:26 +0200 |
User-agent: |
Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux) |
Nicolas Goaziou <address@hidden> writes:
> 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
I understand, thanks, so the whole info is only available when parsing
the complete buffer.
--
cheers,
Thorsten