emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alan Schmitt <alan.schmitt@polytechnique.org>
To: Traycer Bullet <traycerb@yahoo.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: custom agenda view not possible?
Date: Mon, 27 Apr 2015 13:36:19 +0200	[thread overview]
Message-ID: <m2mw1tyf9o.fsf@polytechnique.org> (raw)
In-Reply-To: <CA+BiOC+ErDgwjRbawM4F8QVOfP5EMo9DhYjhuz-QmGiqV=UvOQ@mail.gmail.com> (Traycer Bullet's message of "Sun, 26 Apr 2015 19:21:19 -0700")

[-- Attachment #1: Type: text/plain, Size: 2014 bytes --]

Hello,

On 2015-04-27 04:21, Traycer Bullet <traycerb@yahoo.com> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]

  reply	other threads:[~2015-04-27 11:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-27  2:21 custom agenda view not possible? Traycer Bullet
2015-04-27 11:36 ` Alan Schmitt [this message]
2015-04-28  8:29 ` Sebastien Vauban

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=m2mw1tyf9o.fsf@polytechnique.org \
    --to=alan.schmitt@polytechnique.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=traycerb@yahoo.com \
    /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).