From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Maxima session support Date: Thu, 07 Jul 2011 19:23:52 -0600 Message-ID: <87fwmh1rgb.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:41079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qf02O-0003MZ-JE for emacs-orgmode@gnu.org; Thu, 07 Jul 2011 21:39:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qf02N-0002hl-6u for emacs-orgmode@gnu.org; Thu, 07 Jul 2011 21:39:24 -0400 Received: from mail-iy0-f169.google.com ([209.85.210.169]:52191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qf02N-0002hb-2l for emacs-orgmode@gnu.org; Thu, 07 Jul 2011 21:39:23 -0400 Received: by iyl8 with SMTP id 8so1657742iyl.0 for ; Thu, 07 Jul 2011 18:39:21 -0700 (PDT) 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: Derek Thomas Cc: emacs-orgmode@gnu.org Hi Derek, Take a look at org-babel-execute:js in ob-js.el, it performs a check of the :session header argument, and then either performs external evaluation as currently implemented in org-babel-execute:maxima, or it performs session evaluation as you have described. Implementation may be as simple as passing the "body" of the code block to the `maxima-send-region' command and returning the results. Also, you may want to look at the contribution instructions on Worg [1], because if you are not able to sign the FSF copyright assignment papers we will not be able to include your contribution. Best of luck and let me know if I can help in any way -- Eric Derek Thomas writes: > I've been poking around in the ob-maxima.el and maxima.el files and I > believe that maxima.el provides the commands necessary to simulate > session support in org-babel. Unfortunately my elisp skills are > rudimentary and I don't know how to write a function that when called > by C-c C-c in the source block will pass each line of the source block > to the function maxima-send-region and insert the output into the > results portion of the org file using maxima-insert-last-output (both > of these functions are provided by maxima.el). If anyone can point me > in the right direction for a similar function that I can modify, or > can provide a commented example of how this would be done, that would > be great. Thanks, > > Derek > Footnotes: [1] http://orgmode.org/worg/org-contribute.html -- Eric Schulte http://cs.unm.edu/~eschulte/