20

Having a file for a particular project, I would like all the nodes in that file to have a tag identifying the project, so that I can later use it to create agenda views for that project only. So far all I've found is #+TAGS: foo bar spam which specifies a hard list of tags offered in tag autocompletion for that file.

Does anyone know of a #+XXX-like instruction to achieve this?

3 Answers 3

28

Yes. From the Tag inheritance chapter of the org-mode manual (emphasis mine):

Tags make use of the hierarchical structure of outline trees. If a heading has a certain tag, all subheadings will inherit the tag as well. For example, in the list

* Meeting with the French group      :work:
** Summary by Frank                  :boss:notes:
*** TODO Prepare slides for him      :action:

the final heading will have the tags :work:, :boss:, :notes:, and :action: even though the final heading is not explicitly marked with those tags. You can also set tags that all entries in a file should inherit just as if these tags were defined in a hypothetical level zero that surrounds the entire file. Use a line like this:

#+FILETAGS: :Peter:Boss:Secret:
2
  • Great, I found the answer immediately after posting the question, and wrote an answer myself but you beat me to it ;) Thanks for your answer! Commented Jun 23, 2015 at 16:32
  • 1
    @ElNinjaTrepador Yes - by 12 seconds :) However, I'm happy you were able to answer your own question!
    – itsjeyd
    Commented Jun 23, 2015 at 16:33
13

File specific tags can be specified as:

#+FILETAGS: :tag1:tag2:tag3:

These tags then apply to lower level entries through inheritance.

11

Okay, I found the answer to the question right after posting it... anyway, here it goes for those who might not know how to do this:

#+FILETAGS: :foo:bar:spam:

Found the info in this very useful page with all the in-buffer settings.

0

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.