> On Aug 10, 2017, at 5:54 AM, Igor Sosa Mayor <joseleopoldo1...@gmail.com> > wrote: > > Hi, > > I have in an org file the following > > #+PROPERTY: header-args:R :session *R-cities* > > I open a R session, rename it to *R-cities*, open the org file. If I go > then to a babel block and send it to the R session with C-c C-c it is > sent to the right session. > > But: if I edit the block with org-edit-src-code (C-c '), then the source > buffer has no R-session attached and I'm asked which one I want to use. > > Is this maybe a small bug? >
If you have more than one session running, it is a consequence of ESS's handling of multiple sessions. This issue is closely related to the one in this longish thread: Subject: org babel, ess, R Date: Sat, 1 Jul 2017 07:06:43 +0530 Message-ID: <cafvt51kwv2oufb5nb4tssxz+rjdftb3drnkurfac4adirt0...@mail.gmail.com> Getting stuff like this to work seamlessly looks to be a good challenge. I notice that this function ,----[ C-h f org-babel-R-associate-session RET ] | org-babel-R-associate-session is a compiled Lisp function in | ‘ob-R.el’. | | (org-babel-R-associate-session SESSION) | | Associate R code buffer with an R session. | Make SESSION be the inferior ESS process associated with the | current code buffer. | | [back] `---- looks like it aims to do something like what is needed, but never got used. I suspect the author took a few steps in this direction and saw it was going to be a heavy lift and gave up. It isn't obvious to me how one would put a ruleset together that would work well across a variety of situations with multiple sessions. That is, you may want :session headers to be honored or ignored depending on circumstance. HTM, Chuck