On Thu, Sep 18 2008, Carsten Dominik wrote: > These regular expressions are incorrect. \\s- is the way to denote > whitespace. However, since that also includes newlines, I prefer to > write "[ \t]" in such cases. Carsten-- Thanks for the tip. I now to get dumped into r-mode correctly when I hit C-c ' inside the regions defined in the attached patch. There's one annoying quirk left, though. When coming out of r-mode by hitting C-c ' in the Org Edit Src Example buffer, the line that ends the example (#+latex: \end{Scode}) is concatenated to the last line of the source code, regardless of how many new lines are included at the end of the source code in the temporary buffer. #+latex: \begin{Scode} a <- 3 #+latex: \end{Scode} goes to #+latex: \begin{Scode} a <- 3#+latex: \end{Scode} Any suggestions on how to preserve the formatting of the end marker? Thanks, /au