From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: org babel, ess, R Date: Wed, 5 Jul 2017 16:58:00 -0500 Message-ID: References: <87mv8o2u9b.fsf@nicolasgoaziou.fr> <3295F295-A14A-43EA-8752-53D1BEBCC31A@agrarianresearch.org> <87fuef1fov.fsf@nicolasgoaziou.fr> <829AC437-872D-453D-8543-B3C147F08B54@agrarianresearch.org> <87inj660la.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSsJA-0000MP-IF for emacs-orgmode@gnu.org; Wed, 05 Jul 2017 17:58:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSsJ9-0006I5-J7 for emacs-orgmode@gnu.org; Wed, 05 Jul 2017 17:58:04 -0400 Received: from mail-it0-x231.google.com ([2607:f8b0:4001:c0b::231]:36402) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSsJ9-0006HA-Dr for emacs-orgmode@gnu.org; Wed, 05 Jul 2017 17:58:03 -0400 Received: by mail-it0-x231.google.com with SMTP id m68so125124095ith.1 for ; Wed, 05 Jul 2017 14:58:01 -0700 (PDT) In-Reply-To: <87inj660la.fsf@nicolasgoaziou.fr> 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" To: Nicolas Goaziou Cc: org-mode mailing list , Vikas Rawal On Wed, Jul 5, 2017 at 4:22 PM, Nicolas Goaziou wrote: > Hello, > > Vikas Rawal writes: > >> C-RET seems to be picking up the custom session name if it is already >> there. But otherwise it generates the default *R* session there, > > Is there a bug to fix? If so, could start a new thread about it, ideally > with an ECM demonstrating the issue? I guess Vikas can speak for Vikas, but he was responding to my observation of the same: "... I'd like Org to pick up the fact that there's a :session argument with a custom name and use that for C-RET in the edit buffer; otherwise it generates the default *R* session there, but if you C-c C-c the block later it puts it into the custom session name." Here's an ECM: #+begin_example * heading #+name: x #+begin_src R :session r x <- 1:10 #+end_src #+name: y #+begin_src R :session r y <- x^2 #+end_src #+end_example So, say I start working on a document for the day and enter the editing buffer with C-c ' on block x. I then C-RET from the edit buffer, which evaluates x and starts a new R session, *R*. Now I'm done and go on to block y, but don't need to edit. Maybe I just want to update a plot or other result in the document, so I C-c C-c: Error: object 'x' not found This really, really common for my work. I define a setup block somewhere in which I load libraries, read in thousands of lines of sensor code, and process things (moving averages, summary stats, etc.) and create my sort of "master object." From there I have sections of a report that subset the data, plot various things, but typically have them all set to :eval no by default. If I pick up work on a file, edit my setup code block, but only interactively because I forget I need to C-c C-c something first to kick off the custom session, the work was sort of for naught as everything is in the wrong session. In this example, I realize the error and go back to block x and C-c C-c after failing on block y. At that point, when I go to a block interactively to do C-RET again, I get this in the minibuffer. Process to load into: {r | *R* | *new* } Then I switch to *R* to quit() and end the spurious session. Really, it was a comment about how Org behaves, not necessarily a bug. That said, speaking for myself, I would never want a default session in interactive mode when I've defined one in the code heading. I'd love if Org could pick up on that setting, such that the first C-RET of the day dropped into the session named by the block I'm editing. At present, interactive mode appears to ignore this. Hope that helps clarify, John > Regards, > > -- > Nicolas Goaziou