From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: [PATCH] Babel: add results value support to Scala Date: Wed, 24 Oct 2012 15:09:20 +0200 Message-ID: <87y5iw3tkv.fsf@bzg.ath.cx> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:37340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TR0hp-0002Jv-Cd for emacs-orgmode@gnu.org; Wed, 24 Oct 2012 09:09:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TR0hk-0005je-93 for emacs-orgmode@gnu.org; Wed, 24 Oct 2012 09:09:09 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:60801) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TR0hk-0005jV-2t for emacs-orgmode@gnu.org; Wed, 24 Oct 2012 09:09:04 -0400 Received: by mail-wi0-f171.google.com with SMTP id hj13so3645449wib.12 for ; Wed, 24 Oct 2012 06:09:02 -0700 (PDT) In-Reply-To: (asrail@gmail.com's message of "Mon, 15 Oct 2012 16:39:08 -0300") 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: Andrzej Lichnerowicz Cc: emacs-orgmode@gnu.org, Asrail --=-=-= Content-Type: text/plain Hi Andrzej, Asrail posted this patch against ob-scala.el a while ago. Can you confirm it is okay to apply it? I'm reattaching the patch in case you are not reading the Orgmode mailing list anymore. Thanks in advance! Asrail writes: > * lisp/ob-scala.el (org-babel-scala-wrapper-method): Use an scala > block enclosing the submitted code --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Babel-add-results-value-support-to-Scala.patch >From 0d7b1b3e7e5d63a77a1fe47cee80fd7f7bcb4cce Mon Sep 17 00:00:00 2001 From: Caio Tiago Oliveira Date: Mon, 15 Oct 2012 15:52:50 -0300 Subject: [PATCH] Babel: add results value support to Scala * lisp/ob-scala.el (org-babel-scala-wrapper-method): Use an scala block enclosing the submitted code The string representing an well formed block was not an Scala code. I put the string from the user into an block, surrounded by an call to replace the default output stream. TINYCHANGE --- lisp/ob-scala.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lisp/ob-scala.el b/lisp/ob-scala.el index bd855a8..ea3c3f2 100644 --- a/lisp/ob-scala.el +++ b/lisp/ob-scala.el @@ -72,9 +72,17 @@ Emacs-lisp table, otherwise return the results as a string." (defvar org-babel-scala-wrapper-method - "( + +"var str_result :String = null; + +Console.withOut(new java.io.OutputStream() {def write(b: Int){ +}}) { + str_result = { %s -) asString print + }.toString +} + +print(str_result) ") -- 1.7.10.4 --=-=-= Content-Type: text/plain -- Bastien --=-=-=--