emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Cook, Malcolm" <MEC@stowers.org>
To: "'Charles C. Berry'" <ccberry@ucsd.edu>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
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: Thu, 1 Oct 2015 23:15:03 +0000	[thread overview]
Message-ID: <2a1b8832412e49b7a0a4d231c3e289cf@exchsrv2.sgc.loc> (raw)
In-Reply-To: <alpine.OSX.2.20.1510011443090.1095@charles-berrys-macbook.local>

> > I am not sure what the best solution is, but, in my hands using
 > > Org-mode version 8.3.2-elpa org-20150929 the reg-expt used to "cleanup
 > > extra prompts left in output" is over-aggressive and will trim session
 > > :output at lines consisting exclusively of blanks and periods such as
 > > produced when printing a BioConductor 'Views' object which wants to
 > > appear as
 > 
 > I'd try (for example):
 > 
 > #+BEGIN_SRC R :results value raw drawer :session
 > require(GenomicRanges)
 > capture.output(show(GRanges(seqnames=rep("a",100),
 >  	IRanges(start=1:100,width=1),strand=rep("*",100))))
 > #+END_SRC

Thanks for the thought, but, I'm trying to engage in "literate programming" for which in my opinion I should not have to re-write my code (using capture.output and show) to get the output of evaluation captured.

We're I to sweave my code I would get all this un-wanted cruft.

I think org-bable-R-evaluate-FOO should be handling all this for us.

 > rather than messing with the regexp.

Hmm.... not sure I understand your preference here.   I'm providing an example of some that should "just work", but does not.   I too prefer not to mess with the regexp other than to identify it as the source of the issue.  Perhaps the "real solution" is to recode org-bable-R-evaluate-FOO.

> > I offer as a possible workaround the following:
 > >
 > > So far, I have had good success having removed provision for allowing
 > leading whitespace by changing the regexp  org-babel-R-evaluate-session
 > from
 > >      "^\\([ ]*[>+\\.][ ]?\\)+\\([[0-9]+\\|[ ]\\)"
 > > to
 > >      "^\\([>+\\.][ ]?\\)+\\([[0-9]+\\|[ ]\\)"
 > >
 > > But I don't know all the test cases so, YMMV....
 > 
 > Just guessing that the things that `(setq ess-eval-visibly nil)' generates (e.g., +
 > + + + + > ) won't behave using your version.
 > 

In fact it does behave.  I tried it.  I think that ess-eval-visibly effects how ob-R interacts with the ess session.

 > HTH,

I wish it did.... ;)  Thanks for your efforts.

 > 
 > Chuck

  reply	other threads:[~2015-10-01 23:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-01 19:59 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 Cook, Malcolm
2015-10-01 21:56 ` Charles C. Berry
2015-10-01 23:15   ` Cook, Malcolm [this message]
2015-10-08 19:24     ` Charles C. Berry
2015-10-08 20:41       ` Cook, Malcolm
2015-11-05 12:57       ` Nicolas Goaziou
2015-11-06 23:11         ` Charles C. Berry
2015-11-07 21:30         ` Charles C. Berry
2015-11-07 21:41           ` Nicolas Goaziou
2015-11-07 23:22           ` Cook, Malcolm
2015-11-08  0:32             ` Charles C. Berry
2015-11-09 20:04               ` Cook, Malcolm
2015-11-09 20:56                 ` Charles C. Berry
2015-11-09 22:11                   ` Cook, Malcolm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2a1b8832412e49b7a0a4d231c3e289cf@exchsrv2.sgc.loc \
    --to=mec@stowers.org \
    --cc=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).