Re: [O] "ignoreheading" for non-beamer export

2013-07-26 Thread Suvayu Ali
Hi James,

On Thu, Jul 25, 2013 at 05:42:00PM -0400, James Harkins wrote:
> 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)

 [...chomp...chomp...chomp...]

> (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)

 [...chomp...chomp...chomp...]

> (downcase contents)))
> (replace-match "" nil nil contents)))
> 
> (add-to-list 'org-export-filter-headline-functions 'sa-ignore-headline)

Oops, typo!  Also a correction, I had a solution for the old exporter.
If I recall correctly Nick Dokos helped me come up with it.  The 8.0<
solution was from Rasmus based on suggestions from Nicolas.

I'll update the answer on SO.

Thanks for checking it,

-- 
Suvayu

Open source is the future. It sets us free.



[O] "ignoreheading" for non-beamer export

2013-07-25 Thread James Harkins
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