From mboxrd@z Thu Jan 1 00:00:00 1970 From: Myles English Subject: Re: Bibtex export Date: Thu, 20 Dec 2012 14:31:22 +0000 Message-ID: <87a9t8u75x.fsf@gmail.com> References: , Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:36440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tlh9K-0001Q4-BC for emacs-orgmode@gnu.org; Thu, 20 Dec 2012 09:31:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tlh9F-0006ej-5o for emacs-orgmode@gnu.org; Thu, 20 Dec 2012 09:31:02 -0500 Received: from mail-we0-f175.google.com ([74.125.82.175]:46212) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tlh9E-0006eZ-Vl for emacs-orgmode@gnu.org; Thu, 20 Dec 2012 09:30:57 -0500 Received: by mail-we0-f175.google.com with SMTP id z53so1646638wey.34 for ; Thu, 20 Dec 2012 06:30:55 -0800 (PST) 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: mohamed Cc: emacs-orgmode@gnu.org mohamed writes: > Myles, > Thank you for this answer. > I tried it with > ------------------------------- > (add-to-list 'org-export-preprocess-hook > 'my-export-delete-headlines-tagged-noheading) > ------------------------------- Sorry, I should have said: add it to org-export-before-processing-hook, so you use it like this: #+begin_src emacs-lisp (defun my-export-delete-headlines-tagged-noheading (backend) (dolist (hl (nreverse (org-element-map (org-element-parse-buffer 'headline) 'headline 'identity))) (when (member "noheading" (org-element-property :tags hl)) (goto-char (org-element-property :begin hl)) (delete-region (point) (progn (forward-line) (point)))))) (add-to-list 'org-export-before-processing-hook 'my-export-delete-headlines-tagged-noheading) #+end_src Myles > > > But I got some errors when exporting > > ----------------------------------------------------------------- > Exporting to LaTeX... run-hooks: Wrong number of > arguments: (lambda (backend) (dolist (hl (nreverse (org-element-map > (org-element-parse-buffer (quote headline)) (quote headline) (quote identity)))) > (when (member "noheading" (org-element-property :tags hl)) (goto-char > (org-element-property :begin hl)) (delete-region (point) (progn (forward-line) > (point)))))), 0 (my-export-delete-headlines-tagged-noheading) > ----------------------------------------------------------------- > > > I guess I have to use it in another way. My knowledge of lisp programming is > very limited. > > Regards, > Mohamed