emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Loris Bennett" <loris.bennett@fu-berlin.de>
To: emacs-orgmode@gnu.org
Subject: Re: Get a list of tasks completed today
Date: Mon, 17 Feb 2014 09:07:57 +0100	[thread overview]
Message-ID: <87fvnip3fm.fsf@hornfels.zedat.fu-berlin.de> (raw)
In-Reply-To: 86k3cu7sdz.fsf@somewhere.org

"Sebastien Vauban" <sva-news@mygooglest.com>
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.

  reply	other threads:[~2014-02-17  8:08 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 [this message]
2014-02-17 13:40     ` Sebastien Vauban
2014-02-17 14:12     ` Trevor Murphy
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=87fvnip3fm.fsf@hornfels.zedat.fu-berlin.de \
    --to=loris.bennett@fu-berlin.de \
    --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).