1

I want a mechanism by which if an Org headline has TAG1, TAGX2 is also added to it. This can happen at capture time (preferable) or some kind of a cron job that runs every x minutes, parses all headlines and adds tags as needed.

Of course, if TAGX2 is already added, that headline should be left alone or we will have :TAG1:TAGX2:TAGX2: kind of situation!

1

Rather than adding multiple related tag strings into your files which can be cumbersome and messy, you can define hierarchical tags that does the same thing. You can then search for the higher level tag using agenda commands and see all headers using either the higher level tag or any of the lower level tags.

For example, here is a simple hierarchy EMACS > ORG.

(setq org-tag-alist '((:startgrouptag)
                  ("EMACS"   . ?e)
                  (:grouptags)
                  ("ORG"     . ?o)
                  (:endgrouptag)))

If you use these tags and search for EMACS (usually the key combination is C-c a m), you will get all headers tagged with EMACS or ORG.

This behaviour is controlled by the boolean variable org-group-tags.

  • Thanks. Hiearchical tags is, indeed, a useful feature. But I wanted these tags per heading because Orgzly that I use on my smartphone (alongwith emacs on my computer) does not handle hiearchical tags (as yet) :) – deshmukh Jun 5 '18 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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