Rainer M Krug <r.m.k...@gmail.com> 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 _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode