From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Moynihan Subject: org-babel interpreter prompts Date: Wed, 10 Feb 2010 10:52:08 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NfABO-0000FQ-Nj for emacs-orgmode@gnu.org; Wed, 10 Feb 2010 05:52:34 -0500 Received: from [199.232.76.173] (port=45290 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NfABN-0000F3-Oh for emacs-orgmode@gnu.org; Wed, 10 Feb 2010 05:52:33 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NfABM-0005PF-Od for emacs-orgmode@gnu.org; Wed, 10 Feb 2010 05:52:33 -0500 Received: from mail-ew0-f228.google.com ([209.85.219.228]:58409) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NfABM-0005P7-EL for emacs-orgmode@gnu.org; Wed, 10 Feb 2010 05:52:32 -0500 Received: by ewy28 with SMTP id 28so4073234ewy.8 for ; Wed, 10 Feb 2010 02:52:31 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi all, I'm wondering if it's possible to get org-babel to output the interpreter prompts and sessions, as if each expression in the src block had been entered into the repl... e.g. something like: #+begin_src ruby :output repl 10 + 10 puts "hello world" [1,2,3,4,5,6,7,8,9,10].map do |i| i * i end #+end_src Yielding: #+results : irb(main):001:0> 10 + 10 : => 20 : irb(main):002:0> puts "Hello World" : Hello World : => nil : irb(main):003:0> [1,2,3,4,5,6,7,8,9,10].map do |i| : irb(main):004:1* i * i : irb(main):005:1> end : => [1, 4, 9, 16, 25, 36, 49, 64, 81, 100] : irb(main):006:0> The rational for this is that it lets you provide examples of being at the prompt and write better documentation. I'd imagine that in this mode, you wouldn't want the original src block to be rendered, rather just the output as if it had been run interactively. I'd personally find this useful and would like to see this for ruby, shell and clojure modes... Though it'd be nice to have it work for all the other languages and modes that support a REPL or interactive prompt too. -- Rick Moynihan http://twitter.com/RickMoynihan http://delicious.com/InkyHarmonics http://sourcesmouth.co.uk/