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

2017-10-06 Thread Marcin Borkowski
Hi there, 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? 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 be

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

2017-10-07 Thread Matt Lundin
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 or

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

2017-10-07 Thread Marcin Borkowski
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

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

2017-10-07 Thread Matt Lundin
Marcin Borkowski writes: > 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 bui

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

2017-12-29 Thread Marcin Borkowski
On 2017-10-07, at 18:54, Matt Lundin wrote: >>> 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 gener

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

2017-12-31 Thread Adam Porter
Marcin Borkowski writes: > Thanks again. I played around with this for some time, but there is one > problem. The agenda has a lot of settings, and replicating them with > org-map-entries turned out to be no fun. > > Is there a way to plug into the agenda generating functions somehow to > get a

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

2018-01-03 Thread Marcin Borkowski
On 2018-01-01, at 00:37, Adam Porter wrote: > Marcin Borkowski writes: > >> Thanks again. I played around with this for some time, but there is one >> problem. The agenda has a lot of settings, and replicating them with >> org-map-entries turned out to be no fun. >> >> Is there a way to plug

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

2018-01-03 Thread Adam Porter
Marcin Borkowski writes: > and thanks for your answer. I never thought about analyzing agenda > /output/ - that is quite clever! I still think it's a hack, and > I really regret that Org does not offer a programmer a better API for > agenda (and many other things) - there could be a lot of appl

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

2018-01-03 Thread Adam Porter
Hi Marcin (and all), I have some more code you might find useful. I had an idea to take a different approach with my org-agenda-ng code (not using org-element to parse the whole buffer first), and it seems to be working well so far. The code is here: https://github.com/alphapapa/org-agenda-ng/tr

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

2018-01-03 Thread Nicolas Goaziou
Hello, Adam Porter writes: > There are some examples of attempts at better APIs (e.g. my PoC > org-agenda-ng code, Remy Honig's > , and some other people's > personal configs here and there), but I'm guessing they all suffer from > Emacs's function call ov

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

2018-01-03 Thread Nicolas Goaziou
Hello, Adam Porter writes: > I have some more code you might find useful. I had an idea to take a > different approach with my org-agenda-ng code (not using org-element to > parse the whole buffer first), and it seems to be working well so far. Clearly, `org-element-parse-buffer' is not adequa

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

2018-01-03 Thread Adam Porter
Nicolas Goaziou writes: Hi Nicolas, > I don't think the size of the functions matter much. Agenda is optimized > for single day view, so it is fast in this case because it only looks > for "interesting" headlines. However, this mechanism is terrible for > multi-days agendas: Agenda treats them a

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

2018-01-03 Thread Adam Porter
Forgive the self reply, but I just made a change which makes the code much more pleasant. The matching functions are bound internally during matching, so instead of: (org-agenda-ng--agenda :files org-agenda-files :pred (lambda () (and (org-agenda-ng--todo-p) (or (org-agen

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

2018-01-03 Thread Adam Porter
Nicolas Goaziou writes: >> I have some more code you might find useful. I had an idea to take a >> different approach with my org-agenda-ng code (not using org-element to >> parse the whole buffer first), and it seems to be working well so far. > > Clearly, `org-element-parse-buffer' is not adeq