Test and implement org-use-tag-inheritance.
Some checks failed
Testing / pytest (push) Has been cancelled
Testing / mypy (push) Has been cancelled
Testing / style-formatting (push) Has been cancelled
Testing / style-sorted-imports (push) Has been cancelled
Testing / stability-extra-test (push) Has been cancelled

This commit is contained in:
Sergio Martínez Portela 2024-09-01 23:51:10 +02:00
parent 92078617fc
commit d4b0d0301f
2 changed files with 29 additions and 2 deletions

View file

@ -754,7 +754,14 @@ class Headline:
@property
def tags(self) -> list[str]:
parent_tags = self.parent.tags
if self.doc.environment.get('org-tags-exclude-from-inheritance'):
if self.doc.environment.get('org-use-tag-inheritance'):
accepted_tags = []
for tag in self.doc.environment.get('org-use-tag-inheritance'):
if tag in parent_tags:
accepted_tags.append(tag)
parent_tags = accepted_tags
elif self.doc.environment.get('org-tags-exclude-from-inheritance'):
for tag in self.doc.environment.get('org-tags-exclude-from-inheritance'):
if tag in parent_tags:
parent_tags.remove(tag)