From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sascha Ziemann Subject: Re: How to view everything DONE today? Date: Thu, 27 Nov 2014 15:39:18 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b2e0d7beed15c0508d81bdb Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xu0E5-00059l-2l for emacs-orgmode@gnu.org; Thu, 27 Nov 2014 09:39:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xu0E3-00083c-Cf for emacs-orgmode@gnu.org; Thu, 27 Nov 2014 09:39:21 -0500 Received: from mail-ig0-x22e.google.com ([2607:f8b0:4001:c05::22e]:43172) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xu0E3-00082y-5q for emacs-orgmode@gnu.org; Thu, 27 Nov 2014 09:39:19 -0500 Received: by mail-ig0-f174.google.com with SMTP id hn15so8621102igb.7 for ; Thu, 27 Nov 2014 06:39:18 -0800 (PST) In-Reply-To: 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 --047d7b2e0d7beed15c0508d81bdb Content-Type: text/plain; charset=UTF-8 This: http://jcardente.blogspot.de/2010/06/org-mode-hack-tasks-done-last-month.html inspired my to do this: (defun org-done-view (&optional offset) "Shows all TODOs, which are done." (interactive "nOffset: ") (let ((offset (or offset 0))) (let ((t0 (calendar-current-date offset)) (t1 (calendar-current-date (+ offset 1)))) (org-tags-view nil (format "CLOSED>=\"[%s-%s-%s]\"+CLOSED<=\"[%s-%s-%s]\"" (calendar-extract-year t0) (calendar-extract-month t0) (calendar-extract-day t0) (calendar-extract-year t1) (calendar-extract-month t1) (calendar-extract-day t1)))))) How can I open a calendar to pick a date? Regards, Sascha 2014-11-26 20:44 GMT+01:00 John Kitchin : > I am not sure how to do this through the agenda, but here is a way to > find headlines in the current file that were closed today. You could > wrap this in a loop over the files in your agenda list. It is a little > clumsy on the time comparisons but it works ;) > > * Getting items done today > > ** DONE item 1 > CLOSED: [2014-11-26 Wed 13:09] DEADLINE: <2014-11-26 Wed> > > > > ** DONE item 2 > CLOSED: [2014-11-25 Tue 13:09] DEADLINE: <2014-11-26 Wed> > > > ** Mapping entries to find what closed today. > > First, we look at a timestamp comparison function. > #+BEGIN_SRC emacs-lisp > (org-time= "<2014-11-26 Wed>" "<2014-11-26 Wed>") > #+END_SRC > > #+RESULTS: > : t > > #+BEGIN_SRC emacs-lisp > (org-map-entries > (lambda () > (let* ((closed (org-entry-get (point) "CLOSED")) > (today (format-time-string "<%Y-%m-%d>"))) > (when closed > (when > (org-time= > today > (let ((parts (org-parse-time-string closed))) > (format "<%s-%s-%s>" > (nth 5 parts) ; year > (nth 4 parts) ; month > (nth 3 parts) ; day > ))) > (message-box "Found a closed task: %s" > (org-heading-components))))))) > > #+END_SRC > > #+RESULTS: > | nil | Found a closed task: (2 2 DONE nil item 1 nil) | nil | nil | > > > > > Sascha Ziemann writes: > > > Hi, > > > > I tried to get a list of all items done today. I tried to open the > > agenda view but is does not show anything. What is the right command > > to see the items done today? > > > > Regards, > > Sascha > > > > -- > ----------------------------------- > John Kitchin > Professor > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > http://kitchingroup.cheme.cmu.edu > --047d7b2e0d7beed15c0508d81bdb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
This:

http://jcardent= e.blogspot.de/2010/06/org-mode-hack-tasks-done-last-month.html

i= nspired my to do this:

(defun org-done-view (&optional offset)=C2=A0 "Shows all TODOs, which are done."
=C2=A0 (interactiv= e "nOffset: ")
=C2=A0 (let ((offset (or offset 0)))
=C2=A0= =C2=A0=C2=A0 (let ((t0 (calendar-current-date offset))
=C2=A0=C2=A0=C2= =A0 =C2=A0 (t1 (calendar-current-date (+ offset 1))))
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (org-tags-view nil
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 = =C2=A0=C2=A0=C2=A0=C2=A0 (format "CLOSED>=3D\"[%s-%s-%s]\"= ;+CLOSED<=3D\"[%s-%s-%s]\""
=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 (calendar-extract-= year t0)
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0=C2=A0 (calendar-extract-month t0)
=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 (calendar-extract-= day t0)
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0=C2=A0 (calendar-extract-year t1)
=C2=A0=C2=A0=C2=A0 =C2=A0= =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 (calendar-extract-= month t1)
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0=C2=A0 (calendar-extract-day t1))))))

How can I= open a calendar to pick a date?

Regards,
Sascha
<= br>

2014-11-= 26 20:44 GMT+01:00 John Kitchin <jkitchin@andrew.cmu.edu>:
I am not sure how to do this through= the agenda, but here is a way to
find headlines in the current file that were closed today. You could
wrap this in a loop over the files in your agenda list. It is a little
clumsy on the time comparisons but it works ;)

* Getting items done today

** DONE item 1
=C2=A0 =C2=A0CLOSED: [2014-11-26 Wed 13:09] DEADLINE: <2014-11-26 Wed>= ;



** DONE item 2
=C2=A0 =C2=A0CLOSED: [2014-11-25 Tue 13:09] DEADLINE: <2014-11-26 Wed>= ;


** Mapping entries to find what closed today.

First, we look at a timestamp comparison function.
#+BEGIN_SRC emacs-lisp
(org-time=3D "<2014-11-26 Wed>" "<2014-11-26 Wed>= ;")
#+END_SRC

#+RESULTS:
: t

#+BEGIN_SRC emacs-lisp
(org-map-entries
=C2=A0 (lambda ()
=C2=A0 =C2=A0 (let* ((closed (org-entry-get (point) "CLOSED")) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(today (format-time-string "&= lt;%Y-%m-%d>")))
=C2=A0 =C2=A0 =C2=A0 (when closed
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (when
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-time=3D
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0today
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((parts (org-parse-tim= e-string closed)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(format "<%s= -%s-%s>"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(nth 5 parts) ; year
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(nth 4 parts) ; month
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(nth 3 parts) ; day
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (message-box "Found a closed task: = %s"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(org-heading-components)))))))

#+END_SRC

#+RESULTS:
| nil | Found a closed task: (2 2 DONE nil item 1 nil) | nil | nil |




Sascha Ziemann <ceving@gmail.com= > writes:

> Hi,
>
> I tried to get a list of all items done today. I tried to open the
> agenda view but is does not show anything. What is the right command > to see the items done today?
>
> Regards,
> Sascha
>

--
-----------------------------------
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitc= hingroup.cheme.cmu.edu

--047d7b2e0d7beed15c0508d81bdb--