From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Re: export of .org file from within a different .org file Date: Tue, 14 Sep 2010 12:17:51 +0200 Message-ID: <87lj744oj4.fsf@gmx.de> References: <4C8F4412.80106@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=36545 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OvSlw-0000nb-K6 for emacs-orgmode@gnu.org; Tue, 14 Sep 2010 06:29:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OvSaM-00010F-M1 for emacs-orgmode@gnu.org; Tue, 14 Sep 2010 06:17:59 -0400 Received: from mailout-de.gmx.net ([213.165.64.23]:44358 helo=mail.gmx.net) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OvSaM-0000zv-7Q for emacs-orgmode@gnu.org; Tue, 14 Sep 2010 06:17:58 -0400 In-Reply-To: <4C8F4412.80106@gmail.com> (Rainer M. Krug's message of "Tue, 14 Sep 2010 11:44:50 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rainer M Krug Cc: emacs-orgmode Rainer M Krug writes: > Hi > > I have an org file (report.org) which creates a report. > > Now I want to do a few things with the resulting report, before I create > it to run a simulation, and afterwards copy it into a directory with a > name linked to some parameter of the simulation. I am now using a > seperate .org file (sim.org) which essentially looks as follow: > > ---------------------- > * Simulate > #+begin_src R > ... > #+end_src > > * Create Report > #+begin_src sh :exports results > emacs --batch --visit=rep.sim.org > --execute='(org-export-as-html-and-open nil)' > #+end_src > > * Do some copying > #+begin_src sh > cp rep.sim.html DifferentName.html > ... > #+end_src > ---------------------- > > As you can see, I am using sh to do a task in emacs - which is quite > ridiculous, but I don't know how to do it in elisp. So: > > how can I translate > emacs --batch --visit=rep.sim.org > --execute='(org-export-as-html-and-open nil)' > > into elisp? Could be done better maybe, but this works: (let ((buf (find-file-noselect "~/path/to/file.org"))) (with-current-buffer buf (org-export-as-html-and-open nil) (kill-buffer buf))) Sebastian