From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Loris Bennett" Subject: Re: Get a list of tasks completed today Date: Mon, 17 Feb 2014 09:07:57 +0100 Message-ID: <87fvnip3fm.fsf@hornfels.zedat.fu-berlin.de> References: <86lhxfuwpn.fsf@somewhere.org> <86k3cu7sdz.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49752) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFJFV-0004aG-S7 for emacs-orgmode@gnu.org; Mon, 17 Feb 2014 03:08:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFJFP-0002aA-Mh for emacs-orgmode@gnu.org; Mon, 17 Feb 2014 03:08:21 -0500 Received: from plane.gmane.org ([80.91.229.3]:52457) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFJFP-0002a1-Fg for emacs-orgmode@gnu.org; Mon, 17 Feb 2014 03:08:15 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WFJFI-0002Nq-N2 for emacs-orgmode@gnu.org; Mon, 17 Feb 2014 09:08:08 +0100 Received: from hornfels.zedat.fu-berlin.de ([160.45.11.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Feb 2014 09:08:08 +0100 Received: from loris.bennett by hornfels.zedat.fu-berlin.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Feb 2014 09:08:08 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org "Sebastien Vauban" writes: > "Sebastien Vauban" wrote: >> To get a list of tasks which I've completed today, I guess we must have: >> >> (setq org-log-done t) ; default >> >> I mean: I guess it's more dangerous to try and play with the "state >> changes" information stored in the LOGBOOK drawer as people can easily >> modify them (see `org-log-note-headings'). >> >> Under the above assumption, the request becomes: >> >> (add-to-list 'org-agenda-custom-commands >> '("." "Completed today" >> ((todo "DONE|CANX" >> ((org-agenda-skip-function '(org-agenda-skip-entry-if 'notregexp "CLOSED: \\[2014-02-13")) >> (org-agenda-sorting-strategy '(priority-down)))))) t) >> >> ... for today. >> >> But how can I include today's date in a programmatic way (so that it >> continues to work tomorrow ;-))? > > That one is solved by doing this: > > #+begin_src emacs-lisp > (add-to-list 'org-agenda-custom-commands > '("." "Completed today" > ((todo "" > ((org-agenda-skip-function > '(org-agenda-skip-entry-if 'notregexp (format-time-string "CLOSED: \\[%Y-%m-%d"))))) > (org-agenda-sorting-strategy '(priority-down)))))) t) > #+end_src > > Best regards, > Seb I don't really understand the lisp, but I'm guessing that %Y, %m, and %d hold the current year, month, and day, respectively, so I can see how the regex could be modified to deal with "last year" and "last month". However, more useful to me would be "last week", so what approach should I take for that? Cheers, Loris -- This signature is currently under construction.