Re: [O] custom agenda view not possible?

2015-04-28 Thread Sebastien Vauban
Traycer Bullet wrote:
> This doesn't work because tags-todo excludes 'DONE' status tasks:
> (add-to-list 'org-agenda-custom-commands
>  '("J" "Completed Recently" tags-todo "CLOSED>=\"<-2d>\""))

Use `tags' instead of `tags-todo':

--8<---cut here---start->8---
  (add-to-list 'org-agenda-custom-commands
  '("J" "Completed Recently"
((tags "CLOSED>=\"<-2d>\""))) t)
--8<---cut here---end--->8---

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] custom agenda view not possible?

2015-04-27 Thread Alan Schmitt
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/OrgMode,
> 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>=\"<-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>=\"<-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. 

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

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7


signature.asc
Description: PGP signature


[O] custom agenda view not possible?

2015-04-26 Thread Traycer Bullet
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/OrgMode, 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>=\"<-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>=\"<-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.