From mboxrd@z Thu Jan 1 00:00:00 1970 From: Viktor Rosenfeld Subject: Re: Export an org file from the command line in the background Date: Thu, 20 Oct 2011 00:28:50 +0200 Message-ID: <20111019222850.GB28039@kenny.fritz.box> References: <20111019162146.GA24998@client199-154.wlan.hu-berlin.de> <81fwip3q0k.fsf@gmail.com> <20111019201437.GA28039@kenny.fritz.box> <6830.1319058741@alphaville.americas.hpqcorp.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:52034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGed7-0004cu-Gj for emacs-orgmode@gnu.org; Wed, 19 Oct 2011 18:28:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGed5-0000Uc-OV for emacs-orgmode@gnu.org; Wed, 19 Oct 2011 18:28:57 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:65361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGed5-0000UN-GL for emacs-orgmode@gnu.org; Wed, 19 Oct 2011 18:28:55 -0400 Received: by bkbzu5 with SMTP id zu5so3141592bkb.0 for ; Wed, 19 Oct 2011 15:28:54 -0700 (PDT) Content-Disposition: inline In-Reply-To: <6830.1319058741@alphaville.americas.hpqcorp.net> 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@gnu.org Hi Nick, Nick Dokos wrote: > The usual method is to run a separate emacs in batch mode: that will avoid any conflicts > with the running instance. But batch implies -q, so you will have to provide a minimal .emacs > file that sets up enough structure to enable you to do what you want: > > emacs --batch -l ~/minimal.emacs \ > --eval '(let ((org-confirm-babel-evaluate nil)) > (find-file "macports.org") > (org-export-as-html 3))' > > should do it. Thanks for your help. I got it running using a similar setup. One more question, it doesn't matter if I put the code in the file that is loaded via -l or in the --eval block, correct? I've included the code in the my org file, so I can tangle it. I find it better to have all the Emacs code in one location. Here's what I came up with: (add-to-list 'load-path (expand-file-name "~/unix/src/org-mode/lisp")) (add-to-list 'load-path (expand-file-name "~/unix/src/org-mode/contrib/lisp")) (require 'org) (require 'ob-sh) (require 'ansi-color) (let ((ansi-color-for-comint-mode nil) (org-confirm-babel-evaluate nil) (org-use-sub-superscripts nil)) (find-file "~/org/projects/macports/macports.org") (org-with-point-at (org-id-find "83583083-47B7-44DF-8474-1C6D03491C97" 'marker) (org-babel-execute-subtree)) (org-export-as-html t) (kill-buffer)) Thanks again, Viktor