* How to end a :session?
@ 2015-05-28 8:44 Rainer M Krug
2015-05-28 10:07 ` Christopher Witte
0 siblings, 1 reply; 9+ messages in thread
From: Rainer M Krug @ 2015-05-28 8:44 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1600 bytes --]
Hi
I can start a session as follow:
--8<---------------cut here---------------start------------->8---
#+begin_src R :session Test
cat("Session Test\n")
#+end_src
--8<---------------cut here---------------end--------------->8---
Now I hava an R session named *Test*. But how can I closes this session?
I thought about just quitting R
--8<---------------cut here---------------start------------->8---
#+begin_src R :session Test
q(save = "no)
#+end_src
--8<---------------cut here---------------end--------------->8---
but this does not return as ESS is waiting for the prompt (">").
Is there a way of closing the session *Test* and close the buffer?
My reasoning is that I want to do different longer analysis in one org
file and start each in its own session, i.e. clean R. But as they
involve several steps, I don't want to put them into one code block.
So I have several code blocks which I want to execute in a "throw away
session" which I would like to discard afterwards.
So I am looking for something like
#+CLOSE_SESSION Test
which would then close the session *Test*
Is something like this possible at the moment?
Rainer
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)
Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa
Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44
Fax (D): +49 - (0)3 21 21 25 22 44
email: Rainer@krugs.de
Skype: RMkrug
PGP: 0x0F52F982
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How to end a :session?
2015-05-28 8:44 How to end a :session? Rainer M Krug
@ 2015-05-28 10:07 ` Christopher Witte
2015-05-28 10:09 ` Rainer M Krug
0 siblings, 1 reply; 9+ messages in thread
From: Christopher Witte @ 2015-05-28 10:07 UTC (permalink / raw)
To: Rainer M Krug; +Cc: Org Mode
[-- Attachment #1: Type: text/plain, Size: 1792 bytes --]
perhaps what you want is a named session, see
http://orgmode.org/manual/session.html
On 28 May 2015 at 10:44, Rainer M Krug <Rainer@krugs.de> wrote:
> Hi
>
> I can start a session as follow:
>
> --8<---------------cut here---------------start------------->8---
> #+begin_src R :session Test
> cat("Session Test\n")
> #+end_src
> --8<---------------cut here---------------end--------------->8---
>
> Now I hava an R session named *Test*. But how can I closes this session?
> I thought about just quitting R
>
> --8<---------------cut here---------------start------------->8---
> #+begin_src R :session Test
> q(save = "no)
> #+end_src
> --8<---------------cut here---------------end--------------->8---
>
> but this does not return as ESS is waiting for the prompt (">").
>
> Is there a way of closing the session *Test* and close the buffer?
>
> My reasoning is that I want to do different longer analysis in one org
> file and start each in its own session, i.e. clean R. But as they
> involve several steps, I don't want to put them into one code block.
>
> So I have several code blocks which I want to execute in a "throw away
> session" which I would like to discard afterwards.
>
> So I am looking for something like
>
> #+CLOSE_SESSION Test
>
> which would then close the session *Test*
>
> Is something like this possible at the moment?
>
> Rainer
>
> --
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
> Biology, UCT), Dipl. Phys. (Germany)
>
> Centre of Excellence for Invasion Biology
> Stellenbosch University
> South Africa
>
> Tel : +33 - (0)9 53 10 27 44
> Cell: +33 - (0)6 85 62 59 98
> Fax : +33 - (0)9 58 10 27 44
>
> Fax (D): +49 - (0)3 21 21 25 22 44
>
> email: Rainer@krugs.de
>
> Skype: RMkrug
>
> PGP: 0x0F52F982
>
[-- Attachment #2: Type: text/html, Size: 2779 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How to end a :session?
2015-05-28 10:07 ` Christopher Witte
@ 2015-05-28 10:09 ` Rainer M Krug
2015-05-28 10:31 ` Andreas Leha
0 siblings, 1 reply; 9+ messages in thread
From: Rainer M Krug @ 2015-05-28 10:09 UTC (permalink / raw)
To: Christopher Witte; +Cc: Org Mode
[-- Attachment #1: Type: text/plain, Size: 2578 bytes --]
Christopher Witte <chris@witte.net.au> writes:
> perhaps what you want is a named session, see
> http://orgmode.org/manual/session.html
Sure - that's what I have.
But how can I close the named session when I don't need it anymore, or
want to start, the next time I use the named session, with a new
session?
>
> On 28 May 2015 at 10:44, Rainer M Krug <Rainer@krugs.de> wrote:
>
>> Hi
>>
>> I can start a session as follow:
>>
>> --8<---------------cut here---------------start------------->8---
>> #+begin_src R :session Test
>> cat("Session Test\n")
>> #+end_src
>> --8<---------------cut here---------------end--------------->8---
>>
>> Now I hava an R session named *Test*. But how can I closes this session?
>> I thought about just quitting R
>>
>> --8<---------------cut here---------------start------------->8---
>> #+begin_src R :session Test
>> q(save = "no)
>> #+end_src
>> --8<---------------cut here---------------end--------------->8---
>>
>> but this does not return as ESS is waiting for the prompt (">").
>>
>> Is there a way of closing the session *Test* and close the buffer?
>>
>> My reasoning is that I want to do different longer analysis in one org
>> file and start each in its own session, i.e. clean R. But as they
>> involve several steps, I don't want to put them into one code block.
>>
>> So I have several code blocks which I want to execute in a "throw away
>> session" which I would like to discard afterwards.
>>
>> So I am looking for something like
>>
>> #+CLOSE_SESSION Test
>>
>> which would then close the session *Test*
>>
>> Is something like this possible at the moment?
>>
>> Rainer
>>
>> --
>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
>> Biology, UCT), Dipl. Phys. (Germany)
>>
>> Centre of Excellence for Invasion Biology
>> Stellenbosch University
>> South Africa
>>
>> Tel : +33 - (0)9 53 10 27 44
>> Cell: +33 - (0)6 85 62 59 98
>> Fax : +33 - (0)9 58 10 27 44
>>
>> Fax (D): +49 - (0)3 21 21 25 22 44
>>
>> email: Rainer@krugs.de
>>
>> Skype: RMkrug
>>
>> PGP: 0x0F52F982
>>
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)
Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa
Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44
Fax (D): +49 - (0)3 21 21 25 22 44
email: Rainer@krugs.de
Skype: RMkrug
PGP: 0x0F52F982
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How to end a :session?
2015-05-28 10:09 ` Rainer M Krug
@ 2015-05-28 10:31 ` Andreas Leha
2015-05-28 11:09 ` Rainer M Krug
0 siblings, 1 reply; 9+ messages in thread
From: Andreas Leha @ 2015-05-28 10:31 UTC (permalink / raw)
To: emacs-orgmode
Hi Rainer,
Rainer M Krug <Rainer@krugs.de> writes:
> Christopher Witte <chris@witte.net.au> writes:
>
>> perhaps what you want is a named session, see
>> http://orgmode.org/manual/session.html
>
> Sure - that's what I have.
>
> But how can I close the named session when I don't need it anymore, or
> want to start, the next time I use the named session, with a new
> session?
>
>
>>
>> On 28 May 2015 at 10:44, Rainer M Krug <Rainer@krugs.de> wrote:
>>
>>> Hi
>>>
>>> I can start a session as follow:
>>>
>>> --8<---------------cut here---------------start------------->8---
>>> #+begin_src R :session Test
>>> cat("Session Test\n")
>>> #+end_src
>>> --8<---------------cut here---------------end--------------->8---
>>>
>>> Now I hava an R session named *Test*. But how can I closes this session?
>>> I thought about just quitting R
>>>
>>> --8<---------------cut here---------------start------------->8---
>>> #+begin_src R :session Test
>>> q(save = "no)
>>> #+end_src
>>> --8<---------------cut here---------------end--------------->8---
>>>
>>> but this does not return as ESS is waiting for the prompt (">").
>>>
>>> Is there a way of closing the session *Test* and close the buffer?
>>>
>>> My reasoning is that I want to do different longer analysis in one org
>>> file and start each in its own session, i.e. clean R. But as they
>>> involve several steps, I don't want to put them into one code block.
>>>
>>> So I have several code blocks which I want to execute in a "throw away
>>> session" which I would like to discard afterwards.
>>>
>>> So I am looking for something like
>>>
>>> #+CLOSE_SESSION Test
>>>
>>> which would then close the session *Test*
>>>
>>> Is something like this possible at the moment?
>>>
How about
--8<---------------cut here---------------start------------->8---
#+name: killRsession
#+begin_src emacs-lisp :var rsession="*myR*" :results none
(progn
(switch-to-buffer rsession)
(ess-quit)
(sleep-for 1)
(kill-buffer))
#+end_src
#+call: killRsession("*myR*") :results none
--8<---------------cut here---------------end--------------->8---
Andreas
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How to end a :session?
2015-05-28 10:31 ` Andreas Leha
@ 2015-05-28 11:09 ` Rainer M Krug
2015-05-28 11:46 ` Andreas Leha
0 siblings, 1 reply; 9+ messages in thread
From: Rainer M Krug @ 2015-05-28 11:09 UTC (permalink / raw)
To: Andreas Leha; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 2826 bytes --]
Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
> Hi Rainer,
Hi Andreas,
>
> Rainer M Krug <Rainer@krugs.de> writes:
>> Christopher Witte <chris@witte.net.au> writes:
>>
>>> perhaps what you want is a named session, see
>>> http://orgmode.org/manual/session.html
>>
>> Sure - that's what I have.
>>
>> But how can I close the named session when I don't need it anymore, or
>> want to start, the next time I use the named session, with a new
>> session?
>>
>>
>>>
>>> On 28 May 2015 at 10:44, Rainer M Krug <Rainer@krugs.de> wrote:
>>>
>>>> Hi
>>>>
>>>> I can start a session as follow:
>>>>
>>>> --8<---------------cut here---------------start------------->8---
>>>> #+begin_src R :session Test
>>>> cat("Session Test\n")
>>>> #+end_src
>>>> --8<---------------cut here---------------end--------------->8---
>>>>
>>>> Now I hava an R session named *Test*. But how can I closes this session?
>>>> I thought about just quitting R
>>>>
>>>> --8<---------------cut here---------------start------------->8---
>>>> #+begin_src R :session Test
>>>> q(save = "no)
>>>> #+end_src
>>>> --8<---------------cut here---------------end--------------->8---
>>>>
>>>> but this does not return as ESS is waiting for the prompt (">").
>>>>
>>>> Is there a way of closing the session *Test* and close the buffer?
>>>>
>>>> My reasoning is that I want to do different longer analysis in one org
>>>> file and start each in its own session, i.e. clean R. But as they
>>>> involve several steps, I don't want to put them into one code block.
>>>>
>>>> So I have several code blocks which I want to execute in a "throw away
>>>> session" which I would like to discard afterwards.
>>>>
>>>> So I am looking for something like
>>>>
>>>> #+CLOSE_SESSION Test
>>>>
>>>> which would then close the session *Test*
>>>>
>>>> Is something like this possible at the moment?
>>>>
>
> How about
>
> #+name: killRsession
> #+begin_src emacs-lisp :var rsession="*myR*" :results none
> (progn
> (switch-to-buffer rsession)
> (ess-quit)
> (sleep-for 1)
> (kill-buffer))
> #+end_src
>
>
> #+call: killRsession("*myR*") :results none
Thanks - this works. But I get an error which says:
,----
| save-excursion: Wrong type argument: integer-or-marker-p, nil
`----
Any suggestion on how to avoid this?
Thanks,
Rainer
>
> Andreas
>
>
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)
Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa
Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44
Fax (D): +49 - (0)3 21 21 25 22 44
email: Rainer@krugs.de
Skype: RMkrug
PGP: 0x0F52F982
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How to end a :session?
2015-05-28 11:09 ` Rainer M Krug
@ 2015-05-28 11:46 ` Andreas Leha
2015-05-28 12:00 ` Rainer M Krug
0 siblings, 1 reply; 9+ messages in thread
From: Andreas Leha @ 2015-05-28 11:46 UTC (permalink / raw)
To: emacs-orgmode
Hi Rainer,
Rainer M Krug <Rainer@krugs.de> writes:
> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>
>> Hi Rainer,
>
> Hi Andreas,
>
>>
>> Rainer M Krug <Rainer@krugs.de> writes:
>>> Christopher Witte <chris@witte.net.au> writes:
>>>
>>>> perhaps what you want is a named session, see
>>>> http://orgmode.org/manual/session.html
>>>
>>> Sure - that's what I have.
>>>
>>> But how can I close the named session when I don't need it anymore, or
>>> want to start, the next time I use the named session, with a new
>>> session?
>>>
>>>
>>>>
>>>> On 28 May 2015 at 10:44, Rainer M Krug <Rainer@krugs.de> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> I can start a session as follow:
>>>>>
>>>>> --8<---------------cut here---------------start------------->8---
>>>>> #+begin_src R :session Test
>>>>> cat("Session Test\n")
>>>>> #+end_src
>>>>> --8<---------------cut here---------------end--------------->8---
>>>>>
>>>>> Now I hava an R session named *Test*. But how can I closes this session?
>>>>> I thought about just quitting R
>>>>>
>>>>> --8<---------------cut here---------------start------------->8---
>>>>> #+begin_src R :session Test
>>>>> q(save = "no)
>>>>> #+end_src
>>>>> --8<---------------cut here---------------end--------------->8---
>>>>>
>>>>> but this does not return as ESS is waiting for the prompt (">").
>>>>>
>>>>> Is there a way of closing the session *Test* and close the buffer?
>>>>>
>>>>> My reasoning is that I want to do different longer analysis in one org
>>>>> file and start each in its own session, i.e. clean R. But as they
>>>>> involve several steps, I don't want to put them into one code block.
>>>>>
>>>>> So I have several code blocks which I want to execute in a "throw away
>>>>> session" which I would like to discard afterwards.
>>>>>
>>>>> So I am looking for something like
>>>>>
>>>>> #+CLOSE_SESSION Test
>>>>>
>>>>> which would then close the session *Test*
>>>>>
>>>>> Is something like this possible at the moment?
>>>>>
>>
>> How about
>>
>> #+name: killRsession
>> #+begin_src emacs-lisp :var rsession="*myR*" :results none
>> (progn
>> (switch-to-buffer rsession)
>> (ess-quit)
>> (sleep-for 1)
>> (kill-buffer))
>> #+end_src
>>
>>
>> #+call: killRsession("*myR*") :results none
>
> Thanks - this works. But I get an error which says:
>
> ,----
> | save-excursion: Wrong type argument: integer-or-marker-p, nil
> `----
>
> Any suggestion on how to avoid this?
>
I do not see that error, so hard to say. Do you have a backtrace? Wild
guess: Maybe the ess-quit changed? What version of ess are you using?
Note, that this could be improved by replacing the (sleep-for 1) with
something that actually waits until R has quit...
- Andreas
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How to end a :session?
2015-05-28 11:46 ` Andreas Leha
@ 2015-05-28 12:00 ` Rainer M Krug
2015-05-28 12:02 ` Andreas Leha
0 siblings, 1 reply; 9+ messages in thread
From: Rainer M Krug @ 2015-05-28 12:00 UTC (permalink / raw)
To: Andreas Leha; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 3512 bytes --]
Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
> Hi Rainer,
>
> Rainer M Krug <Rainer@krugs.de> writes:
>> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>>
>>> Hi Rainer,
>>
>> Hi Andreas,
>>
>>>
>>> Rainer M Krug <Rainer@krugs.de> writes:
>>>> Christopher Witte <chris@witte.net.au> writes:
>>>>
>>>>> perhaps what you want is a named session, see
>>>>> http://orgmode.org/manual/session.html
>>>>
>>>> Sure - that's what I have.
>>>>
>>>> But how can I close the named session when I don't need it anymore, or
>>>> want to start, the next time I use the named session, with a new
>>>> session?
>>>>
>>>>
>>>>>
>>>>> On 28 May 2015 at 10:44, Rainer M Krug <Rainer@krugs.de> wrote:
>>>>>
>>>>>> Hi
>>>>>>
>>>>>> I can start a session as follow:
>>>>>>
>>>>>> --8<---------------cut here---------------start------------->8---
>>>>>> #+begin_src R :session Test
>>>>>> cat("Session Test\n")
>>>>>> #+end_src
>>>>>> --8<---------------cut here---------------end--------------->8---
>>>>>>
>>>>>> Now I hava an R session named *Test*. But how can I closes this session?
>>>>>> I thought about just quitting R
>>>>>>
>>>>>> --8<---------------cut here---------------start------------->8---
>>>>>> #+begin_src R :session Test
>>>>>> q(save = "no)
>>>>>> #+end_src
>>>>>> --8<---------------cut here---------------end--------------->8---
>>>>>>
>>>>>> but this does not return as ESS is waiting for the prompt (">").
>>>>>>
>>>>>> Is there a way of closing the session *Test* and close the buffer?
>>>>>>
>>>>>> My reasoning is that I want to do different longer analysis in one org
>>>>>> file and start each in its own session, i.e. clean R. But as they
>>>>>> involve several steps, I don't want to put them into one code block.
>>>>>>
>>>>>> So I have several code blocks which I want to execute in a "throw away
>>>>>> session" which I would like to discard afterwards.
>>>>>>
>>>>>> So I am looking for something like
>>>>>>
>>>>>> #+CLOSE_SESSION Test
>>>>>>
>>>>>> which would then close the session *Test*
>>>>>>
>>>>>> Is something like this possible at the moment?
>>>>>>
>>>
>>> How about
>>>
>>> #+name: killRsession
>>> #+begin_src emacs-lisp :var rsession="*myR*" :results none
>>> (progn
>>> (switch-to-buffer rsession)
>>> (ess-quit)
>>> (sleep-for 1)
>>> (kill-buffer))
>>> #+end_src
>>>
>>>
>>> #+call: killRsession("*myR*") :results none
>>
>> Thanks - this works. But I get an error which says:
>>
>> ,----
>> | save-excursion: Wrong type argument: integer-or-marker-p, nil
>> `----
>>
>> Any suggestion on how to avoid this?
>>
>
> I do not see that error, so hard to say. Do you have a backtrace? Wild
> guess: Maybe the ess-quit changed? What version of ess are you using?
ess-15.03
>
> Note, that this could be improved by replacing the (sleep-for 1) with
> something that actually waits until R has quit...
I can live with the error for now, but I might look into it some time
later.
Thanks a lot,
Rainer
>
> - Andreas
>
>
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)
Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa
Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44
Fax (D): +49 - (0)3 21 21 25 22 44
email: Rainer@krugs.de
Skype: RMkrug
PGP: 0x0F52F982
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How to end a :session?
2015-05-28 12:00 ` Rainer M Krug
@ 2015-05-28 12:02 ` Andreas Leha
2015-05-28 12:08 ` Rainer M Krug
0 siblings, 1 reply; 9+ messages in thread
From: Andreas Leha @ 2015-05-28 12:02 UTC (permalink / raw)
To: emacs-orgmode
Rainer M Krug <Rainer@krugs.de> writes:
> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>
>> Hi Rainer,
>>
>> Rainer M Krug <Rainer@krugs.de> writes:
>>> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>>>
>>>> Hi Rainer,
>>>
>>> Hi Andreas,
>>>
>>>>
>>>> Rainer M Krug <Rainer@krugs.de> writes:
>>>>> Christopher Witte <chris@witte.net.au> writes:
>>>>>
>>>>>> perhaps what you want is a named session, see
>>>>>> http://orgmode.org/manual/session.html
>>>>>
>>>>> Sure - that's what I have.
>>>>>
>>>>> But how can I close the named session when I don't need it anymore, or
>>>>> want to start, the next time I use the named session, with a new
>>>>> session?
>>>>>
>>>>>
>>>>>>
>>>>>> On 28 May 2015 at 10:44, Rainer M Krug <Rainer@krugs.de> wrote:
>>>>>>
>>>>>>> Hi
>>>>>>>
>>>>>>> I can start a session as follow:
>>>>>>>
>>>>>>> --8<---------------cut here---------------start------------->8---
>>>>>>> #+begin_src R :session Test
>>>>>>> cat("Session Test\n")
>>>>>>> #+end_src
>>>>>>> --8<---------------cut here---------------end--------------->8---
>>>>>>>
>>>>>>> Now I hava an R session named *Test*. But how can I closes this session?
>>>>>>> I thought about just quitting R
>>>>>>>
>>>>>>> --8<---------------cut here---------------start------------->8---
>>>>>>> #+begin_src R :session Test
>>>>>>> q(save = "no)
>>>>>>> #+end_src
>>>>>>> --8<---------------cut here---------------end--------------->8---
>>>>>>>
>>>>>>> but this does not return as ESS is waiting for the prompt (">").
>>>>>>>
>>>>>>> Is there a way of closing the session *Test* and close the buffer?
>>>>>>>
>>>>>>> My reasoning is that I want to do different longer analysis in one org
>>>>>>> file and start each in its own session, i.e. clean R. But as they
>>>>>>> involve several steps, I don't want to put them into one code block.
>>>>>>>
>>>>>>> So I have several code blocks which I want to execute in a "throw away
>>>>>>> session" which I would like to discard afterwards.
>>>>>>>
>>>>>>> So I am looking for something like
>>>>>>>
>>>>>>> #+CLOSE_SESSION Test
>>>>>>>
>>>>>>> which would then close the session *Test*
>>>>>>>
>>>>>>> Is something like this possible at the moment?
>>>>>>>
>>>>
>>>> How about
>>>>
>>>> #+name: killRsession
>>>> #+begin_src emacs-lisp :var rsession="*myR*" :results none
>>>> (progn
>>>> (switch-to-buffer rsession)
>>>> (ess-quit)
>>>> (sleep-for 1)
>>>> (kill-buffer))
>>>> #+end_src
>>>>
>>>>
>>>> #+call: killRsession("*myR*") :results none
>>>
>>> Thanks - this works. But I get an error which says:
>>>
>>> ,----
>>> | save-excursion: Wrong type argument: integer-or-marker-p, nil
>>> `----
>>>
>>> Any suggestion on how to avoid this?
>>>
>>
>> I do not see that error, so hard to say. Do you have a backtrace? Wild
>> guess: Maybe the ess-quit changed? What version of ess are you using?
>
> ess-15.03
>
I am on ess-15.09-devel.
>>
>> Note, that this could be improved by replacing the (sleep-for 1) with
>> something that actually waits until R has quit...
>
> I can live with the error for now, but I might look into it some time
> later.
>
Fine.
Andreas
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: How to end a :session?
2015-05-28 12:02 ` Andreas Leha
@ 2015-05-28 12:08 ` Rainer M Krug
0 siblings, 0 replies; 9+ messages in thread
From: Rainer M Krug @ 2015-05-28 12:08 UTC (permalink / raw)
To: Andreas Leha; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 4048 bytes --]
Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
> Rainer M Krug <Rainer@krugs.de> writes:
>> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>>
>>> Hi Rainer,
>>>
>>> Rainer M Krug <Rainer@krugs.de> writes:
>>>> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>>>>
>>>>> Hi Rainer,
>>>>
>>>> Hi Andreas,
>>>>
>>>>>
>>>>> Rainer M Krug <Rainer@krugs.de> writes:
>>>>>> Christopher Witte <chris@witte.net.au> writes:
>>>>>>
>>>>>>> perhaps what you want is a named session, see
>>>>>>> http://orgmode.org/manual/session.html
>>>>>>
>>>>>> Sure - that's what I have.
>>>>>>
>>>>>> But how can I close the named session when I don't need it anymore, or
>>>>>> want to start, the next time I use the named session, with a new
>>>>>> session?
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> On 28 May 2015 at 10:44, Rainer M Krug <Rainer@krugs.de> wrote:
>>>>>>>
>>>>>>>> Hi
>>>>>>>>
>>>>>>>> I can start a session as follow:
>>>>>>>>
>>>>>>>> --8<---------------cut here---------------start------------->8---
>>>>>>>> #+begin_src R :session Test
>>>>>>>> cat("Session Test\n")
>>>>>>>> #+end_src
>>>>>>>> --8<---------------cut here---------------end--------------->8---
>>>>>>>>
>>>>>>>> Now I hava an R session named *Test*. But how can I closes this session?
>>>>>>>> I thought about just quitting R
>>>>>>>>
>>>>>>>> --8<---------------cut here---------------start------------->8---
>>>>>>>> #+begin_src R :session Test
>>>>>>>> q(save = "no)
>>>>>>>> #+end_src
>>>>>>>> --8<---------------cut here---------------end--------------->8---
>>>>>>>>
>>>>>>>> but this does not return as ESS is waiting for the prompt (">").
>>>>>>>>
>>>>>>>> Is there a way of closing the session *Test* and close the buffer?
>>>>>>>>
>>>>>>>> My reasoning is that I want to do different longer analysis in one org
>>>>>>>> file and start each in its own session, i.e. clean R. But as they
>>>>>>>> involve several steps, I don't want to put them into one code block.
>>>>>>>>
>>>>>>>> So I have several code blocks which I want to execute in a "throw away
>>>>>>>> session" which I would like to discard afterwards.
>>>>>>>>
>>>>>>>> So I am looking for something like
>>>>>>>>
>>>>>>>> #+CLOSE_SESSION Test
>>>>>>>>
>>>>>>>> which would then close the session *Test*
>>>>>>>>
>>>>>>>> Is something like this possible at the moment?
>>>>>>>>
>>>>>
>>>>> How about
>>>>>
>>>>> #+name: killRsession
>>>>> #+begin_src emacs-lisp :var rsession="*myR*" :results none
>>>>> (progn
>>>>> (switch-to-buffer rsession)
>>>>> (ess-quit)
>>>>> (sleep-for 1)
>>>>> (kill-buffer))
>>>>> #+end_src
>>>>>
>>>>>
>>>>> #+call: killRsession("*myR*") :results none
>>>>
>>>> Thanks - this works. But I get an error which says:
>>>>
>>>> ,----
>>>> | save-excursion: Wrong type argument: integer-or-marker-p, nil
>>>> `----
>>>>
>>>> Any suggestion on how to avoid this?
>>>>
>>>
>>> I do not see that error, so hard to say. Do you have a backtrace? Wild
>>> guess: Maybe the ess-quit changed? What version of ess are you using?
>>
>> ess-15.03
>>
>
> I am on ess-15.09-devel.
That might explain. For some time, I was using the git version (and I
still update it daily) but I was quite a few times bitten by changes /
bugs so I decided to use the latest stable release of ESS.
>
>>>
>>> Note, that this could be improved by replacing the (sleep-for 1) with
>>> something that actually waits until R has quit...
>>
>> I can live with the error for now, but I might look into it some time
>> later.
>>
>
> Fine.
>
> Andreas
>
>
--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)
Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa
Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44
Fax (D): +49 - (0)3 21 21 25 22 44
email: Rainer@krugs.de
Skype: RMkrug
PGP: 0x0F52F982
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-05-28 12:09 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-28 8:44 How to end a :session? Rainer M Krug
2015-05-28 10:07 ` Christopher Witte
2015-05-28 10:09 ` Rainer M Krug
2015-05-28 10:31 ` Andreas Leha
2015-05-28 11:09 ` Rainer M Krug
2015-05-28 11:46 ` Andreas Leha
2015-05-28 12:00 ` Rainer M Krug
2015-05-28 12:02 ` Andreas Leha
2015-05-28 12:08 ` Rainer M Krug
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.