[ESS] org mode and python talk

Thorsten Jolitz tjolitz at gmail.com
Mon Sep 16 18:35:38 CEST 2013


Stephen Eglen <S.J.Eglen at damtp.cam.ac.uk> writes:

>> Actually, org-mode works very well with ESS.  When you are editing the R
>> code, all the syntax highlighting and everything else is available.  See:
>> http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html
>
>
> thanks Matt, Phil.
>
> Yes, org-babel does work with R, but what I meant to ask was whether
> anyone had put together such a large org+R document together.
>
> To get syntax highlighting in code blocks, don't you first have to hit
> C-c ' (org-edit-special) to open a temp buffer.  I don't think they've
> yet solved the multi-mode problem in org mode.
>
> Vitalie, on the other hand, has done a great job with polymode.el for
> .Rnw files (and others).

There is the combination of 'outshine' and 'outorg' (and optionally
'navi-mode') that gives you a kind of 'reverse org-babel' in the sense
that the focus, while doing literate programming, is on the programming,
not on the text.

Enable `outline-minor-mode' with outshine extensions for ESS/R-mode and
structure you .R file with outcommented org-mode headlines. That will
give your ESS/R buffer the look&feel of an Org-mode buffer, but the text
parts are outcommented - the focus is on the code. 

Then you can do M-# M-# (outorg-edit-as-org) on a subtree (or, with a
prefix, on the whole buffer), and the buffer will be converted to
Org-mode and presented in a temporary *outorg-edit-buffer* for editing
in full Org-mode.

When done, type M-# (outorg-copy-edits-and-exit) and the edited
subtree/buffer will be converted back to R-mode. 

the code is here:

,------------------------
| https://github.com/tj64
`------------------------

there is a Worg article:

,-----------------------------------------------------------
| http://orgmode.org/worg/org-tutorials/org-outside-org.html
`-----------------------------------------------------------

and some Youtube screencasts, e.g.:

,-------------------------------------------
| http://www.youtube.com/watch?v=nqE6YxlY0rw
`-------------------------------------------

(this works the same with Elisp, PicoLisp, ESS/R and other programming
language major-modes).

-- 
cheers,
Thorsten



More information about the ESS-help mailing list