From mboxrd@z Thu Jan 1 00:00:00 1970 From: York Zhao Subject: Re: Wrong numbering after removal of headline Date: Mon, 30 Jun 2014 19:01:50 -0400 Message-ID: References: <87d2dqnkmj.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1ka9-0004M6-BX for emacs-orgmode@gnu.org; Mon, 30 Jun 2014 19:01:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1ka7-0006Zo-Nu for emacs-orgmode@gnu.org; Mon, 30 Jun 2014 19:01:53 -0400 Received: from mail-vc0-x229.google.com ([2607:f8b0:400c:c03::229]:42073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1ka7-0006Zd-Ja for emacs-orgmode@gnu.org; Mon, 30 Jun 2014 19:01:51 -0400 Received: by mail-vc0-f169.google.com with SMTP id la4so8373004vcb.0 for ; Mon, 30 Jun 2014 16:01:50 -0700 (PDT) In-Reply-To: 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: York Zhao , emacs-orgmode Finally, I got it all work and am happy with the result, here is the code: (defun yz/org-export-ignore-headline (backend) "Ignore headlines with tag `ignoreheading'." (save-excursion (let ((org-allow-promoting-top-level-subtree t)) (org-map-entries (lambda () (when (member "ignoreheading" (org-get-tags-at nil 'local)) (org-promote-subtree) (delete-region (line-beginning-position) (line-end-position)))))))) (add-hook 'org-export-before-parsing-hook 'yz/org-export-ignore-headline)