From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steven Lumos Subject: Re: monthly report Date: Tue, 29 May 2007 17:30:34 -0700 Message-ID: <86irab6tlh.fsf@bitty.lumos.us> References: <86ps4pbrxy.fsf@bitty.lumos.us> <7b72afe87a251d7615438346906a6f1f@science.uva.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HtC79-0003zS-Pk for emacs-orgmode@gnu.org; Tue, 29 May 2007 20:32:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HtC77-0003yO-B8 for emacs-orgmode@gnu.org; Tue, 29 May 2007 20:32:34 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HtC77-0003y2-4b for emacs-orgmode@gnu.org; Tue, 29 May 2007 20:32:33 -0400 Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HtC76-00071Y-TZ for emacs-orgmode@gnu.org; Tue, 29 May 2007 20:32:33 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HtC6d-0001Ue-Vq for emacs-orgmode@gnu.org; Wed, 30 May 2007 02:32:04 +0200 Received: from wsip-24-234-106-159.lv.lv.cox.net ([24.234.106.159]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 May 2007 02:32:03 +0200 Received: from steven by wsip-24-234-106-159.lv.lv.cox.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 May 2007 02:32:03 +0200 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: emacs-orgmode@gnu.org Carsten Dominik writes: > On May 25, 2007, at 3:41, Steven Lumos wrote: >> Being yet another planner switcher, I'm used to using planner-report- >> generate to assist me with writing a monthly activity report. I don't >> need fine-grained time tracking, or even most of what planner-report- >> generate does--it would be ideal to get just a list of TODOs that were >> closed between two dates and then I'll look at it while I type a few >> sentences in an email buffer. >> >> Is there already an easy way to "get a list" (I guess that a sparse >> tree would be most convenient for me) of TODOs marked as closed within >> some date range? > > You can use org-occur to create a tree with matches of CLOSED time > stamps. > And you can use the callback argument of org-occur to verify if a > match is in a given time interval. Something like this: > > (defun org-closed-in-range () > "Sparse treee of items closed in a certain time range." > (interactive) > ;; Get the time interval from the user. > (let* ((time1 (time-to-seconds > (org-read-date nil 'to-time nil "Starting date: "))) > (time2 (time-to-seconds > (org-read-date nil 'to-time nil "End date:"))) > ;; callbakc function > (callback (lambda () > (let ((time > (time-to-seconds > (apply 'encode-time > (org-parse-time-string > (match-string 1)))))) > ;; check if time in interval > (and (>= time time1) (<= time time2)))))) > ;; make tree, check each match with the callback > (org-occur "CLOSED: +\\[\\(.*?\\)\\]" nil callback))) This is just right. Thanks! Steve