From mboxrd@z Thu Jan 1 00:00:00 1970 From: Trevor Murphy Subject: Re: Get a list of tasks completed today Date: Mon, 17 Feb 2014 09:12:53 -0500 Message-ID: <87txbx4yl6.fsf@gmail.com> References: <86lhxfuwpn.fsf@somewhere.org> <86k3cu7sdz.fsf@somewhere.org> <87fvnip3fm.fsf@hornfels.zedat.fu-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37074) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFOwj-0002Zd-8C for emacs-orgmode@gnu.org; Mon, 17 Feb 2014 09:13:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WFOwc-0002lN-W0 for emacs-orgmode@gnu.org; Mon, 17 Feb 2014 09:13:21 -0500 Received: from plane.gmane.org ([80.91.229.3]:54094) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WFOwc-0002lI-Oy for emacs-orgmode@gnu.org; Mon, 17 Feb 2014 09:13:14 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WFOwb-0002gn-B3 for emacs-orgmode@gnu.org; Mon, 17 Feb 2014 15:13:13 +0100 Received: from z65-50-91-81.ips.direcpath.com ([65.50.91.81]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Feb 2014 15:13:13 +0100 Received: from trevor.m.murphy by z65-50-91-81.ips.direcpath.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Feb 2014 15:13:13 +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 "Loris Bennett" writes: >> #+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 >> > > However, more useful to me would be "last week", so what > approach should I take for that? I get pretty decent mileage out of this command (note that it's a tags search, not a todo keyword search.) (add-to-list 'org-agenda-custom-commands '("." "Closed this week." tags "CLOSED>\"<-1w>\"" ((org-agenda-sorting-strategy '(priority-down))))) Though now I've got a related question. One thing I'd like to do is run a function over every item that was closed this past week. For sake of example, let's say I've added a property ":mood: 5" to several closed items and I'd like to delete it (but only from the closed items; I'm not necessarily deleting the property globally.) To do this I tried pulling all the closed items, visiting them in turn, and calling (org-delete-property "mood"). But I got stuck pulling all the closed items, because `org-tags-view' and friends all build an agenda as a side effect. Is my best bet simply re-implementing the parts of `org-tags-view' that I need? Or is there a more common way to use the org machinery to work with items in lisp code? Thanks! -- Trevor Murphy GnuPG Key: 0x83881C0A