From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Batch export to html Date: Wed, 07 Dec 2011 11:49:57 -0500 Message-ID: <28008.1323276597@alphaville.dokosmarshall.org> References: <20111207111621.GA9897@panahar> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:57335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYKh6-0004Am-Nv for emacs-orgmode@gnu.org; Wed, 07 Dec 2011 11:50:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RYKh0-0004BS-L5 for emacs-orgmode@gnu.org; Wed, 07 Dec 2011 11:50:08 -0500 Received: from g5t0007.atlanta.hp.com ([15.192.0.44]:39873) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYKh0-0004At-Ao for emacs-orgmode@gnu.org; Wed, 07 Dec 2011 11:50:02 -0500 Received: from g5t0029.atlanta.hp.com (g5t0029.atlanta.hp.com [16.228.8.141]) by g5t0007.atlanta.hp.com (Postfix) with ESMTP id 1FA4F140DD for ; Wed, 7 Dec 2011 16:49:59 +0000 (UTC) In-Reply-To: Message from Vikas Rawal of "Wed, 07 Dec 2011 16:46:21 +0530." <20111207111621.GA9897@panahar> 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: emacs-orgmode Cc: nicholas.dokos@hp.com 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