From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Neff Subject: Re: Agenda: Display projects and 3 todo subtasks Date: Thu, 8 Aug 2019 14:05:57 -0500 Message-ID: References: <87blwz7j66.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000868892058f9fc061" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:48566) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hvnjv-0002cg-Oa for emacs-orgmode@gnu.org; Thu, 08 Aug 2019 15:06:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hvnju-00059u-MV for emacs-orgmode@gnu.org; Thu, 08 Aug 2019 15:06:19 -0400 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]:38808) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hvnju-00059K-Hd for emacs-orgmode@gnu.org; Thu, 08 Aug 2019 15:06:18 -0400 Received: by mail-ot1-x32a.google.com with SMTP id d17so123072870oth.5 for ; Thu, 08 Aug 2019 12:06:18 -0700 (PDT) In-Reply-To: <87blwz7j66.fsf@alphapapa.net> 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: Adam Porter Cc: emacs-orgmode --000000000000868892058f9fc061 Content-Type: text/plain; charset="UTF-8" Wow - thanks Adam! Your stuff is awesome. org-rifle is incredible. (I just wish that it didn't have as many dependencies -- I guess I'm just a bit paranoid). Thanks, --Nate On Thu, Aug 8, 2019 at 10:48 AM Adam Porter wrote: > Hi Nathan, > > Well, this is an unorthodox solution using org-ql, but it seems to work. > So, for what it's worth: > > #+BEGIN_SRC elisp > (let* ((sub-query (lambda () > (save-excursion > (save-restriction > (cons (org-ql--add-markers > (org-element-headline-parser (line-end-position))) > (-take 3 (progn > (org-narrow-to-subtree) > (org-ql-select nil > '(todo) > :narrow t > :action > 'element-with-markers)))))))) > (entries (-flatten-n 1 (org-ql-select buffer > '(and (tags "PROJECT") > (not (todo))) > :action sub-query)))) > (org-ql-agenda--agenda nil nil :entries entries)) > #+END_SRC > > This produces an agenda-like view showing (I changed "todo" to "TODO" in > the test file): > > Project 1 > :PROJECT: > TODO task 1.1 > :PROJECT: > TODO task 1.2 > :PROJECT: > TODO task 1.3 > :PROJECT: > Project 2 > :PROJECT: > TODO task 2.1 > :PROJECT: > TODO task 2.2 > :PROJECT: > TODO task 2.3 > :PROJECT: > > This is a bit awkward, but it's given me an idea about running nested > queries, so I'll see if I can make that easier. > > > --000000000000868892058f9fc061 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: base64 PGRpdiBkaXI9Imx0ciI+PGRpdj5Xb3cgLSB0aGFua3MgQWRhbSE8L2Rpdj48ZGl2Pjxicj48L2Rp dj48ZGl2PllvdXIgc3R1ZmYgaXMgYXdlc29tZS7CoCBvcmctcmlmbGUgaXMgaW5jcmVkaWJsZS7C oCAoSSBqdXN0IHdpc2ggdGhhdDwvZGl2PjxkaXY+aXQgZGlkbiYjMzk7dCBoYXZlIGFzIG1hbnkg ZGVwZW5kZW5jaWVzIC0tIEkgZ3Vlc3MgSSYjMzk7bSBqdXN0IGEgYml0IHBhcmFub2lkKS48L2Rp dj48ZGl2Pjxicj48L2Rpdj48ZGl2PlRoYW5rcyw8L2Rpdj48ZGl2Pi0tTmF0ZTwvZGl2PjxkaXY+ PGJyPjwvZGl2PjwvZGl2Pjxicj48ZGl2IGNsYXNzPSJnbWFpbF9xdW90ZSI+PGRpdiBkaXI9Imx0 ciIgY2xhc3M9ImdtYWlsX2F0dHIiPk9uIFRodSwgQXVnIDgsIDIwMTkgYXQgMTA6NDggQU0gQWRh bSBQb3J0ZXIgJmx0OzxhIGhyZWY9Im1haWx0bzphZGFtQGFscGhhcGFwYS5uZXQiPmFk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