From mboxrd@z Thu Jan  1 00:00:00 1970
From: Narendra Joshi <narendraj9@gmail.com>
Subject: Re: Agenda filtering (take 2)
Date: Thu, 05 Oct 2017 00:07:33 +0530
Message-ID: <877ewa3gk2.fsf@gmail.com>
References: <87h98194od.fsf@aquinas.i-did-not-set--mail-host-address--so-tickle-me>
	<871spy3rut.fsf@bzg.fr>
	<87zi99nu6n.fsf@aquinas.i-did-not-set--mail-host-address--so-tickle-me>
Mime-Version: 1.0
Content-Type: text/plain
Return-path: <emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org>
Received: from eggs.gnu.org ([2001:4830:134:3::10]:36468)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <narendraj9@gmail.com>) id 1dzoW9-0006Je-Dq
	for emacs-orgmode@gnu.org; Wed, 04 Oct 2017 14:35:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <narendraj9@gmail.com>) id 1dzoW5-0004OE-Gi
	for emacs-orgmode@gnu.org; Wed, 04 Oct 2017 14:35:37 -0400
Received: from mail-pf0-x22a.google.com ([2607:f8b0:400e:c00::22a]:52545)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <narendraj9@gmail.com>)
	id 1dzoW5-0004Mo-BP
	for emacs-orgmode@gnu.org; Wed, 04 Oct 2017 14:35:33 -0400
Received: by mail-pf0-x22a.google.com with SMTP id a1so3452069pfj.9
	for <emacs-orgmode@gnu.org>; Wed, 04 Oct 2017 11:35:33 -0700 (PDT)
In-Reply-To: <87zi99nu6n.fsf@aquinas.i-did-not-set--mail-host-address--so-tickle-me>
	(Richard Lawrence's message of "Mon, 02 Oct 2017 13:58:24 -0700")
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
	<mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/emacs-orgmode/>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
	<mailto:emacs-orgmode-request@gnu.org?subject=subscribe>
Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org
Sender: "Emacs-orgmode"
	<emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org>
To: Richard Lawrence <richard.lawrence@berkeley.edu>
Cc: emacs-orgmode@gnu.org

Richard Lawrence <richard.lawrence@berkeley.edu> writes:

> Hi everyone,
>
> About a year ago, I wrote: 
>>
>>> Is there a simple way for me to say to the agenda, "Show me all (and only)
>>> the NEXT tasks that are part of a project whose deadline is before (say)
>>> 2016-11-01"?  It seems like this should be possible with the built-in agenda
>>> but I can't quite figure it out.  The tricky thing is filtering by the
>>> deadline of the parent project, which might be several levels up. 
>
> I'm still stuck on this, so I'd like to ask this question again. Bastien
> responded: 
>
>> I would add a category to each project, then use something along this: 
>>
>> ("N" "My important tasks" tags-todo
>> "CATEGORY={cat1\\|cat2}+TODO={NEXT}+DEADLINE<=\"<+3d>\"") 
>
> But that doesn't seem to work for me.  The problem is that the tasks I want to
> list in the tags-todo search don't themselves have deadlines; only their parent
> projects do.
>
> I have a file with projects that look like this:
>
> ** TODO Foo University DEADLINE: <2017-11-01>
> *** NEXT Determine application requirements for Foo U.
> *** TODO Submit application
>
> I'd like to see a list of just NEXT tasks in this file, sorted by the deadline
> of their parent projects.
>
> I thought that property inheritance would be the way to do this. So I tried: 
>
>        ("jn" "Job application NEXT tasks" tags-todo
> "+jobmarket+application+TODO={NEXT}"       ((org-use-property-inheritance t))
> (org-agenda-sorting-strategy '(deadline-up)))) 
>
> as well as
>
>        ("jn" "Job application NEXT tasks" tags-todo
> "+jobmarket+application+TODO={NEXT}"       ((org-use-property-inheritance
> '("DEADLINE"))        (org-agenda-sorting-strategy '(deadline-up)))) 
>
> in org-agenda-custom-commands.  But neither seems to work.  Can anyone provide
> any insights here?  Is it possible for sub-tasks within a project to inherit
> their deadline? 
Found an already asked question that might help:
https://lists.gnu.org/archive/html/emacs-orgmode/2016-04/msg00373.html
You can set org-agenda-sorting-strategy to `user-defined-up' and use the
function used in the thread I have posted above to compare two NEXT entries.

> Many thanks as always!
>
> Best,
> Richard
>

-- 
Narendra Joshi