[ESS] ess-indent-exp follow OWN style?

Paul Burkander paul at burkander.com
Fri Jun 3 19:38:26 CEST 2011


Hi all,

I'm working on a group project, with lots of people writing stata
code.  I'd like to be able to go through all the code and apply a
simple indentation structure.  For example, I have


if `y'>=2009 {;
g feederschoolcode=.;
};
if `y'==2009 | `y'==2010 {;
g home_school=.;
};

which I'd like to have as


if `y'>=2009 {;
     g feederschoolcode=.;
};
     if `y'==2009 | `y'==2010 {;
     g home_school=.;
};


I tried M-C-q, which calls ess-indnet-exp, but then I get


if `y'>=2009 {;
              g feederschoolcode=.;
         };
if `y'==2009 | `y'==2010 {;
                          g home_school=.;
                     };

(which on my buffer looks like the g is lined up under the opening bracket)

Is there some way to make ess-indent-exp follow my OWN indent style?
Is there some other way to apply an indentation style to a chunk of
code?

my own style has only one variable set:  ess-indent-level is set to 5

I'm using emacs 23.2.1, ess 5-12.1, and ubuntu 11.04.

Thanks.



More information about the ESS-help mailing list