[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] FR: headline iteration API

From: Adam Spiers
Subject: Re: [Orgmode] FR: headline iteration API
Date: Tue, 10 Jun 2008 11:28:44 +0100
User-agent: Mutt/1.5.14 (2007-02-12)

On Wed, Jun 04, 2008 at 04:35:01PM +0200, Daniel Clemente wrote:
> Hi,
>   I find this very interesting. Some ideas:
> - Maybe it could provide access not only to the headlines, but to
>   the headlines of the headlines, and of their headlines, etc. In
>   fact, access to the whole tree. This would allow batch processing
>   of any contents.

Absolutely - that was a core part of the intent of my proposal; I
probably didn't make that clear enough.

> As a plus, each header would get a path (like XPath in XML, or DOM
> in XHTML) and would be addressable. Maybe useful for links.

Whilst borrowing some of the XPath syntax would be an extremely cool
way of making content addressable, I do think it's a nice-to-have
which is separate to having an iteration API.  Maybe later on the API
could be extended to only apply to subtrees matching an XPath-like
query, but that really would be icing on the cake.  I feel that the
biggest wins (and very big too, IMHO) would come from a simple
iteration API.

> - An API would be useful not only to generate reports, etc. like in your 
> examples, but also to execute actions on each header; for instance „export“ 
> each header, „delete“ it, ... (And now with latest version, each header can 
> have different export options)

Agreed - it would open up many options for batch processing as well as
the reporting examples I gave before.  I would personally use it to
convert some of my tags into properties.  For instance I have tags
like 'sub60', 'sub2' to indicate that I estimate a task will take 60
minutes or 2 hours maximum, respectively.  They could be converted
into the effort estimation property.

> - Of course, this is already possible by going through the file looking for 
> headers; an API would make iteration easier, like with mapcar 

Yes.  There will be many intricacies involved in iteration, and
probably only Carsten knows them all - without an API we would
individually be reinventing the same wheel over and over ... badly.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]