I use the org-ql's sparse tree search to get a glimpse of everything I have to work on at a glance.
Sometimes, when I use a search, it'd be helpful to hide anything deeper than a certain level, to just see the main "categories" or projects I have open.
For example, given a file:
* A
** A.1
*** TODO A.1.3
** A.2
** TODO A.2.1
SCHEDULED: <2026-03-25>
* B
** B.1
If I run org-ql-sparse-tree with the query (todo "TODO"), the following would show up:
* A
** A.1
*** TODO A.1.3
** A.2
** TODO A.2.1
* B
I want to further reduce that to 2 levels only, so that I only see the main categories that I'm actively working on:
(or ideally, B wouldn't show up, but it's hard to hide top-level stuff in a query)
Note that neither A.1 nor A.2 match my original query; it's headlines inside them that do.
Is there a way to do this? I tried org-content but that just expands a bunch of stuff that didn't match the original query.
I use the org-ql's sparse tree search to get a glimpse of everything I have to work on at a glance.
Sometimes, when I use a search, it'd be helpful to hide anything deeper than a certain level, to just see the main "categories" or projects I have open.
For example, given a file:
If I run org-ql-sparse-tree with the query
(todo "TODO"), the following would show up:I want to further reduce that to 2 levels only, so that I only see the main categories that I'm actively working on:
(or ideally, B wouldn't show up, but it's hard to hide top-level stuff in a query)
Note that neither A.1 nor A.2 match my original query; it's headlines inside them that do.
Is there a way to do this? I tried
org-contentbut that just expands a bunch of stuff that didn't match the original query.