emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] "ignoreheading" for non-beamer export


From: James Harkins
Subject: [O] "ignoreheading" for non-beamer export
Date: Thu, 25 Jul 2013 17:42:00 -0400
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/23.3 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

Hi, I found an inventive solution by Suvayu to discard headlines from export 
here [1], but the 8.0+ solution throws an error in my environment.

(defun sa-ignore-headline (contents backend info)
  "Ignore headlines with tag `ignoreheading'."
  (when (and (org-export-derived-backend-p backend 'latex 'html 'ascii)
          (string-match "\\`.*ignoreheading.*\n"
                (downcase headline)))
    (replace-match "" nil nil headline)))

(add-to-list 'org-export-filter-headline-functions 'sa-ignore-headline)

--> string-match: Symbol's value as variable is void: headline

It seems it should actually be:

(defun sa-ignore-headline (contents backend info)
  "Ignore headlines with tag `ignoreheading'."
  (when (and (org-export-derived-backend-p backend 'latex 'html 'ascii)
          (string-match "\\`.*ignoreheading.*\n"
                (downcase contents)))
    (replace-match "" nil nil contents)))

(add-to-list 'org-export-filter-headline-functions 'sa-ignore-headline)

I'm not allowed to reply to the answer on stackexchange, so I'm posting here.

Thanks.
hjh

[1] 
http://stackoverflow.com/questions/10295177/is-there-an-equivalent-of-org-modes-b-ignoreheading-for-non-beamer-documents



reply via email to

[Prev in Thread] Current Thread [Next in Thread]