[ESS] Introducing Polymode

Stephen Eglen S.J.Eglen at damtp.cam.ac.uk
Wed Mar 27 13:01:09 CET 2013

> Currently it has builtin supports for Rnw, Rmd, Rhtml, Rbrew, Rcpp, cppR
> and "live" R examples in Rd and ess-help buffers. Adding new polymodes
> is literally about 25 lines of declarations. See "modes" directory and
> particularly poly-R.el. Also look in test directory for test
> examples. The interface is not fully settled as yet and thus, not
> documented.
> There is also a default association with md extension. This basically
> means that as long as you have a proper declaration ```foo, and foo-mode
> function exists the chunk will be initialized with that mode.
> It would be really nice if enthusiastic people can try it out and report
> bugs/comments/suggestions, either directly to me, or preferably on the
> github bug tracker. But please read the words warning first;)

hi Vitalie,
this is great, thanks!  My initial thoughts:

a lot of people on this list will presumably be interested in .[RS]nw
support; I just tested it and found the following:

* If you (require 'poly-r) after ESS, then the auto-mode entries for
  polymode take precedence over what ESS has, so when I visit
  tests/minimal.Rnw, I am in polymode, as noted by the modeline "PM".
  It also switches between latex and R, but:

* when moving into a R chunk, I see:

polymode error: Args out of range: "hite", 4, 6 [5 times]

Is there a way we can get you a better backtrace?

* When point is on the line <<foo...>>= then the modeline says
  "Fundamental PM", except when at the end of the line.  I guess that
  makes sense, since technically the chunk name is neither latex or R.

* In readme.md, I found the comment "No literate programming backends"
  confusing.  Isn't Rnw support already here, as noted above?  Or do you
  mean there is no support for *processing* literate programming docs?


More information about the ESS-help mailing list