emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] [babel] Uses for :session buffers


From: Dan Davison
Subject: Re: [Orgmode] [babel] Uses for :session buffers
Date: Wed, 04 Nov 2009 17:02:56 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Stephan Schmitt <address@hidden> writes:

> Thomas S. Dye wrote:
>> Aloha all,
>>
>> I'm trying to comprehend the possibilities created by org-babel, and
>> would like to draw on the experience of others if I could.
>>
>> I recently discovered the buffer created by :session.  In my case,
>> this is an R session that I am building to track the data collection
>> phase of a research project.  I was delighted to find that it
>> appears to have recorded everything my org file had done in that
>> session.  I have a vague idea that it might be useful to save this
>> as a log to prove that all the little source blocks in my org file
>> indeed were called and executed successfully. 
>>
>> I'm wondering: do other org-babelers use the :session buffer?  How?
>> For what purpose?

Hi Tom,

For R users, org-babel is intended to be used in conjunction with ESS[1]
and personally I continue to use the inferior-ESS mode *R* buffer (aka R
session buffer) in a similar way to when I was using ESS alone. So for
example

1. In an ess-mode (R) edit buffer, I use the ess-eval-* family of
   functions to evaluate lines, regions, etc. In particular, to debug a
   code block I switch to an R edit buffer with C-c ', then evaluate
   line-by-line using C-c C-n (ess-eval-line-and-step).[2]
2. In an ess-mode (R) edit buffer, I use C-z (ess-switch-to-end-of-ESS)
   to switch to the R session buffer (inferior-ESS mode)
3. In the R session buffer, I try out evaluation of expressions, query
   data structure contents with str(), list objects in the environment,
   etc.
4. There are many other nice facilities provided by ESS when working in
   an R edit buffer with an associated active R session, such as object
   name completion, displaying formal arguments to functions while you
   type, etc.

I believe that to some extent you can work in a similar way with
interactive python and ruby sessions but personally I don't have much
experience with that yet. It was always a key aim of org-babel (made
easy by org-mode's C-c ') that it should not get in the way of whatever
other emacs facilities exist for working with interactive emacs sessions
in a particular language. Incidentally, maintaining this sort of
automatic compatibility with language-specific software like ESS is one
reason why I am slightly skeptical about the value of using org-babel in
a "dual major-mode" fashion as was suggested in a separate thread today.

Dan

Footnotes:

[1] http://ess.r-project.org/

>>
>
> Another advantage: you can set a variable in one source block
> and access it in the next one.
>
> Greetings,
>       Stephan
>
>> Any tips or advice will be appreciated.
>>
>> All the best,
>> Tom
>>
>> Thomas S. Dye, Ph.D.
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode







reply via email to

[Prev in Thread] Current Thread [Next in Thread]