1

I use org-ql to view projects.

(defun my/view-projects ()
  (interactive)
  (require 'org-ql)
  (org-ql-search
    (org-agenda-files)
    '(and (tags "project")
          (not (todo "DONE"))
          (not (todo "XXXX")))
    :sort nil))

However, the outcome forgets the tree structure. For example, the following

* a    :project:
** b
*** c

got represented as

a
b
c

Wishing the outcome to preserve the tree structures more, I added :super-groups '((:auto-parent)) in the form of org-ql-search. However, it doesn't make it better.

Question How to customize org-ql in order to view projects with the tree structures preserved?

1 Answer 1

1

I think you need to add a t argument to the :super-groups.

(defun my/view-projects ()
  (interactive)
  (require 'org-ql)
  (org-ql-search
    (org-agenda-files)
    '(and (tags "project")
          (not (todo "DONE"))
          (not (todo "XXXX")))
    :sort nil
    :super-groups '((:auto-parent t))))

This results in this for me. I also note that although this doesn't exactly preserve the tree structure, if you select an item, you an see the path to it in the minibuffer. E.G. with the point on the c item below, you can see that it the path is file/a/b to get to it.

enter image description here

1
  • Indeed! Thanks :)
    – Student
    Commented Jun 29, 2021 at 0:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.