How to save process threads when using source code blocks in org-mode's babel?

Mirko Vukovic <[email protected]> Mon, 4 Apr 2016 17:28:06 -0400
Newsgroups gmane.lisp.slime.devel
Message-ID <CAO73BAC1qLYQ1870NXLyDM6hNyj7OA1TBMJLPMo_Vq_ZTEep8A@mail.gmail.com>
Hello,

This is on Windows, on a several months old Slime.

I am using org-mode's babel with the lisp module to document a data
analysis project.

In one of the first code blocks I initialize a stream that communicates
with GNUPlot. Subsequent blocks (BEGIN_SRC...END_SRC) send plot commands,
one plot per code block.

In a slime session, I can generate multiple plots communicating with that
one stream.

But in the org-mode, after successfully creating the first plot, the
subsequent ones raise the error that the stream is private to a thread.  So
I have to restart GNUplot for each plot.

In a previous email exchange on the list (unrelated to org-mode) it was
pointed out that executing code via REPL in Slime uses a different thread
then executing code from a lisp buffer.  I assume something like that is
going on here as well.

So, is there a way for me to store the process thread which invoked
GNUplot, and use that one for execution of subsequent code blocks?

Thanks,

Mirko