alphapapa / org-super-agenda

Supercharge your Org daily/weekly agenda by grouping items
GNU General Public License v3.0
1.35k stars 107 forks source link

Changing auto-parent group ordering #201

Closed rychipman closed 3 years ago

rychipman commented 3 years ago

Hello! Thank you for some amazing elisp packages! org-ql and org-super-agenda in particular practically run my life!

I have been tweaking my org-ql agendas, and ran into a question about :auto-parent. Specifically, it appears that groups generated by (:auto-parent t) are always ordered lexicographically by heading, and I'm wondering whether it is possible to customize this order somehow. Some initial investigation into the org-super-agenda code didn't turn up anything obvious.

If it matters/helps, I'm creating these groups via org-ql-search:

  (org-ql-search (org-agenda-files)
    `(and (todo)
          (not (tags "prj"))
          (or (scheduled :to ,day)
              (deadline)
              (not (scheduled))))
    :title "Planning Dashboard"
    :sort '(scheduled priority todo)
    :super-groups `((:name "Recurring Tasks"
                           :tag "recur")
                    (:name "Previously Scheduled"
                           :scheduled past)
                    (:name "Scheduled Today"
                           :scheduled today)
                    (:name "Deadlines"
                           :deadline t)
                    (:auto-parent t)))
alphapapa commented 3 years ago

Hi,

Thanks for the kind words. I'm glad they're useful to you.

Regarding sorting, please see #166.

rychipman commented 3 years ago

It looks to me like #166 discusses the sorting of entries within a group; I realize now that my original message didn't make this completely clear, but what I'm trying to find a way to do is change the order of the groups themselves. The example org-ql-search invocation I gave above might result in an agenda like the following:

Recurring Tasks
 TODO A recurring task

Scheduled Today
 TODO A task scheduled for today

Project A
 TODO Some Task

Project B
 TODO Another Task

Project C
 TODO Yet Another Task

Here, the Project A, Project B, and Project C groups are the ones generated by (:auto-parent t). AFAICT, these three groups will always appear in the same order. I'm trying to discover if it is possible to make them appear in a different order (perhaps ordered by priority of the parent heading or some other predicate).

Do you know if there's any way that this could be accomplished (either by using some existing org-ql/org-super-agenda feature or via some elisp hacking)?

alphapapa commented 3 years ago

Please see #159. If that still isn't it, please search all issues (including closed ones) for "sort". If you still don't find an answer, please let me know.

rychipman commented 3 years ago

This does answer my question -- thanks for the help!

alphapapa commented 3 years ago

Thanks. FYI, my long-term plan is to improve org-ql-view to be more powerful (e.g. having nested groups and sorting of them). Of course, org-super-agenda would remain useful for org-agenda, but rather than put a lot of effort into rewriting this package to add features like this, I'd rather put it into org-ql-view and a more powerful solution.