TODO Org-babel-notebook

  • State "TODO" from "" 2010-05-07 Fri 15:29

How to make it possible to use org-babel interactively from within an interactive terminal (read: notebook, REPL, shell, or comint buffer -- whatever name makes sense to you), rather than in it's current context of an Org-mode file.

This would require a number of new features…

  1. a nice interface
    • embedded images, and videos, or arbitrary x-windows (e.g. a screen make by gnuplot), maybe a generic
    • allow input of multi-line code segments – maybe related to language selection…
    • allow for switching the current language
    • possibly allow function definitions
    • possibly support some form of export (maybe should export to an org-mode buffer which would then export arbitrarily)
  1. a way to maintain a persistent environment, s.t. variables and functions can maintain a persistent value over the course of a session
  1. sage for example provides a base library of operations, which can be called outside of the use of any particular package. In the same way we should provide for calling basic operations directly without having to open up a code block, examples could be a generic means of graphing objects, simple arithmetic and matrix operations, file I/O, etc…

we should be able to use the existing lob and named code block functionality to define all of these primitives – probably using elisp as the preferred language for these code blocks.

  1. undoubtedly there is more…

Another popular notebook system is sage, maybe some inspiration can be drawn from there.

It could be nice to wrap up calc functions so that they can easily be called from this command line.

Hopefully there's a rational way to extend the existing Org-babel functionality into this sort of an interface without either adding too many ad-hoc features or writing too much code.

interface – Org-mode comint buffer

just to stream-of-consciouses for a moment.

how will this comint buffer look, and should it even be a comint buffer?

Increasingly since Org-babel is fully capable of handing back org-mode formatted text from any execution, I'm thinking that the interactive notebook should have Org-mode as it's major mode.

Then each execution (every time the user presses enter to send a line of code to the interpreter) could generate a new headline, and both the results and the related code could be placed under this headline.

In this way a series of executions at the "prompt" would result in a series of folded headlines above the prompt, with the latest headline always unfolded and immediately below the prompt. I think this could turn out to be a fairly natural interface.