From mboxrd@z Thu Jan 1 00:00:00 1970 From: Narendra Joshi 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: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) 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 ) 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 ) 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 ; 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." 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" To: Richard Lawrence Cc: emacs-orgmode@gnu.org Richard Lawrence 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