From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: How to extract TODOs from date-tree Date: Tue, 28 Oct 2014 18:26:47 +0100 Message-ID: <87mw8gcdgo.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjAY7-0004Vg-Fs for emacs-orgmode@gnu.org; Tue, 28 Oct 2014 13:27:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjAXz-00015N-W8 for emacs-orgmode@gnu.org; Tue, 28 Oct 2014 13:27:15 -0400 Received: from plane.gmane.org ([80.91.229.3]:55113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjAXz-00013q-Q1 for emacs-orgmode@gnu.org; Tue, 28 Oct 2014 13:27:07 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XjAXx-0002nF-Ko for emacs-orgmode@gnu.org; Tue, 28 Oct 2014 18:27:05 +0100 Received: from e178190211.adsl.alicedsl.de ([85.178.190.211]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Oct 2014 18:27:05 +0100 Received: from tjolitz by e178190211.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Oct 2014 18:27:05 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Jay Iyer writes: Hi Jay, > The file entries are as follows and the task/note/project sub-heads generally don't have active/inactive timestamps except when a scheduling/deadline is specified. Thanks. > ** 2014-10 October > *** 2014-10-01 Wednesday > **** TODO first task > **** General note entry > **** Project :prj: puh ... it would of cause be possible to write emacs lisp to find, extract and process the date info from the parent tree's :raw-value, but I must admit I don't want to do it, since it is just extra work required by un-idiomatic use of Org-mode. You have all the means to create a nice logical project file out-of-the box with Org-mode, use tags, timestamps, deadlines, properties etc and then extract selected info via the agenda. Otherwise you need to write custom elisp yourself or find somebody who does it for you ... > Jay Iyer writes: > > Hi, >> I have my Org files set up as date-trees containing a mix of notes, >> tasks and projects. I now have a need to generate a list of projects >> and tasks filed under specific date-tree or in a range of dates. Is it >> possible to get this listing from the date-trees if the entries >> themselves don't have date/time in timestamps or in properties >> settings? I couldn't find a solution in the archives. Please advise. >> Thank you. > > what is a date tree? This: > > ,---- > | * <2014-10-28 Di> > `---- > > ? > > If the date-tree is the parent and has a timestamp, then the entries > are part of the contents of parent, and you can use this function to > map over the parents > > ,----[ C-h f org-element-map RET ] > | org-element-map is a compiled Lisp function in `org-element.el'. > | > | (org-element-map DATA TYPES FUN &optional INFO FIRST-MATCH > | NO-RECURSION WITH-AFFILIATED) > | > | Map a function on selected elements or objects. [...] > `---- > > and this to get their contents > > ,----[ C-h f org-element-contents RET ] > | org-element-contents is a compiled Lisp function in `org-element.el'. > | > | (org-element-contents ELEMENT) > | > | Extract contents from an ELEMENT. > `---- > > and then 'org-element-property' and 'org-element-put-property' to get > and set timestamp info from the parent and any other info from the child > entries. -- cheers, Thorsten