From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: BUG: emacs orgmode ob-R.el function org-babel-R-evaluate-session over aggressively performs "; ; cleanup extra prompts left in output" and a possible workaround Date: Sat, 7 Nov 2015 16:32:49 -0800 Message-ID: References: <2a1b8832412e49b7a0a4d231c3e289cf@exchsrv2.sgc.loc> <87mvusob7j.fsf@nicolasgoaziou.fr>, <3333fb4a-6541-4b80-b1b4-e7f6ff80ee83@email.android.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvDui-0007FQ-SS for emacs-orgmode@gnu.org; Sat, 07 Nov 2015 19:32:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZvDud-0001Tq-Sg for emacs-orgmode@gnu.org; Sat, 07 Nov 2015 19:32:56 -0500 Received: from iport-acv5-out.ucsd.edu ([132.239.0.10]:39064) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvDud-0001Tl-Js for emacs-orgmode@gnu.org; Sat, 07 Nov 2015 19:32:51 -0500 In-Reply-To: <3333fb4a-6541-4b80-b1b4-e7f6ff80ee83@email.android.com> 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: "Cook, Malcolm" Cc: "emacs-orgmode@gnu.org" On Sat, 7 Nov 2015, Cook, Malcolm wrote: > Thanks Chuck for setting this through. > [...] > > I've wondered if there is not a better way for Babel to share an > interactive session with the user. For instance, if we wanted to > support a new form of results processing on addition to value and > output.... Namely, "transcript", wherein the results of evaluating a > source block would be a transcript of the season with statements > interwoven with their respective outputs.... I suspect that this would > not be easy extension of the current approach since it would require > parsing the source into statements that get evaluated sequentially with > visible results echoed into the transcript. You can do stuff like this using babel and some R code. Here is a start: --8<---------------cut here---------------start------------->8--- #+NAME: my-block #+BEGIN_SRC R :eval no ls() a <- 1 sqrt(a+2) ls() #+END_SRC #+BEGIN_SRC R :session :noweb yes :results value raw :wrap example capture.output( source(textConnection(" <> "), echo=T,print=T)) #+END_SRC #+RESULTS: #+BEGIN_example > ls() [1] "a" > a <- 1 > sqrt(a+2) [1] 1.732051 > ls() [1] "a" #+END_example --8<---------------cut here---------------end--------------->8--- I suppose you would want `:exports results'. Best, Chuck