From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: ignoreheading in LaTeX export Date: Thu, 27 Mar 2014 15:24:39 +0100 Message-ID: References: <87y4zwrpp9.fsf@gmail.com> <87d2h7srdj.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTBEj-0002W1-9D for emacs-orgmode@gnu.org; Thu, 27 Mar 2014 10:25:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTBEY-0004T9-V7 for emacs-orgmode@gnu.org; Thu, 27 Mar 2014 10:24:53 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:4429) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTBEY-0004Sv-Ny for emacs-orgmode@gnu.org; Thu, 27 Mar 2014 10:24:42 -0400 In-Reply-To: <87d2h7srdj.fsf@gmail.com> (Nicolas Goaziou's message of "Thu, 27 Mar 2014 14:28:08 +0100") 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: Nicolas Goaziou Cc: emacs-orgmode Nicolas Goaziou writes: > I suggest to use the dedicated MATCH argument for `org-map-entries': > > (defun as/delete-ignored-heading (backend) > "Remove every headline with a tag `ignoreheading' in the > current buffer. BACKEND is the export back-end being used, as > a symbol." > (org-map-entries > (lambda () (delete-region (point) (progn (forward-line) (point)))) > "+ignoreheading")) Thank you, this works, with a big caveat (which makes this approach broken for me): with the following ECM --8<---------------cut here---------------start------------->8--- * No Export :noexport: test * Heading 1 :ignoreheading: foo * Heading 2 bar --8<---------------cut here---------------end--------------->8--- the text under "Heading 1" is no longer present. I suspect the heading is removed before the ":noexport:" is processed, which captures the text as well (which is bad: the reason for the heading in the first place is to end the ":noexport:" block). I went back to the stack-overflow suggestion. >> I have a followup question (purely from an aesthetic point of view, the >> code works fine). I see that a label is still generated in the LaTeX >> file (there is a "\label{sec-1}" with just the "\maketitle" above it). >> Is it expected? > > I don't think so. Though, after a quick test, I'm unable to reproduce > it. Do you have an ECM? It is indeed a problem with the stack-overflow solution and not with yours. I was confused when trying things out. Thanks, Alan