emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Herbert Sitz <hsitz@nwlink.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Batch mode evaluation of source code?
Date: Fri, 17 Jun 2011 16:05:06 -0700	[thread overview]
Message-ID: <871uysrrdp.fsf@gmail.com> (raw)
In-Reply-To: <loom.20110618T003216-855@post.gmane.org> (Herbert Sitz's message of "Fri, 17 Jun 2011 22:45:19 +0000 (UTC)")

Herbert Sitz <hsitz@nwlink.com> writes:

> Eric Schulte <schulte.eric <at> 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/

  parent reply	other threads:[~2011-06-17 23:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-17 21:14 Batch mode evaluation of source code? Herbert Sitz
2011-06-17 21:47 ` Eric Schulte
2011-06-17 22:45   ` Herbert Sitz
2011-06-17 22:55     ` Herbert Sitz
2011-06-17 23:02       ` Nick Dokos
2011-06-17 23:10         ` Herbert Sitz
2011-06-17 23:05     ` Eric Schulte [this message]
2011-06-18  0:17       ` Herbert Sitz
2011-06-18  7:32     ` Achim Gratz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871uysrrdp.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=hsitz@nwlink.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).