From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: Re: Finding old appointments Date: Mon, 26 Jul 2010 11:54:27 +0200 Message-ID: <87aapemuuk.wl%dmaus@ictsoc.de> References: <87mxtj4612.fsf@thinkpad.tsdh.de> <876304efcg.fsf@mundaneum.com> <87wrsjig5k.fsf@thinkpad.tsdh.de> <87lj8z8iee.fsf@fastmail.fm> <87iq42wve1.fsf@thinkpad.tsdh.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="===============0002196832==" Return-path: Received: from [140.186.70.92] (port=49610 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OdKOM-0003kx-TC for emacs-orgmode@gnu.org; Mon, 26 Jul 2010 05:54:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OdKOG-0001V0-Nl for emacs-orgmode@gnu.org; Mon, 26 Jul 2010 05:54:38 -0400 Received: from mysql1.xlhost.de ([213.202.242.106]:34024) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OdKOG-0001Ue-Fs for emacs-orgmode@gnu.org; Mon, 26 Jul 2010 05:54:32 -0400 In-Reply-To: <87iq42wve1.fsf@thinkpad.tsdh.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Tassilo Horn Cc: emacs-orgmode@gnu.org --===============0002196832== Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Mon_Jul_26_11:54:27_2010-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --pgp-sign-Multipart_Mon_Jul_26_11:54:27_2010-1 Content-Type: text/plain; charset=US-ASCII Tassilo Horn wrote: >Matt Lundin writes: >>> Well, basically I'm just looking for a search facility that shows me >>> an agenda view with all entries that contain only timestamps before >>> today and no pending todos, so that I can use the agenda commands to >>> act on them. Some will be deleted, others archived. >> >> Here's an example of an agenda view that would bring up all old, >> active timestamps marked DONE: >> >> C-c a m [RET] TIMESTAMP<""+TODO="DONE" >Oh, nice. I've never use this search, but it is very useful. Simply by >searching for a timestamp before today does already help me. >Additionally, playing around with it helped me being even more >specific. So what I want to get is an agenda with > - 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))))))) > - 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'. HTH, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de --pgp-sign-Multipart_Mon_Jul_26_11:54:27_2010-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EABEIAAYFAkxNW1MACgkQma24O1pEeOY5ZAD+IelUUPno0y76L8gfYvCx3IL8 Qt49VNPuUIDKV/rKJyYA/RKn+gfRQKjGnDO1J+SwYN/786EKObAuBwsJCrp1A3SQ =lt6w -----END PGP SIGNATURE----- --pgp-sign-Multipart_Mon_Jul_26_11:54:27_2010-1-- --===============0002196832== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0002196832==--