[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] export of .org file from within a different .org file
From: |
Sebastian Rose |
Subject: |
Re: [Orgmode] export of .org file from within a different .org file |
Date: |
Tue, 14 Sep 2010 12:17:51 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Rainer M Krug <address@hidden> 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