From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Batch mode evaluation of source code? Date: Fri, 17 Jun 2011 16:05:06 -0700 Message-ID: <871uysrrdp.fsf@gmail.com> References: <8762o4ruzv.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXi6D-00060z-JU for emacs-orgmode@gnu.org; Fri, 17 Jun 2011 19:05:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QXi6B-00078m-9Z for emacs-orgmode@gnu.org; Fri, 17 Jun 2011 19:05:13 -0400 Received: from mail-pv0-f169.google.com ([74.125.83.169]:41103) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QXi6A-00078b-Qh for emacs-orgmode@gnu.org; Fri, 17 Jun 2011 19:05:11 -0400 Received: by pvc12 with SMTP id 12so2792772pvc.0 for ; Fri, 17 Jun 2011 16:05:09 -0700 (PDT) In-Reply-To: (Herbert Sitz's message of "Fri, 17 Jun 2011 22:45:19 +0000 (UTC)") 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: Herbert Sitz Cc: emacs-orgmode@gnu.org Herbert Sitz writes: > Eric Schulte gmail.com> writes: > >> >> The following org-mode file and minimal elisp file can be used >> to print >> the results of evaluating a code block from a batch Emacs >> session >> (note >> this is using Emacs24, so Org-mode/Babel do not need to be >> explicitly >> loaded). >> >> I used the following command line >> : emacs --batch -l run-code.el 2> /dev/null >> > > Eric -- Thanks, very cool. I'm toying around with this approach to do dynamic > code-block evaluation in the Org-mode clone I'm making in Vim. No problem with > on-export-evaluation, since the vim-org-clone just saves the file and issues a > batch mode org-export or org-publish command to emacs, which takes over from > there. > > I think this dynamic evaluation could be useful, but it also seems like a new > server is getting called for each emacs --batch mode call. That's cumbersome > for this dynamic-evaluation stuff because of start-up overhead for emacs on > each call. Is that the way its supposed to work? > > I'm working on Windows7 and have an Emacs client running when I issue > the batch command, which I assumed also means there is a running emacs > server. Is the call getting made to the running emacs server? If so, > is there some way to avoid the startup overhead (which seems to come > from 'Adding c:/program files (x86)/emacs/EmacsW32/lisp/ to load > path.'). Or, if my batch call is _not_ making use of the running > Emacs server is there some way to get it to use that server? > > Thanks again, > The example I attached using "--batch" *does* startup a new Emacs instance on every execution. You should be able to replace the "emacs" command with "emacsclient" (or some windows equivalent) command to connect to a running server, rather than having to create a new connection on every evaluation. By connecting to a persistent Emacs instance much of the .el script I attached could be removed assuming Babel has already been configured in the running Emacs server. Hope this helps -- Eric > > Herb > > > -- Eric Schulte http://cs.unm.edu/~eschulte/