emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Is there a way to get all agenda TODOs programmatically?


From: Matt Lundin
Subject: Re: [O] Is there a way to get all agenda TODOs programmatically?
Date: Sat, 07 Oct 2017 11:54:13 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Marcin Borkowski <address@hidden> writes:

> On 2017-10-07, at 16:20, Matt Lundin <address@hidden> wrote:
>
>> Hi Marcin,
>>
>> Marcin Borkowski <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]