[ESS] setMethod indentation

Martin Maechler m@ech|er @end|ng |rom @t@t@m@th@ethz@ch
Fri Jun 5 22:39:15 CEST 2015


>>>>> Kevin Coombes <kevin.r.coombes using gmail.com>
>>>>>     on Fri, 5 Jun 2015 10:42:36 -0400 writes:

> Hi,
> At some point, the default behavior for indenting anonymous functions 
> seems to have changed, and I'd like to know what variable I have to set 
> in order to change it back to the old default. I notice the behavior in 
> various *apply functions or when is use setMethod with S4 classes. To 
> explain what I mean, here is the *old* (and in my opinion still desired) 
> behavior:
> 
> setMethod("summary", c("Prior"), function(object, ...) {
>    cat("Prior: ", object using cn,"\n")
>    print(object using vt)
> })
> 
> And here is the new behavior:
> 
> setMethod("summary", c("Prior"), function(object, ...) {
>              cat("Prior: ", object using cn,"\n")
>              print(object using vt)
>            })
> 
> And yes, I know that putting the opening brace on  a separate line can 
> get this behavior:
> 
> setMethod("summary", c("Prior"), function(object, ...)
>    {
>      cat("Prior: ", object using cn,"\n")
>      print(object using vt)
>    })
> 
> but I don't like that either. (And I really, really, really hope that 
> asking this question doesn't deteriorate into a discussion of the 
> one-true-way to format code in languages with braces.  I'm the only 
> person who has to maintain this code, and I wants it how I wants it.)

Thank you, Kevin, for this notice.

Today at work I've noticed  setMethod() indentation cases that 
*much* worse.

That part is definitely "broken" in the current ESS development
version, ... and I may get to did out my examples if asked for
it.

Martin


> 
> Thanks for your help,
>    Kevin




More information about the ESS-help mailing list