emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: emacs-orgmode@gnu.org
Subject: Re: Finding old appointments
Date: Mon, 26 Jul 2010 13:46:44 +0200	[thread overview]
Message-ID: <87eieqwjmj.fsf@thinkpad.tsdh.de> (raw)
In-Reply-To: 87aapemuuk.wl%dmaus@ictsoc.de

David Maus <dmaus@ictsoc.de> 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

      reply	other threads:[~2010-07-26 11:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-22 20:26 Finding old appointments Tassilo Horn
2010-07-24 21:31 ` Sébastien Vauban
2010-07-25 18:13   ` Tassilo Horn
2010-07-25 19:34     ` Matt Lundin
2010-07-26  7:32       ` Tassilo Horn
2010-07-26  9:54         ` David Maus
2010-07-26 11:46           ` Tassilo Horn [this message]

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=87eieqwjmj.fsf@thinkpad.tsdh.de \
    --to=tassilo@member.fsf.org \
    --cc=emacs-orgmode@gnu.org \
    /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).