reddit / emacs

A little help with org-agenda

Domva · 2022-09-21 11:33
Hi there! I'm a newb with emacs and org mode. I've been trying to get something into the agenda view with `org-agenda-custom-commands` and `org-super-agenda-groups` but been failing miserably :D What I want is pretty simple and I'm sure there's a solution this, but I wasn't able to find it.Basically, I want to list all **TODO** items under a certain heading. For instance: * Tasks ** TODO some stuff ** TODO some other stuff ** non todo stuff * Not tasks ** some non task stuff ** TODO Some todo, but not under Tasks heading Now, what I would like to list in an agenda view is all TODO items under the "**Tasks"** heading, but not under the "**Not tasks"** heading. After running the custom command, it should be like this: ** TODO some stuff ** TODO some other stuff I've been trying to get this to work with the search command, but could not get this to work. I'm a bit at a loss right now, so any help, would be really appreciated :) ​ EDIT: formatting
Domva · 2022-09-21 12:46
If anyone's interested I managed to solve this with the help of `org-ql` extension. Basically, I added this to custom agenda commands: (org-ql-block '(and (outline-path "Tasks") (level 2)) ((org-ql-block-header "Tasks"))) Since I'm interested in level 2 headings only, I added it here. Hope it helps someone.
github-alphapapa · 2022-09-21 18:44
Well done. You may also try using `org-ql-search` and `org-ql-view` with the same query.
Domva · 2022-09-21 18:49
Oh, thanks! And thanks for your amazing contributions! I tried both commands, however, I like the time grid in the built-in agenda view and didn't find a way to reproduce them with `org-ql` If there's a way, I would definitely use them.
github-alphapapa · 2022-09-21 19:01
Not yet. `org-ql-view` has a ways to go to catch up with all of `org-agenda`'s features. Hopefully someday. But for simple search results, it does have some advantages.
Domva · 2022-09-21 19:02
If I knew any elisp and emacs internals, I would definitely help out. Well, maybe in the future :)
github-alphapapa · 2022-09-22 19:50
Everyone starts somewhere. :)