From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug: org-element-at-point on headline does not contain :parent property [9.3 (release_9.3 @ /home/yantar92/.emacs.d/straight/build/org/)] Date: Wed, 05 Feb 2020 13:55:52 +0100 Message-ID: <87blqd2nxj.fsf@nicolasgoaziou.fr> References: <874ky0o471.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> <87wo91bixl.fsf@gnu.org> <877e11tl3a.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:44852) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izKE0-0005kU-JI for emacs-orgmode@gnu.org; Wed, 05 Feb 2020 07:56:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izKDz-0008AW-7y for emacs-orgmode@gnu.org; Wed, 05 Feb 2020 07:56:12 -0500 Received: from relay12.mail.gandi.net ([217.70.178.232]:38117) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1izKDz-0007rI-1c for emacs-orgmode@gnu.org; Wed, 05 Feb 2020 07:56:11 -0500 In-Reply-To: <877e11tl3a.fsf@localhost> (Ihor Radchenko's message of "Wed, 05 Feb 2020 17:55:05 +0800") 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-mx.org@gnu.org Sender: "Emacs-orgmode" To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Hello, Ihor Radchenko writes: >> Probably the docstring needs to be adapted - Nicolas knows this area >> better than me. > > Do you mean that :parent property may not always be present? `org-element-at-point' returns only a partial parse tree. It never goes higher than the current top-level element, i.e., from an element, you cannot go up to the headline just following :parent. Luckily, headlines are exactly where you do _not_ need Element library. `org-back-to-heading' and `org-up-heading-safe' will always be faster, and as accurate. I.e., the code operating on headlines is usually distinct from the code handling other elements. > If so, it is quite disappointing. It would be helpful to be able to find > parent of any element at point (especially, in conjunction with > org-element-cache). At least, optionally. You can parse the full document and get all the :parent properties filled. That's not the job for `org-element-at-point'. > I was counting on this feature to try speeding up my agenda generation > (using org-element-cache). Note that `org-element-cache' was disabled a while ago because it could introduce freezes. I think this is related to how this part handles `before-change-functions' and `after-change-functions'. Anyway, YMMV. Regards, -- Nicolas Goaziou