0

I have defined several tags in my org-tag-alist. I want to have a list of all entries of which the TODO-State is "NEXT", which match a tag of this list. Ideally I would get a query where I would just have to input the single character corresponding to my tag in the alist, e.g. "h" for "@home", if there is an ("@home" . ?h) entry in the list.

How can I archive this?

I tried to write my own custom agenda, using the org-ql package:

("n" "Next actions by tag"
         (lambda (arg)
           (interactive)
           (setq my-tag (completing-read "Tag: " (mapcar 'car org-tag-alist)))

           (org-ql-block '(and (todo "NEXT")
                              (tags (format "%s" my-tag))
                          )
                        ((org-ql-block-header (format "NEXT tasks, whose tags match: %s" my-tag)))
                        (agenda)
           )))

Because I did not know how to query for it, using just the one char, I queried for the whole tag.

When the function is called I get the error message Wrong number of arguments: org-ql-block, 3, which is surprising, because the org-ql-block works fine with 3 arguments in another custom agenda, which is a special case of the one here. For reference the other custom agenda is this:

("h" "At home"
         ((org-ql-block '(and (todo "NEXT" "TODO" )
                              (tags "@home")
                         )
                        ((org-ql-block-header "Was am PC getan werden muss"))
                        (agenda)
           )))
Sinthoras
  • 53
  • 6

0 Answers0