Open alphapapa opened 6 years ago
Hi @alphapapa,
First of all, thanks for even spending your time going through my configuration. Sorry for the delay in replying, I haven't had much free time lately.
The code building *org-ql-complex*
is based on the example you gave me a couple of months ago. I was trying to achieve with org-ql, an agenda that I built for reviewing my progress with getting things done. You can find it in my configuration, and it's essentially this:
(setq org-agenda-custom-commands
`(("r" "Review"
((tags ,(mpereira/org-agenda-review-search "today" "+1d")
((org-agenda-prefix-format " %i %-18c%?-12t% s")
(org-agenda-overriding-header
(concat
"\nDone today "
"(" (format-time-string "%A, %B %d" (current-time)) ")\n"))))
(tags ,(mpereira/org-agenda-review-search "-1d" "today")
((org-agenda-prefix-format " %i %-18c%?-12t% s")
(org-agenda-overriding-header
(concat
"\nDone yesterday "
"(" (format-time-string "%A, %B %d" (mpereira/yesterday)) ")\n"))))
(tags ,(mpereira/org-agenda-review-search
(mpereira/org-agenda-date-week-start
(mpereira/format-calendar-date-Y-m-d
(mpereira/calendar-read-date "today")))
(mpereira/org-agenda-date-week-end
(mpereira/format-calendar-date-Y-m-d
(mpereira/calendar-read-date "today"))))
((org-agenda-prefix-format
" %-18c %(mpereira/org-agenda-review-suffix-format) ")
(org-agenda-show-all-dates t)
(org-agenda-sorting-strategy '(timestamp-down))
(org-agenda-overriding-header "\nDone this week\n")))
(tags ,(mpereira/org-agenda-review-search
(mpereira/org-agenda-date-week-start
(mpereira/format-calendar-date-Y-m-d
(mpereira/calendar-read-date "-1w")))
(mpereira/org-agenda-date-week-end
(mpereira/format-calendar-date-Y-m-d
(mpereira/calendar-read-date "-1w"))))
((org-agenda-prefix-format
" %-18c %(mpereira/org-agenda-review-suffix-format) ")
(org-agenda-show-all-dates t)
(org-agenda-sorting-strategy '(timestamp-down))
(org-agenda-overriding-header "\nDone last week\n"))))
((org-agenda-block-separator ?\-)))))
which looks something like this:
(It has a few bugs, but you get the idea).
In addition to using the (IMO) complex and unfriendly org agenda APIs, this agenda required a bunch of custom functions (mpereira/...
). If I could do the same using the org-ql API (which is much simpler) it would be super nice.
Unfortunately I didn't have time to achieve "feature parity" with the org-ql-based agenda, but it did seem to be at least possible.
Supporting "Done this month" would be a bit more complicated because of converting the relative date strings to absolute dates (my code uses GNU date, which doesn't support e.g. first of this month), but it should be doable.
Would you find this useful?
Absolutely. What could be even more useful is making it possible to filter (and transform) entries based on functions, instead of being constrained by DSLs. Like what we were doing with closed-this-month
in the code you posted, for example.
Well, I just happened to be browsing Emacs configs that mentioned org-ql
, curious about how people were using it, and I saw your code. :)
I just pushed a commit to a branch that you may find interesting, and sort of relevant. It's mentioned here: https://github.com/alphapapa/org-ql/issues/8 I might be able to do something similar for the closed
selector. Let me know what you think.
What could be even more useful is making it possible to filter (and transform) entries based on functions, instead of being constrained by DSLs.
I'm not sure what you mean. Could you give a more specific example?
Thanks.
Hi there,
I saw this code in your config:
And I saw that you wrote a little library of functions to support it. Very cool!
But I realized that that was only necessary because
org-super-agenda
doesn't supportbetween
dates. I have some prototype code that lets you do something like this:Supporting "Done this month" would be a bit more complicated because of converting the relative date strings to absolute dates (my code uses GNU
date
, which doesn't support e.g.first of this month
), but it should be doable.Would you find this useful?