emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Maxima session support
@ 2011-07-06 22:14 Derek Thomas
  2011-07-08  1:23 ` Eric Schulte
  0 siblings, 1 reply; 2+ messages in thread
From: Derek Thomas @ 2011-07-06 22:14 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Maxima session support
  2011-07-06 22:14 Maxima session support Derek Thomas
@ 2011-07-08  1:23 ` Eric Schulte
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2011-07-08  1:23 UTC (permalink / raw)
  To: Derek Thomas; +Cc: emacs-orgmode

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 <derekcthomas@gmail.com> 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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-08  1:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-06 22:14 Maxima session support Derek Thomas
2011-07-08  1:23 ` Eric Schulte

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).