[ESS] Emacs 28 and Sweave files

Vincent Goulet v|ncent@gou|et @end|ng |rom me@com
Wed Sep 7 23:03:46 CEST 2022


Hi all,

A large part of my work in Emacs involves editing Sweave (.Rnw) files. I was very much used to the tried, tested and true ess-noweb mode for this purpose.

Now, in the development version of ESS that is required for Emacs 28, all the noweb stuff was gutted out and we're told to use polymode instead. For one thing, I think it's a pity that such fundamental interaction between R and Emacs (wasn't the whole concept of Sweave based off Emacs functionality?) is no longer part of ESS. I'd certainly vote for the return of noweb files support. (I understand that polymode brought improved support for RMarkdown files.)

I'm probably late to the party, but can anyone give me a primer on polymode for Rnw files? (Not Rmd files, some oldies like me still rely on LaTeX and Sweave -- not even knitr!)

I followed the polymode installation instructions and added the 'mode: poly-noweb' file variable to a .Rnw file. If I do 'M-n w' or 'M-n e' (what's the difference?), I'm first asked to select a weaver or an exporter. What's the answer? Pressing TAB does not offer any choice.

What if I just want to compile the LaTeX file? In Emacs 27, ESS was connected to AUCTeX and the weave step was integrated into the compilation step (C-c C-c). Anything as streamlined with polymode?

I also stumble into the following issues. First, as soon as I try to do anything in a .Rnw file, I get these error messages:

Error during redisplay: (internal--syntax-propertize 2) signaled (error "Variable binding depth exceeds max-specpdl-size")
Error running timer ‘show-paren-function’: (error "internal--syntax-propertize did not move syntax-propertize--done")

Second, I ended up a few times with the following markers at the end of the file name in the modeline and in the mode display: HeadTail. I'm not too sure how to reproduce, but does this ring any bell here?

System info: 
Emacs Modified for macOS 28.1-modified-1, based on
GNU Emacs 28.1 (build 1, aarch64-apple-darwin21.1.0, NS appkit-2113.00 Version 12.0.1 (Build 21A559)) of 2022-05-11
polymode 0.2.2 installed through MELPA

Thanks in advance!

v.


More information about the ESS-help mailing list