emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Trevor Murphy <trevor.m.murphy@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Get a list of tasks completed today
Date: Mon, 17 Feb 2014 09:12:53 -0500	[thread overview]
Message-ID: <87txbx4yl6.fsf@gmail.com> (raw)
In-Reply-To: 87fvnip3fm.fsf@hornfels.zedat.fu-berlin.de

"Loris Bennett" <loris.bennett@fu-berlin.de> 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

  parent reply	other threads:[~2014-02-17 14:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-13 10:35 Get a list of tasks completed today Sebastien Vauban
2014-02-16 19:46 ` Sebastien Vauban
2014-02-17  8:07   ` Loris Bennett
2014-02-17 13:40     ` Sebastien Vauban
2014-02-17 14:12     ` Trevor Murphy [this message]
2014-02-17 14:33       ` Trevor Murphy
2014-02-17 15:27       ` Nick Dokos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87txbx4yl6.fsf@gmail.com \
    --to=trevor.m.murphy@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).