emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nathan Neff <nathan.neff@gmail.com>
To: Adam Porter <adam@alphapapa.net>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Agenda: Display projects and 3 todo subtasks
Date: Thu, 8 Aug 2019 14:05:57 -0500	[thread overview]
Message-ID: <CAC=HedC6dXvYT7gXS6Zb5G+EC1wB8P=vVJTTL+Ymw5q8=V8f=w@mail.gmail.com> (raw)
In-Reply-To: <87blwz7j66.fsf@alphapapa.net>

[-- Attachment #1: Type: text/plain, Size: 1754 bytes --]

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 <adam@alphapapa.net> 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.
>
>
>

[-- Attachment #2: Type: text/html, Size: 3202 bytes --]

  reply	other threads:[~2019-08-08 19:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-31  2:32 Agenda: Display projects and 3 todo subtasks Nathan Neff
2019-07-31  2:36 ` Nathan Neff
2019-07-31 13:59   ` Sacha Chua
     [not found]     ` <CAC=HedC2ca+5zS2kSVaLRFm556z_7+Va3Ymki_D46P_FOKUXMQ@mail.gmail.com>
2019-08-01 21:48       ` Nathan Neff
2019-08-23 18:58     ` Nathan Neff
2019-08-08 15:48 ` Adam Porter
2019-08-08 19:05   ` Nathan Neff [this message]
2019-08-09 11:03     ` Adam Porter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAC=HedC6dXvYT7gXS6Zb5G+EC1wB8P=vVJTTL+Ymw5q8=V8f=w@mail.gmail.com' \
    --to=nathan.neff@gmail.com \
    --cc=adam@alphapapa.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).