alphapapa / org-super-agenda

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

Group items by top level heading #193

Closed FredrikMeyer closed 3 years ago

FredrikMeyer commented 3 years ago

Is there a way to group items by their top level heading?

I.e say my org file is something like this:

* Header 1
** Child 1
** Child 2
* Header 2
** Child 3

Now I use :auto-outline-path, but that creates one group per header, not one per top level header.

I saw the example here, but I'm not sure if I understand it, or if it can be used for this.

Thanks!

alphapapa commented 3 years ago

What about :auto-parent?

FredrikMeyer commented 3 years ago

Thanks for the answer!

That's almost what I want. Expanding on my example above, what I'd want to see this: Given this:

* Header 1
** Child 1.1
*** Child 1.1.1
*** Child 1.1.2
** Child 1.2
* Header 2
** Child 2.1

I'd like to see this:

* Header 1
** Child 1.1
** Child 1.2
* Header 2
** Child 2.1

So I only want to see direct children of the main headlines.

I almost worked this by doing :auto-group, but this still includes level 2 children. I see there is :auto-property as well, but I don't know if there is way to only inherit properties one level.

alphapapa commented 3 years ago

Although it's possible (e.g. using :pred with a predicate of your own), it's questionable whether org-super-agenda is the best way to achieve this. It would probably be better to exclude headings deeper than level 2 in the first place. That would be easy with org-ql.

FredrikMeyer commented 3 years ago

Aha, I didn't know about org-ql!

I see they have an example for filtering agenda views in their README. Thanks for pointing me in the right direction.

alphapapa commented 3 years ago

Note that that "they" is me. ;)

FredrikMeyer commented 3 years ago

Aha! Great work on both :D