From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: custom agenda view not possible? Date: Mon, 27 Apr 2015 13:36:19 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmhKz-0002sz-FF for emacs-orgmode@gnu.org; Mon, 27 Apr 2015 07:36:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YmhKt-0000Cn-IW for emacs-orgmode@gnu.org; Mon, 27 Apr 2015 07:36:33 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:12585) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmhKt-0000C7-CU for emacs-orgmode@gnu.org; Mon, 27 Apr 2015 07:36:27 -0400 In-Reply-To: (Traycer Bullet's message of "Sun, 26 Apr 2015 19:21:19 -0700") 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: Traycer Bullet Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hello, On 2015-04-27 04:21, Traycer Bullet writes: > I'm transitioning from a web-based to-do list, and one thing I rely on is > viewing recently CREATED or CLOSED tasks, e.g. within the last 2 days. My= hope > is to recreate this with a custom agenda view, but I haven't been able to= find > the correct commands/filters. Keeping in mind I'm new to Emacs/Lisp/OrgMo= de, > here's what I've tried so far (for just the CLOSED example): > > This doesn't work because tags-todo excludes 'DONE' status tasks: > (add-to-list 'org-agenda-custom-commands > '("J" "Completed Recently" tags-todo "CLOSED>=3D\"<-2d>\"")) > > This doesn't work because the org-agenda-tag-filter-preset only works for > tags: > (add-to-list 'org-agenda-custom-commands > '("J" "Completed Recently" todo "DONE" > ((org-agenda-tag-filter-preset '("+CLOSED>=3D\"<-2d>\""))))) > > Regarding the desired CREATED agenda view, I use a script to add a CREATED > timestamp as property to each task (see: > http://stackoverflow.com/questions/12262220/add-created-date-property-to-= todos-in-org-mode ), > so a task will look something like this: > > TODO New task for today > :PROPERTIES: > :CREATED: [2015-04-13 Mon 17:57] > :END: > > There is no agenda filtering preset options for Properties (only > tags/category/regexp), which is the only way I could think of to do the > necessary date comparisons (e.g. <-2d>). > > The task seems simple, so I'm hopeful I'm overlooking some way of > accomplishing it.=20 I think the simplest approach would be to write a predicate and use it with `org-agenda-skip-function'. I do this in my org-review package, see https://github.com/brabalan/org-review/blob/master/org-review.el#L230 for an example of a function to use, and https://github.com/brabalan/org-review/blob/master/org-review.el#L153 for the predicate it relies on (this also shows how to get properties values and to time comparison). Best, Alan =2D-=20 OpenPGP Key ID : 040D0A3B4ED2E5C7 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBCgAGBQJVPh84AAoJEAQNCjtO0uXHXXIIALoOPaPu/HFeVNiEq8DEfz16 WD7ksifwLTwvVHCH4otAj6Q8S5Dipu4k70vFGHjbEkQvGEepLKKJgZjwQrcdMg30 Kn7T6qCCyAQBzWbuqqLQXkVbInyBsfQ7PHdgRmF0VHqm0QsJj0QsHFXX5RuFhiLK 9STLSrj5M+SURDXhMdNvquwJr//T/RKd1eoI/K4Kn4NIeh4LGJ+4guIHpo0Y5Br+ gvGyg/2hgEyRjyWbalEeAkykihzmxDov8L/QPkXwB2s8tCLbNn+d5GRP/FVSFN8q KjlpAzytplSsI+zbVAB1zhTeJaELlary5sj3lprJiQS8kUo5ikx5ZGEcbpGEUKM= =oEXW -----END PGP SIGNATURE----- --=-=-=--