On Mon, Feb 21, 2011 at 2:55 AM, Urs Rau (UK) <urs....@om.org> wrote: > Hi, > > On 20 Feb 2011, at 10:55, Puneeth Chaganti wrote: > >> On Sun, Feb 20, 2011 at 3:58 PM, Urs Rau (UK) <urs....@om.org> wrote: >>> Hi >>> I would quite like to have a function that would work on a region , or on a >>> whole org file of todos and archive completed todos or a selected region >>> into a datetree in the archive file in such a way that all completed todo >>> items would be filed under the date on which their property says they were >>> completed or closed. >>> Maybe it can already do it and I just need to learn how? >> >> Worg has a hack [1] by Osamu Okanu, that modifies the >> org-archive-subtree function to archive into a datetree. Combining >> this with the org-map-entries function, you should be able to achieve >> what you want. >> >> Hope this helps, >> Puneeth >> > > Thanks. I am no elisp coder so this is likely beyond me. How hard would this > be to do in elisp? > > I guess the line of code from Osamu Okanu to ammend would be: > > (let* ((dct (decode-time (org-current-time))) > > and somehow get it to read the "CLOSED" date property where Osamu's code has > "org-current-time"? > > And then I have to somehow call up 'org-map-entries' function to process all > completed todo items. > > Is there a function that already knows what my actual 'completed' > org-todo-keywords items out of the full custom list of my 'org-todo-keywords' > are?
I've tried [1] to modify Osamu's defadvice to do what you want. It almost does what you want, except that I have not been able to properly set the `org-map-continue-from' variable. ( May be someone else can help. ) With the present function, you have to run the `org-map-entries' function multiple times, until all your items have been archived. Hope this helps, Puneeth [1] - https://gist.github.com/836799 ps: Please CC the list also, when replying to this email. _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode