* [babel] feature request: automatically connect source code block to its session
@ 2011-03-20 15:19 Andreas Leha
2011-03-23 3:00 ` Eric Schulte
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Leha @ 2011-03-20 15:19 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 768 bytes --]
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
[-- Attachment #1.2: andreas_leha.vcf --]
[-- Type: text/x-vcard, Size: 377 bytes --]
begin:vcard
fn:Andreas Leha
n:Leha;Andreas
org;quoted-printable:University Medicine G=C3=B6ttingen;Biostatistics/Bioinformatics (Dept. Medical Statistics)
adr;quoted-printable:;;Humboldallee 32;G=C3=B6ttingen;;37073;Germany
email;internet:andreas.leha@med.uni-goettingen.de
title:Dipl. Inf.
tel;work:+49 551 39-10710
tel;cell:+49 163 7662824
version:2.1
end:vcard
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 6432 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [babel] feature request: automatically connect source code block to its session
2011-03-20 15:19 [babel] feature request: automatically connect source code block to its session Andreas Leha
@ 2011-03-23 3:00 ` Eric Schulte
2011-03-25 13:17 ` Andreas Leha
0 siblings, 1 reply; 4+ messages in thread
From: Eric Schulte @ 2011-03-23 3:00 UTC (permalink / raw)
To: Andreas Leha; +Cc: emacs-orgmode
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 <andreas.leha@med.uni-goettingen.de> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [babel] feature request: automatically connect source code block to its session
2011-03-23 3:00 ` Eric Schulte
@ 2011-03-25 13:17 ` Andreas Leha
2011-04-02 17:48 ` Eric Schulte
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Leha @ 2011-03-25 13:17 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1722 bytes --]
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.
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 <andreas.leha@med.uni-goettingen.de> 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
>
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 6432 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [babel] feature request: automatically connect source code block to its session
2011-03-25 13:17 ` Andreas Leha
@ 2011-04-02 17:48 ` Eric Schulte
0 siblings, 0 replies; 4+ messages in thread
From: Eric Schulte @ 2011-04-02 17:48 UTC (permalink / raw)
To: Andreas Leha; +Cc: emacs-orgmode
Andreas Leha <andreas.leha@med.uni-goettingen.de> 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 <andreas.leha@med.uni-goettingen.de> 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
>>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-04-02 17:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-20 15:19 [babel] feature request: automatically connect source code block to its session Andreas Leha
2011-03-23 3:00 ` Eric Schulte
2011-03-25 13:17 ` Andreas Leha
2011-04-02 17:48 ` Eric Schulte
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.