This problem has been bugging people for years and previous attempts to solve 
it have always run up against creating more problems in the process of solving 
this one.

This workaround gives the same results with or without `:session "NEW"' and 
same as OPs first src block:

#+header: :prologue "capture.output({" :epilogue "})"
#+begin_src R :results value verbatim :session "NEW" 
print("<X> <Y> <!>")
print("one <two> three")
print("end")
#+end_src

If you do decide to dig into solving this, please be sure that remote sessions 
and graphical outputs are not broken.  test-ob-R.el does not cover those cases. 
 In fact, it is pretty short, so there are probably other things that could 
break without `make test' complaining.

HTH,

Chuck


> On Aug 29, 2020, at 12:24 AM, Jack Kamm <jackk...@gmail.com> wrote:
> 
> Hi Dylan,
> 
>> The patch does fix that issue -- but it introduces a different bug 
>> for code blocks with ~:session~: the R block now only produces 
>> output from the last statement evaluated.
> 
> Of course, you're right. Good catch.
> 
> Here's another attempt. It fixes the issue by modifying the R comint
> regular expression, requiring it to match at the beginning of the line.



Reply via email to