[ESS] indentation after an incomplete assignment?

Peter Meilstrup peter.meilstrup at gmail.com
Sun Jun 5 02:01:30 CEST 2011


On Sat, Jun 4, 2011 at 4:33 PM, Michael Hannon <jm_hannon at yahoo.com> wrote:
>> Is there a way to make the indentation of an assigning expression
>> using `=` similar to the one using `<-`? e.g.
>>
>> when we use =, we get this:
>>
>> a = c(1, 2,
>> 3, 4)
>>
>> but <- leads to this:
>>
>> a <- c(1, 2,
>>           3, 4)
>>
>> is there a way to let ESS indent like this?
>>
>> a = c(1, 2,
>>         3, 4)
>
> Hi, Yihui.  I don't know the answer to your question (except to offer the
> opinion that it seems there is ALWAYS a way to get Emacs to what you want ;-),
> But is there some reason you can't just use the '<-' construct?
>
> -- Mike
>

Well, this problem also happens in the correct context for "=" (named
function arguments.)

  matrix(data=c(1, 2, 3,
           4, 5, 6,
           7, 8, 9),
         byrow=TRUE,
         nrow=3)

should rather be indented as:

  matrix(data=c(1, 2, 3,
                4, 5, 6,
                7, 8, 9),
         byrow=TRUE,
         nrow=3)

Peter



More information about the ESS-help mailing list