From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: Use of attribute :parent in org-element.el Date: Fri, 19 Apr 2013 17:37:26 +0200 Message-ID: <87obdacz0p.fsf@gmail.com> References: <871ua6ejxr.fsf@gmail.com> <871ua6pnit.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:56632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UTDQ2-00052X-Oe for emacs-orgmode@gnu.org; Fri, 19 Apr 2013 11:40:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UTDPy-0005OH-NA for emacs-orgmode@gnu.org; Fri, 19 Apr 2013 11:40:10 -0400 Received: from plane.gmane.org ([80.91.229.3]:40313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UTDPy-0005Ni-Gk for emacs-orgmode@gnu.org; Fri, 19 Apr 2013 11:40:06 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UTDPv-0002O0-5X for emacs-orgmode@gnu.org; Fri, 19 Apr 2013 17:40:03 +0200 Received: from g231107063.adsl.alicedsl.de ([92.231.107.63]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 19 Apr 2013 17:40:03 +0200 Received: from tjolitz by g231107063.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 19 Apr 2013 17:40:03 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Nicolas Goaziou writes: > Hello, > > Thorsten Jolitz 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