emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matt Lundin <mdl@imapmail.org>
To: Marcin Borkowski <mbork@mbork.pl>
Cc: Org-Mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: Is there a way to get all agenda TODOs programmatically?
Date: Sat, 07 Oct 2017 11:54:13 -0500	[thread overview]
Message-ID: <874lrasxu2.fsf@fastmail.fm> (raw)
In-Reply-To: <87r2ue29j8.fsf@mbork.pl> (Marcin Borkowski's message of "Sat, 07 Oct 2017 18:43:39 +0200")

Marcin Borkowski <mbork@mbork.pl> writes:

> On 2017-10-07, at 16:20, Matt Lundin <mdl@imapmail.org> wrote:
>
>> Hi Marcin,
>>
>> Marcin Borkowski <mbork@mbork.pl> writes:
>>
>>> I'd like to get a list of all agenda TODOs, with titles and due dates.
>>> Is there something ready in Org/contrib/blogosphere to help me?
>>
>> This functionality is built into org-mode. The simplest way to get such
>> a list is to use the agenda (specifically M-x org-todo-list). To display
>> scheduling information you can customize the variable
>> org-agenda-prefix-format.
>
> I know (and use) that.  What I want is not /display/, but a /data
> structure/ containing that info.

Ah, I see! A lisp list, not a list on the screen.

>> Finally, if you want simply to gather the todo data programmatically for
>> further processing you can use the function org-map-entries.
>
> Thanks, that seems to be a good pointer.  I'll check it out.

I think something like this would generate a such a list:

(org-map-entries '(cons (nth 4 (org-heading-components))
                         (list (org-get-deadline-time nil)))
                  "/!TODO" 'agenda)

Each item in the list would look something like this:

("Test" (23000 24400))

You could then feed the list to whatever function you'd like.

Best,
Matt

  reply	other threads:[~2017-10-07 16:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-07  4:43 Is there a way to get all agenda TODOs programmatically? Marcin Borkowski
2017-10-07 14:20 ` Matt Lundin
2017-10-07 16:43   ` Marcin Borkowski
2017-10-07 16:54     ` Matt Lundin [this message]
2017-12-29 19:55       ` Marcin Borkowski
2017-12-31 23:37         ` Adam Porter
2018-01-03  9:31           ` Marcin Borkowski
2018-01-03  9:50             ` Adam Porter
2018-01-03 13:15               ` Adam Porter
2018-01-03 14:15                 ` Nicolas Goaziou
2018-01-03 15:48                   ` Adam Porter
2018-01-03 14:19                 ` Adam Porter
2018-01-03 13:49               ` Nicolas Goaziou
2018-01-03 14:16                 ` 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=874lrasxu2.fsf@fastmail.fm \
    --to=mdl@imapmail.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=mbork@mbork.pl \
    /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).