From mboxrd@z Thu Jan 1 00:00:00 1970 From: Puneeth Chaganti Subject: Re: Can I archive into datetree based on CLOSED date property Date: Mon, 21 Feb 2011 13:42:08 +0530 Message-ID: References: <36678C5F-9B2E-42FF-8CDF-A45D3A14A336@uk.om.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=48551 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrQsh-0006Om-VO for emacs-orgmode@gnu.org; Mon, 21 Feb 2011 03:12:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrQsg-0001iC-LQ for emacs-orgmode@gnu.org; Mon, 21 Feb 2011 03:12:31 -0500 Received: from mail-ww0-f49.google.com ([74.125.82.49]:39832) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrQsg-0001hg-HI for emacs-orgmode@gnu.org; Mon, 21 Feb 2011 03:12:30 -0500 Received: by wwb17 with SMTP id 17so5935141wwb.30 for ; Mon, 21 Feb 2011 00:12:28 -0800 (PST) In-Reply-To: <36678C5F-9B2E-42FF-8CDF-A45D3A14A336@uk.om.org> 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: "Urs Rau (UK)" Cc: emacs-orgmode On Mon, Feb 21, 2011 at 2:55 AM, Urs Rau (UK) wrote: > Hi, > > On 20 Feb 2011, at 10:55, Puneeth Chaganti wrote: > >> On Sun, Feb 20, 2011 at 3:58 PM, Urs Rau (UK) 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 regi= on into a datetree in the archive file in such a way that all completed tod= o items would be filed under the date on which their property says they wer= e 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 t= his 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-tod= o-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.