Subject: bug#16182: Acknowledgement (24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens)

From: Bozhidar Batsov <[email-masked]>
Date: Fri, 20 Dec 2013 11:51:57 +0200

On Friday, December 20, 2013 at 7:21 AM, Dmitry Gutov wrote:
> On 19.12.2013 22:33, Bozhidar Batsov wrote:
> > Part of the reason people are not using a particular style from time to
> > time is simply lack of tool support. :-) I guess more people would have
> > used that style if their editor supported it.
> >  
>  
>  
> Maybe so. I'll have to return to the "do" block later, since this kind  
> of special handling requires finding the beginning of the method chain  
> (in the general case) that the block is passed to. Other keywords are  
> simpler.
>  
> > Well, even though I develop Rails apps for a living I wouldn’t say the
> > style used in the Rails codebase should be considered some gold standard
> > - after all they are outdenting “private/protected” there :-)
> >  
>  
>  
> Yuck indeed. :)
>  
> > That said
> > - before I started using programming Ruby in Emacs I aligned to the
> > beginning of the statement, but I stopped because this wasn’t supported
> > in ruby-mode. After using the alignment to keyword style for several
> > years I’ve grown to like it a lot (and it seems others are enjoying it
> > as well
> > http://stackoverflow.com/questions/2925028/how-do-you-assign-a-variable-with-the-result-of-a-if-else-block).
> > I’m perfectly fine with alignment to statement becoming the default
> > (although the change of this default would be fairly visible/disruptive,
> > since as it stands keyword alignment is the only supported style and I
> > guess most Rubyists using Emacs employ it).
> >  
>  
>  
> Well, since there's not much support for changing the defaults, I've  
> reverted the special handling of "begin" that already made its way in,  
> and added a user option that would control all applicable keywords:  
> `ruby-align-to-stmt-keywords', in revision 115624.
>  
>  

Just a small nitpick - everything that returns a value is actually an expression, not a statement.
Maybe `ruby-align-to-expr-keywords’ would be a more appropriate name for the option.  
>  
> Everyone, please try how it works for you, maybe comment on the name, etc.
>  
> The feature freeze is in a couple of days, so we have to get the basics  
> right.
>  
>  

Btw, I noticed this in the indent examples:

zoo
  .lose(
  q, p)

Shouldn’t it be:

zoo
  .lose(
    q, p)