Vikas Rawal <vikasli...@agrarianresearch.org> 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