emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] excluding whole trees on export when subtrees have "select" tags


From: Nicolas Goaziou
Subject: Re: [O] excluding whole trees on export when subtrees have "select" tags present
Date: Wed, 11 Jan 2017 21:26:29 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Hello,

Eric S Fraga <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]