emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: emacs-orgmode@gnu.org
Subject: Re: excluding whole trees on export when subtrees have "select" tags present
Date: Wed, 11 Jan 2017 21:26:29 +0100	[thread overview]
Message-ID: <871sw9tkay.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87bmvdaa84.fsf@delle7240.chemeng.ucl.ac.uk> (Eric S. Fraga's message of "Wed, 11 Jan 2017 15:26:51 +0000")

Hello,

Eric S Fraga <e.fraga@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

  reply	other threads:[~2017-01-11 20:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-09  9:48 excluding whole trees on export when subtrees have "select" tags present Eric S Fraga
2017-01-09 15:46 ` John Kitchin
     [not found] ` <b3655cb7d021410f872939e0fedfee6a@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-01-09 21:49   ` Eric S Fraga
2017-01-10 14:27     ` John Kitchin
     [not found]     ` <617f560207eb41c0888a6f3c6a8df9db@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-01-11 15:26       ` Eric S Fraga
2017-01-11 20:26         ` Nicolas Goaziou [this message]
     [not found]         ` <af9636231a6b44598ee8e17caee8e941@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-01-12  6:50           ` Eric S Fraga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871sw9tkay.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).