emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org to lisp
@ 2008-07-23 19:09 Dan Davison
  2008-07-23 20:18 ` Manish
  2008-07-23 20:47 ` Carsten Dominik
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Davison @ 2008-07-23 19:09 UTC (permalink / raw)
  To: emacs org-mode mailing list

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?) 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). 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. 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: org to lisp
  2008-07-23 19:09 org to lisp Dan Davison
@ 2008-07-23 20:18 ` Manish
  2008-07-23 20:47 ` Carsten Dominik
  1 sibling, 0 replies; 3+ messages in thread
From: Manish @ 2008-07-23 20:18 UTC (permalink / raw)
  To: Dan Davison; +Cc: emacs org-mode mailing list

  On Thu, Jul 24, 2008 at 12:39 AM, Dan Davison wrote:
  [snip]
  > 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.

Your comment about traversal function reminded me of a recent
discussion about headline iteration API.

http://thread.gmane.org/gmane.emacs.orgmode/6852/focus=6949

HTH,
-- Manish

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: org to lisp
  2008-07-23 19:09 org to lisp Dan Davison
  2008-07-23 20:18 ` Manish
@ 2008-07-23 20:47 ` Carsten Dominik
  1 sibling, 0 replies; 3+ messages in thread
From: Carsten Dominik @ 2008-07-23 20:47 UTC (permalink / raw)
  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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-07-23 20:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-23 19:09 org to lisp Dan Davison
2008-07-23 20:18 ` Manish
2008-07-23 20:47 ` Carsten Dominik

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).