From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Borkowski Subject: Re: Is there a way to get all agenda TODOs programmatically? Date: Sat, 07 Oct 2017 18:43:39 +0200 Message-ID: <87r2ue29j8.fsf@mbork.pl> References: <87376v36up.fsf@mbork.pl> <87a813rqdx.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0sCj-0007pG-W0 for emacs-orgmode@gnu.org; Sat, 07 Oct 2017 12:43:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0sCg-0005Iw-T0 for emacs-orgmode@gnu.org; Sat, 07 Oct 2017 12:43:58 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]:38276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0sCg-0005IG-L5 for emacs-orgmode@gnu.org; Sat, 07 Oct 2017 12:43:54 -0400 In-reply-to: <87a813rqdx.fsf@fastmail.fm> 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: Matt Lundin Cc: Org-Mode mailing list On 2017-10-07, at 16:20, Matt Lundin wrote: > Hi Marcin, > > Marcin Borkowski 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. >> The problem I'm trying to solve is to make some kind of a metric of how >> I'm doing with my TODO list, like "how many overdue tasks do I have", or >> even better, such a sum weighted by the time after the deadline, or >> something similar. > > If you use the "DEADLINE" keyword (M-x org-deadline, bound to C-c C-d), > then the daily/weekly agenda (M-x org-agenda-list) will display any > overdue tasks. > > 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. > Best, > Matt Best, -- Marcin Borkowski