From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [babel] feature request: automatically connect source code block to its session Date: Sat, 02 Apr 2011 11:48:51 -0600 Message-ID: <87mxk8v918.fsf@gmail.com> References: <4D861AEF.2040806@med.uni-goettingen.de> <87ei5ya672.fsf@gmail.com> <4D8C95F6.5040304@med.uni-goettingen.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=33475 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q64wW-0000de-E4 for emacs-orgmode@gnu.org; Sat, 02 Apr 2011 13:49:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q64wU-0006NA-Vm for emacs-orgmode@gnu.org; Sat, 02 Apr 2011 13:49:00 -0400 Received: from mail-iw0-f169.google.com ([209.85.214.169]:55445) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q64wU-0006N3-NO for emacs-orgmode@gnu.org; Sat, 02 Apr 2011 13:48:58 -0400 Received: by iwg8 with SMTP id 8so5819122iwg.0 for ; Sat, 02 Apr 2011 10:48:58 -0700 (PDT) In-Reply-To: <4D8C95F6.5040304@med.uni-goettingen.de> (Andreas Leha's message of "Fri, 25 Mar 2011 14:17:42 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Andreas Leha Cc: emacs-orgmode@gnu.org Andreas Leha writes: > Hi Eric, > > thanks for looking into this! > > Unfortunately, I do not know the setup here. But I asked on the ess > mailing list and got an answer from Stephen Eglen: > > "I think you want to set ess-local-process-name given by the :session > argument in the .org buffer when the temp buffer is opened by C-c '." > > I hope that is the information you need. > I opened up a example.R buffer, evaluated some code, and a session named "*R*" was created and the value of `ess-local-process-name' was set to "R", so I've just pushed up a patch which will set the value of `ess-local-process-name' to "something" if the value of the :session header is "*something*", it will also start the session if none exists. Please let me know if this give the desired result. If not, then could you point me to an ESS feature which uses the associated session which I could use locally to test? Note also, that this patch adds a general facility through which any language can prep an org edit src buffer through the definition of a org-babel-edit-prep:lang function, which will be passed the full info list for the code block. If there are any other languages which would benefit from edit-buffer initialization it should now be a simple task to implement such initialization. Thanks -- Eric > > Regards, > Andreas > > > > > > > Am 23.03.2011 04:00, schrieb Eric Schulte: >> This seems reasonable, >> >> Do you know how ESS associates a code buffer with a session (i.e. is >> there some buffer-local variable which holds the session name)? >> >> With this information in hand it shouldn't be difficult to expand the >> C-' behavior for R s.t. it automatically associates the resulting >> Org-Src buffer with the proper R session. >> >> Good idea. Best -- Eric >> >> Andreas Leha writes: >> >>> Hi all, >>> >>> I have a feature request (if what I want is not already possible, that is). >>> >>> Could a source code block, which has the :session header argument, be >>> associated with its session as soon as C-' is pressed? >>> >>> The background to this question is, that all ess support functionality >>> for R (r-autoyas, autocomplete-R, and ess-eldoc) need an associated R >>> session. They start to function only as soon as the first line of the >>> code block is evaluated, which associates the source buffer with its >>> session. >>> The autocomplete-R even fails to load without an associated R session >>> (byte-code: Language mode `R-mode' fails with: "Symbol nil may not be >>> buffer-local") >>> and this way cuts the connection to org, such that C-' becomes undefined. >>> >>> Regards, >>> Andreas >>