emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Florian Beck <fb@miszellen.de>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Ignoring empty subtrees/new exporter
Date: Sat, 05 Jan 2013 20:36:08 +0100	[thread overview]
Message-ID: <50E880A8.4080003@miszellen.de> (raw)

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

             reply	other threads:[~2013-01-05 19:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-05 19:36 Florian Beck [this message]
2013-01-06  6:31 ` Ignoring empty subtrees/new exporter Jambunathan K
2013-01-06 10:24 ` Nicolas Goaziou
2013-01-06 21:54   ` Florian Beck
2013-01-07 19:46     ` Florian Beck

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=50E880A8.4080003@miszellen.de \
    --to=fb@miszellen.de \
    --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).