From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Getting heading properties from org-element Date: Mon, 06 Jul 2015 12:03:20 -0400 Message-ID: References: <87mvzact6f.fsf@gmail.com> <87egklti1c.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZC8re-0005bT-KB for emacs-orgmode@gnu.org; Mon, 06 Jul 2015 12:03:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZC8ra-00078O-JX for emacs-orgmode@gnu.org; Mon, 06 Jul 2015 12:03:26 -0400 Received: from mail-qk0-x229.google.com ([2607:f8b0:400d:c09::229]:35480) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZC8ra-00077x-Bv for emacs-orgmode@gnu.org; Mon, 06 Jul 2015 12:03:22 -0400 Received: by qkbp125 with SMTP id p125so120195220qkb.2 for ; Mon, 06 Jul 2015 09:03:21 -0700 (PDT) In-reply-to: <87egklti1c.fsf@nicolasgoaziou.fr> 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: Nicolas Goaziou Cc: Thorsten Jolitz , emacs-orgmode@gnu.org beautiful! Thanks! Nicolas Goaziou writes: > Hello, > > John Kitchin writes: > >> hm. We must have different use cases in mind. Currently I am using >> >> (save-excursion >> (goto-char >> (org-element-property :begin headline)) >> (org-entry-properties)) >> >> to get the properties. I thought there would be a way to get those from >> the parse tree to avoid the excursion (I use this to index a few >> thousand org-files so I want it to be fast). > > If you have the full parse tree and you're only interested in local > properties (i.e., neither CATEGORY or special properties): > > (org-element-map headline 'node-property > (lambda (p) > (cons (org-element-property :key p) > (org-element-property :value p)))) > > > Regards, -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu