From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: excluding whole trees on export when subtrees have "select" tags present Date: Wed, 11 Jan 2017 21:26:29 +0100 Message-ID: <871sw9tkay.fsf@nicolasgoaziou.fr> References: <878tqkmunb.fsf@ucl.ac.uk> <87a8azkioa.fsf@ucl.ac.uk> <617f560207eb41c0888a6f3c6a8df9db@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> <87bmvdaa84.fsf@delle7240.chemeng.ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRPTc-0003mz-K8 for emacs-orgmode@gnu.org; Wed, 11 Jan 2017 15:26:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRPTb-0003Pc-Rd for emacs-orgmode@gnu.org; Wed, 11 Jan 2017 15:26:32 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:50161) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cRPTb-0003PQ-La for emacs-orgmode@gnu.org; Wed, 11 Jan 2017 15:26:31 -0500 Received: from saiph.selenimh (00004301000000000000074b.ipv6.chd.sx [IPv6:2a03:a0a0:0:4301::74b]) (Authenticated sender: mail@nicolasgoaziou.fr) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 0209A1720BC for ; Wed, 11 Jan 2017 21:26:29 +0100 (CET) Received: from ngz by saiph.selenimh with local (Exim 4.88) (envelope-from ) id 1cRPTZ-0003O9-GS for emacs-orgmode@gnu.org; Wed, 11 Jan 2017 21:26:29 +0100 In-Reply-To: <87bmvdaa84.fsf@delle7240.chemeng.ucl.ac.uk> (Eric S. Fraga's message of "Wed, 11 Jan 2017 15:26:51 +0000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Hello, Eric S Fraga 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