Hello, Eric S Fraga <e.fr...@ucl.ac.uk> writes:
> On Tuesday, 10 Jan 2017 at 14:27, John Kitchin wrote: >> This does not sound right to me. >> >> This org file: >> >> #+BEGIN_SRC org >> ,#+select_tags: wanted >> ,#+exclude_tags: notwanted >> >> ,* headline >> :notwanted: >> some text >> >> ,** subhead 1 >> ,** subhead2 >> :wanted: >> more text >> #+END_SRC >> >> >> should not have any thing to export. > > Yes, and it works. However, if I don't explicitly specify "notwanted" > as excluded, the whole file is exported. I guess I don't understand the > meaning of "select_tags": I would like this to specify those trees to be > exported only if the given tags are present. This is what select tags do, but the tree starts at top-level. Any tree that _contains_ a select tag is exported as a whole. See `org-export--selected-trees'. You want to use select tags to get parts of trees, i.e. sub-trees. For example, * H1 * H2 ** SH1 :wanted: ** SH2 *** SSH1 :wanted: would become morally equivalent to * SH1 :wanted: * SSH1 :wanted: This is not possible. I had a patch for that, but I never got to apply it because it seemed very hackish. Also, you can do the same in a hook, where a function would delete any entry not tagged "wanted" prior to export. Regards, -- Nicolas Goaziou