1

I want to create Org Mode agenda views or sparse trees with tag inheritance disabled so that tagged headlines are included but children are not. I do not want to turn off tag inheritance globally. I thought this could be accomplished by setting options for custom commands, as in the following example:

 (setq org-agenda-custom-commands
    '(("y" tags "tag1|tag2"
       ((org-agenda-use-tag-inheritance nil)))))

However, the resulting agenda view includes all children of the tagged headlines. The desired result can be achieved by disabling tag inheritance globally, (setq org-use-tag-inheritance nil), but I do not want to disable tag inheritance globally, only for the agenda custom command.

Alternatively I have tried to create the same filter using a sparse tree:

   (setq org-agenda-custom-commands
    '(("Y" tags-tree "tag1|tag2"
      ((org-show-context-detail 'minimal)))))

But this returns a sparse tree including all children and ancestors of the tagged headlines. Again, if I disable tag inheritance globally I achieve the desired result. What am I am missing?

1 Answer 1

0

The docstring of org-agenda-use-tag-inheritance says that:

In tags/tags-todo/tags-tree agenda views, tag inheritance is controlled by org-use-tag-inheritance.

Both of these work as expected even when org-use-tag-inheritance is non-nil globally:

(setq org-agenda-custom-commands
      '(("y" tags "tag1|tag2"
         ((org-use-tag-inheritance nil)))))

(setq org-agenda-custom-commands
      '(("Y" tags-tree "tag1|tag2"
         ((org-use-tag-inheritance nil)))))

Your Answer

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

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