Hi,
At Mon, 2 Mar 2009 17:31:55 +0100,
Lluis wrote:
>
> Nice!
>
> I've tried extending it, but my lua skills are extremely poor, so here I
> launch
> what I was trying to add, in case anyone finds it useful and implementes it
> (it
> _is_ really easy).
>
> As I maintain my TODOs in project-specific files (which eventually appear and
> disappear), I added a check on the register function. If the 'f' argument is a
> string (don't know how to check that) and is a directory
> os.exec("test -d "..f) == 0
> set 'path' to 'f' (otherwise nil) and retrieve the list of files
> os.exec("find "..f.." -type -f -name *.org")
> and build from that string the file table
> once again, don't know how to do that (now, I _really_ miss python :))
>
> The update function should then do the finding again with 'path' (if it's not
> nil).
>
> If you tell me how to implement the missing pieces or just do the patch, I'll
> be
> very grateful :)
You could use the LuaFileSystem library[1] for testing and parsing the
directory tree. The example on LuaFileSystem's homepage is actually a
function that iterates over a given directory.
>
> PS: I haven't looked for it, but I'm sure I can do the same with emacs itself,
> give a path where all org files are located, instead of a list which I always
> forget to update.
Do you mean something like:
(setq org-directory "~/Org/")
(setq org-agenda-files (list org-directory))
From the manual (Section 10.1, Agenda file):
==
The information to be shown is normally collected from all agenda files,
the files listed in the variable org-agenda-files1. If a directory is
part of this list, all files with the extension .org in this directory
will be part of the list.
==
With setting org-agenda-files to org-directory Orgmode treats all
files in ~/Org/ as org-agenda files including, IIRC, files in
subdirectories of ~/Org/.
If you set up Emacs/Orgmode correctly for all of your agenda files you
could probably use a custom agenda command[2] that outputs items that
match a certain criteria (i.e.: current, soon etc. items) and gather
the list of items by exporting these items using Orgmodes
agenda-export function[3].
It *should* work this way and you would not longer have to parse the
orgfiles manually.
-- David
Footnotes:
[1] http://www.keplerproject.org/luafilesystem/
[2] Orgmode Manual, Section 10.6
[3] Orgmode Manual, Section 10.6.4
--
Email..... [email protected]
Jabber.... [email protected]
ICQ....... 241051416
OpenPGP... 0x316F4BE4670716FD
--
To unsubscribe, send mail to [email protected].