[ESS] knitr

Vitalie Spinu spinuvit at gmail.com
Thu Jun 7 15:20:00 CEST 2012


  >> Stephen Eglen <S.J.Eglen at damtp.cam.ac.uk>
  >> on Wed, 06 Jun 2012 21:21:08 +0100 wrote:

  >> Stephen, you have pointed once to an improved noweb mode. Was it this one:
  >> 
  >> http://www.loveshack.ukfsn.org/emacs/noweb.elyep, that's it; in that directory you'll also see multi-mode.el, which
  > provides the functionality for switching modes.  It is a whole heap
  > better than our old noweb.el, I've just not had the time to replace it
  > (it may also not work on XEmacs).

Right. I've checked it out. There are two main alternatives mmm-mode.el
and mumamo.el (part of NXhtml package), which are both restarting
submodes. We have already tried this with old noweb.el, and we clearly
don't want that.

Dave's multi-mode.el is amassing. I've just tried his noweb.el. The only
inconvenience is that there are many more associated indirect buffers
which appear in the buffer list.

Here is roughly how I see the road path. Write a mode litprog-mode with
generic "everything" (this will be a more or less a rewrite of Dave's
noweb.el).

Then derive lp-nw-mode, lp-md-mode, lp-brew-mode, lp-html-mode etc from
that. At the same time, build a customizable interface/structure to
encapsulate the processing backends.

There should be only one backend associated with a particular buffer and
all generic commands to dispatch to that backend.

Each backend might handle several lp modes (knitr for example). Also the
functionality of the backend depends on the mode. The opposite is also
true. For instance regexp of chunks in nw-mode might differ when it is
processed by Sweave or knitr.

These are my rants so far. A new branch on github
(https://github.com/emacs-ess/ESS.git) just started a project. I've
added Dave's multi-mode.el, noweb.el and a test.nw to lisp/contrib
directory. Feel free to experiment and contribute.

I personally don't have much time to work on it right now, but will do
my best to keep an eye on it.

Vitalie.



More information about the ESS-help mailing list