[ESS-bugs] Was: New ESS is badly messed up

Terry Therneau therneau at mayo.edu
Tue Jan 29 22:29:59 CET 2013


Sorry, that title wasn't mine, though the original words were.  It should say "the new ESS 
+ my setup = messed up".
My first guess was that I've got something wrong -- ESS couldn't be that far off.

Let me set this all cleanly: I started with one issue in ESS that I'd like to see 
addressed, but before going down that path it was important to make sure I have the latest 
version.
1. By and large ESS works very well for me, I am not at all an emacs guru, so patience it 
appreciated.

2. It appeared that installing a new version of ESS "didn't take".  Rodney gave the key 
pointer for that problem,
which was that this in xubuntu 11.10 it uses /usr/share/emacs23/site-lisp/ess/ess-site.elc 
by preference.

3. Using the new one, my .Rnw files were bad.  Vitalie gave me the path to fixing un this 
one, which was that indeed, there was a bit of code still living in my emacs init that had 
to do with .Rnw; copied from who knows where at some past date.  I removed it, and now 
.Rnw files are fine.

Two issues remain:
4. Formatting of any .nw files is now a mess.  I do have an association between .nw and 
noweb-mode in the alist, but whatever is currenly being loaded is awful.
   How do I figure out which nw-mode chunk is being used?  Maybe even go back to the prior 
one, which worked well.

5. The issue I started with.  I use noweb style for some large R projects: think 
"survival" and "coxme".  In this usage code inclusions are very common.  Here are a few 
lines from coxph.Rnw, which is code, not Sweave.
<<coxph>>=
coxph <- function(formula, data, weights, subset, na.action,
     init, control, ties= c("efron", "breslow", "exact"),
     singular.ok =TRUE, robust=FALSE,
     model=FALSE, x=FALSE, y=TRUE,  tt, method=ties, ...) {

     ties <- match.arg(ties)
     Call <- match.call()

... (20 lines omitted)

     timetrans <- attr(Terms, "specials")$tt
     if (length(timetrans)) {
<<coxph-transform>>
         }

<<coxph-setup>>
<<coxph-penal>>
<<coxph-compute>>
<<coxph-finish>>
     }
@
Then there is more text, often with lots of latex formulas, interspresed with the 
definitions of coxph-compute and such.

The problem: Rnw mode wants to increase the indentation level after each of these 
<<whatever>> objects.

I can live without a solution to 5 since it is only a minor nuisance.

Terry Therneau


On 01/29/2013 02:01 PM, Vitalie Spinu wrote:
>    >>  Rodney Sparapani<rsparapa at mcw.edu>
>    >>  on Tue, 29 Jan 2013 13:43:38 -0600 wrote:
>
>    >  Not sure what is going on.  I don't use noweb since I want to
>    >  maintain my purity ;o)  I'm forwarding this report to ess-bugs...
>
>    >  -------- Original Message --------
>    >  Subject: Re: [ESS-bugs] Indentation of included chunks
>    >  Date: Tue, 29 Jan 2013 13:40:36 -0600
>    >  From: Terry Therneau<therneau at mayo.edu>
>    >  To: Rodney Sparapani<rsparapa at mcw.edu>
>
> [...]
>
>
>    >  However, the new ESS is badly messed up.
>
>    >   1. I also use files with a .nw extension for C-code. They don't
>    >  work anymore. If I try typing one and turn on c-mode inside a code
>    >  chunk, the mode is lost every time I type a new line.
>
>
>    >   2. On an existing .Rnw file, inside of any code chunk it has sets
>    >  itself to "Fundamental Noweb" instead of S mode.  Inside a block I
>    >  can reset it to c-mode or pascal-mode, but the word "S-mode" returns
>    >  me to fundamental.  All the nice color highlighting is gone, my
>    >  indentation rules are ignored,
>
>
> ESS is not messed up at all, it was before. Now there are two different
> modes, ess-noweb-mode which is associated with .Rnw files and simple
> noweb-mode.el which you should install separately if it is not already
> installed on you computer.
>
> Most likely you are messing up with noweb-mode in your config
> files. Remove all your custom settings and it should start working by
> default.
>
> To check what version you are using, C-h m and see if you see
> ess-noweb-mode in the list of minor modes.
>
>      Vitalie



More information about the ESS-bugs mailing list