From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Cook, Malcolm" 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: Mon, 9 Nov 2015 22:11:21 +0000 Message-ID: <324bb77c7e75435c83192c43dda6c375@exchsrv2.sgc.loc> References: <2a1b8832412e49b7a0a4d231c3e289cf@exchsrv2.sgc.loc> <87mvusob7j.fsf@nicolasgoaziou.fr>, <3333fb4a-6541-4b80-b1b4-e7f6ff80ee83@email.android.com> <39f0e21eec95434b95514837a7ccb71f@exchsrv2.sgc.loc> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zvuet-0003z4-HX for emacs-orgmode@gnu.org; Mon, 09 Nov 2015 17:11:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zvueq-00063Y-66 for emacs-orgmode@gnu.org; Mon, 09 Nov 2015 17:11:27 -0500 Received: from smtp01.stowers.org ([40.141.174.61]:40892) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zvuep-000636-VS for emacs-orgmode@gnu.org; Mon, 09 Nov 2015 17:11:24 -0500 In-Reply-To: Content-Language: en-US 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: "'Charles C. Berry'" Cc: "emacs-orgmode@gnu.org" > [...] > > > > > > > [...] > > > > > > > > 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 w= ould > > > > not be easy extension of the current approach since it would requi= re > > > > 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: > > > >=20 > [snip] >=20 > > Sourcing a textConnection on a :noweb interpolated block will not > > handle embedded quotes in the source block correctly. Adding an > > assignment of a string to a variable in my-block reveals this > > (i.e. `b<-"asdf"`) >=20 > I know. That is why I said it is a 'start'. You can work around this > with more Babel if that is the only issue. Write a src block `good-fmt' > that will render the body of another block as you want it and then use > <> to insert it. >=20 >=20 > > Nor does it extend to my underspecified conception of what > > :transcript output would be. I intended that :transcript would > > generate a colorized source blocks separated by results for > > statements which generated visible results. You implementation makes > > the source and results undifferentiated. My mistake for > > underspecifying my intention. I think I might be able to cobble what > > I want using the 'evaluate' package > > (https://cran.rstudio.com/web/packages/evaluate/evaluate.pdf) with an > > output handler to format source as an R code block and results as R > > results block. >=20 > See Aaron Ecay's patches from around 08/2014. And discussions on this > list from about that time. He had some of this working, but there > were some issues about handling remote calls, IIRC. >=20 > > Probably not worth the effort. Or rather, probably > > already done within the knitr/rmarkdown. >=20 > By default knitr interlaces the code and output in a frame with > the output lines prefixed by '##'. The code is highlighted by default. >=20 > In *.Rnw this leads to a single block with a background color and > colorized code. >=20 > In *.Rhtml you get source code blocks colored per
> and results blocks uncolored per
. >=20 > Using *.org via ox-ravel --> *.Rhtml via knitr --> *.html will get you > that far. >=20 Indeed it does. I have previously used ox-ravel to superb effect allowing = me to compose R lessons as *.org and distribute as *.Rmd for use within RSt= udio server. I must remember to remember this option! > Maybe customizing the classes to your taste will finish it. >=20 > Best, >=20 > Chuck >=20 > p.s. If you go with ox-ravel, I recommend the ravel-lang branch: > https://github.com/chasberry/orgmode-accessories/tree/ravel-lang=09