From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Beck Subject: Ignoring empty subtrees/new exporter Date: Sat, 05 Jan 2013 20:36:08 +0100 Message-ID: <50E880A8.4080003@miszellen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrZXZ-0007yD-HX for emacs-orgmode@gnu.org; Sat, 05 Jan 2013 14:36:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TrZXX-0004oT-BY for emacs-orgmode@gnu.org; Sat, 05 Jan 2013 14:36:21 -0500 Received: from mo6-p04-ob.rzone.de ([2a01:238:20a:202:5304::1]:35807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrZXX-0004oH-4L for emacs-orgmode@gnu.org; Sat, 05 Jan 2013 14:36:19 -0500 Received: from [10.142.45.17] ([89.204.137.17]) by smtp.strato.de (jored mo37) (RZmta 31.11 SBL|AUTH) with ESMTPA id 407729p05J7kKG for ; Sat, 5 Jan 2013 20:36:12 +0100 (CET) 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode Hi, I have a document with many sections not yet written (i.e. heading without content) and I would like them to be ignored in the exported file. I know, I could manually tag these headings with :noexport:, but what about a more automated approach? Now, I tried this: (defun ignore-empty-section (headline contents info) (when contents (org-e-latex-headline headline contents info))) (add-to-list 'org-e-latex-translate-alist '(headline . ignore-empty-section)) This does ALMOST what I want: it ignores sections that are completely empty. But I also want to ignore sections that have only empty subsections (and so on, recursively). For example: * Chapter ** this subtree should be ignored *** no content *** no content ** this subtree should not be ignored *** subsection **** finally, content something weird *** subsection Any ideas? I tried parsing the HEADLINE stuff (the first argument), but it looks a bit intimidating. It's not super important, because it's a draft obviously, but it would be nice. Thanks, Florian