[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: Finding old appointments
From: |
Tassilo Horn |
Subject: |
[Orgmode] Re: Finding old appointments |
Date: |
Mon, 26 Jul 2010 13:46:44 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
David Maus <address@hidden> writes:
Hi David,
>> - headlines that contain only past timestamps and are closed TODOs (if
>> they are TODOs), that is, any TODO state after the | in
>> `org-todo-keywords'
>
>> - the same applies to all children of that entry, recursively
>
> This is quite simple: The function returns non-nil if an entry is
> active (recursion \o/):
>
> (defun dmj/org-entry-is-active-p ()
> "Return non-nil if entry is active.
> An entry is considered to be active if it has an active timestamp
> in the future or an open TODO keyword or at least one active child."
> (save-excursion
> (beginning-of-line)
> (let ((children (delq nil (org-map-entries
> 'dmj/org-entry-is-active-p
> (format "LEVEL>%d" (org-outline-level))
> 'tree)))
> (timestamp (org-entry-get nil "TIMESTAMP")))
> (or (org-entry-is-todo-p)
> children
> (and timestamp (time-less-p (current-time) (org-time-string-to-time
> timestamp)))))))
Looks good. :-)
>> - the agenda should only list the top-most entries for which these
>> properties hold
>
> This is the tougher part: Because the state of an entry
> (active/inactive) depends on its children the function that finally
> displays the entries must first obtain the state of the entries and
> their relationships and then remove all inactive entries whose
> (grand,grand...)parents are inactive.
>
> Sounds like you would require a a user-defined agenda function in
> `org-agenda-custom-commands'.
Yes, that's most likely. I'll dig into that further when I find some
spare time. Thanks a lot for providing this starting point for me.
Bye,
Tassilo