Re: [O] Batch export to html

2011-12-08 Thread Achim Gratz
Vikas Rawal  writes:
> I would like to export an org file to html using a batch command. This
> is the command I tried.
>
> emacs --batch --load=$HOME/lisp/org-7.01/lisp/org.el --eval "(setq
> org-export-headline-levels 1)" --visit=$HOME/file.org --funcall 
> org-export-as-html-batch

That won't work.  At least you will need to load org-install.el, which
conatains all the autoload stuff that org-mode needs.  The export will
likely require some more customization of org-mode variables, so you'll
probably want to load a startup file that includes those customizations
and then a (require 'org-install).

> But I get an error which says: 
>
> Symbol's function definition is void: org-in-block-p
>
> Could anyone explain what this could mean?

It means the function isn't already defined and emacs doesn't know any
way to find that definition.  Which is exactly what you prevented by not
loading org-install.


HTH,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf rackAttack V1.04R1:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




Re: [O] Batch export to html

2011-12-07 Thread Nick Dokos
Vikas Rawal  wrote:

> I would like to export an org file to html using a batch command. This
> is the command I tried.
> 
> emacs --batch --load=$HOME/lisp/org-7.01/lisp/org.el --eval "(setq
> org-export-headline-levels 1)" --visit=$HOME/file.org --funcall 
> org-export-as-html-batch
> 
> But I get an error which says: 
> 
> Symbol's function definition is void: org-in-block-p
> 
> Could anyone explain what this could mean?
> 

Exactly what it says: the function org-in-block-p is not defined anywhere.

Generally speaking, just loading org.el is *not* the way to initialize
org. I have a minimal.emacs which looks like this:

--8<---cut here---start->8---
;;; -*- mode: emacs-lisp -*-
;;; constant part
(add-to-list 'load-path (expand-file-name "~/src/emacs/org/org-mode/lisp"))
(add-to-list 'load-path (expand-file-name 
"~/src/emacs/org/org-mode/contrib/lisp"))
(add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
(require 'org-install)

(setq debug-on-error t)
(setq eval-expression-print-length nil)
(setq eval-expression-print-level nil)

(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
--8<---cut here---end--->8---


(there is usually a "variable" part as well that is tailored for whatever
test I'm trying to do at the time). The important point is that to initialize
*my* installation of org, I have to (require 'org-install).
If you use org from git, you should have something similar. If not git, your
minimal .emacs should mimic pretty much your real .emacs (with extra
stuff stripped out). 

With that, I can export with no problems:

,
| $ emacs --batch --load=$HOME/minimal.emacs.org --eval "(setq 
org-export-headline-levels 1)" --visit=foo.org --funcall 
org-export-as-html-batch
| enabling speedbar support
| OVERVIEW
| Exporting...
| Exporting...
| Saving file /home/nick/src/org/html/foo.html...
| Wrote /home/nick/src/org/html/foo.html
| HTML export done, pushed to kill ring and clipboard
`

Nick



[O] Batch export to html

2011-12-07 Thread Vikas Rawal
I would like to export an org file to html using a batch command. This
is the command I tried.

emacs --batch --load=$HOME/lisp/org-7.01/lisp/org.el --eval "(setq
org-export-headline-levels 1)" --visit=$HOME/file.org --funcall 
org-export-as-html-batch

But I get an error which says: 

Symbol's function definition is void: org-in-block-p

Could anyone explain what this could mean?

Thanks,

Vikas