From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: org to lisp Date: Wed, 23 Jul 2008 13:47:48 -0700 Message-ID: <6DAFFDEE-D941-4C33-82E7-D774A064B35D@uva.nl> References: <20080723190902.GA6797@stats.ox.ac.uk> Mime-Version: 1.0 (Apple Message framework v926) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KLlFg-0006lY-5A for emacs-orgmode@gnu.org; Wed, 23 Jul 2008 16:48:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KLlFe-0006kj-K1 for emacs-orgmode@gnu.org; Wed, 23 Jul 2008 16:47:59 -0400 Received: from [199.232.76.173] (port=60123 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KLlFe-0006kX-65 for emacs-orgmode@gnu.org; Wed, 23 Jul 2008 16:47:58 -0400 Received: from korteweg.uva.nl ([146.50.98.70]:36695) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KLlFd-0006Bz-S7 for emacs-orgmode@gnu.org; Wed, 23 Jul 2008 16:47:58 -0400 In-Reply-To: <20080723190902.GA6797@stats.ox.ac.uk> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Dan Davison Cc: emacs org-mode mailing list On Jul 23, 2008, at 12:09 PM, Dan Davison wrote: > Is there an existing function that will convert an org syntax buffer > into a corresponding (recursive) lisp data structure? (preserving all > the metadata of each heading in some way?) Well, not part of the Org core yet, but still distributed in the git repo. It is org-export-parse in EXPERIMENTAL/org-export.el > I guess I'm thinking of > structs in C, but is this a natural thing to do in lisp? I think the > existence of such code might have been mentioned in Carsten's talk. If > so, then my second question is whether there's a recursive 'mapping' > function, to apply a function at each node of such a tree (and return > some recursive structure containing the results of those function > calls) (R users: I mean like rapply and dendrapply). No, that does not exist, but it wold not be hard to write one that uses the structure returned by org-export-parse. > My understanding > is that org-map-entries returns a flat, rather than a recursive, list, > and that it doesn't create a recursive representation of the buffer in > memory. That is correct. HTH - Carsten > But if it's the case that I simply haven't tried hard enough > to understand the code, please just say so! My current motivation is > to create a directory/filesystem tree corresponding to the org > tree. But I don't want to try to write an org-buffer traversal > function if there's existing code written by non-beginners. > > DAn > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode