[ESS] r-mode name]

Stephen Eglen S.J.Eglen at damtp.cam.ac.uk
Tue Jul 25 14:01:08 CEST 2006


I've taken a look at using folding-mode in ESS, in particular in
foo.Rnw sweave files.  I tried the following:

(require 'folding)
(folding-add-to-marks-list 'ess-mode               "<<"  "@" nil t)
(folding-add-to-marks-list 'noweb-mode               "<<"  "@" nil t)

Note that right off there is a problem using folding mode in .Rnw
files, as .Rnw is defined to be in LaTeX mode for the documentation,
and ess-mode for the code chunks.  

With the above, if I'm inside a code chunk, M-x folding-mode works
fine and folds up the chunks.  But then when I leave a chunk, we
revert to latex mode and the carriage returns can get converted to ^M,
leaving the buffer looking a bit of a mess.


Note: for debugging purposes, the markers can be checked by examining
the emacs variable folding-top-mark and folding-bottom-mark.  In
LaTeX parts of the buffer, the marks are "%{{{"

So, I'm afraid, right now, this looks like it needs a bit more work to
fix.

Stephen




More information about the ESS-help mailing list