From mboxrd@z Thu Jan 1 00:00:00 1970 From: Viktor Rosenfeld Subject: Export an org file from the command line in the background Date: Wed, 19 Oct 2011 18:21:46 +0200 Message-ID: <20111019162146.GA24998@client199-154.wlan.hu-berlin.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="+HP7ph2BbKc20aGI" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:43791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGYtw-00014h-R9 for emacs-orgmode@gnu.org; Wed, 19 Oct 2011 12:22:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGYtr-0001ua-4z for emacs-orgmode@gnu.org; Wed, 19 Oct 2011 12:21:56 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:53455) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGYtq-0001uR-Ok for emacs-orgmode@gnu.org; Wed, 19 Oct 2011 12:21:51 -0400 Received: by bkbzu5 with SMTP id zu5so2750363bkb.0 for ; Wed, 19 Oct 2011 09:21:49 -0700 (PDT) Content-Disposition: inline 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 --+HP7ph2BbKc20aGI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, is it possible to export an org file from the command line, so that a currently running Emacs instance is not disturbed? I want to export the attached org file and run the included source blocks, so I have an activity report in the end. I use the shell script pasted below, but there are two problems: - my Emacs instance is blocked during the execution of the shell scripts contained in the file - the script globally sets org-confirm-babel-evaluate to nil for my Emacs instance The second problem could possibly be solved with a local file variable. But the first problem remains. If I use emacs instead of emacsclient, it complains about a running Emacs instance. #!/bin/sh emacsclient -c \ --eval "(progn (find-file \"macports.org\")) (setq org-confirm-babel-evaluate nil) (org-export-as-html 3) (kill-buffer) (delete-frame))" I'm using Org-Mode 7.7. Cheers, Viktor --+HP7ph2BbKc20aGI Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="macports.org" #+TITLE: MacPorts Update Report * Helper functions :noexport: ** Set up =$PATH= environment Set up =$PATH=: #+begin_src sh :session port-update :results silent PATH=$PATH:/opt/local/bin #+end_src ** Table Header for the list of outdated ports #+begin_src sh :session port-update :results silent print_outdated_header() { echo \|Port\|Installed\|Available\| echo "|--|" } #+end_src ** Format each row of =port outdated= as table entry #+begin_src sh :session port-update :results silent format_port_outdated() { awk '{print "|" $1 "|" $2 "|" $4 "|"}' } #+end_src * Outdated ports The following ports are outdated: #+begin_src sh :session port-update :results output raw :exports results print_outdated_header port -q outdated | format_port_outdated #+end_src The following outdated ports are requested: #+begin_src sh :session port-update :results output raw :exports results print_outdated_header port -q outdated and requested | format_port_outdated #+end_src * Update log #+begin_src sh :session port-update :exports results :results verbatim for i in 1 2 3 4 5 6 7 8 9 0; do echo "."; done #+end_src --+HP7ph2BbKc20aGI--