all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bozhidar Batsov <bozhidar@batsov.com>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: Steve Purcell <steve@sanityinc.com>,
	16182@debbugs.gnu.org,
	Adam Sokolnicki <adam.sokolnicki@gmail.com>
Subject: bug#16182: Acknowledgement (24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens)
Date: Thu, 19 Dec 2013 22:33:44 +0200	[thread overview]
Message-ID: <B61DDD8463B34984B2ECBF9A00C01CB6@gmail.com> (raw)
In-Reply-To: <52B329C1.9050602@yandex.ru>

[-- Attachment #1: Type: text/plain, Size: 2943 bytes --]

On Thursday, December 19, 2013 at 7:15 PM, Dmitry Gutov wrote:
> On 19.12.2013 14:54, Bozhidar Batsov wrote:
> > I can confirm that your method args indentation fix is working. I did,
> > however, notice the following problem after I mentioned the
> > if/unless/case with assignment indentation. Consider the following:
> >  
> > res = method do |x, y|
> > something
> > end
> >  
> > Might make sense to indent those like:
> >  
> > res = method do |x, y|
> > something
> > end
> >  
> > for consistency with the if/unless/case indentation by default.
>  
> It might be more consistent, but I don't see any projects doing that.  
> For example, ActiveRecord, Grape, Goliath and Rack don't.
>  
> Check out the examples at the top:
>  
> https://github.com/rails/rails/blob/master/activerecord/lib/active_record/base.rb
>  
> https://github.com/rack/rack/blob/master/lib/rack/builder.rb
>  
> It can be an option, though.
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.
>  
> ---
>  
> Come to think of it, do you see the "align end to the keyword" style  
> much? I did a grep on my gems directory, and the other style seems to be  
> prevalent, especially among the non-core gems:
>  
> Pry, RDoc, Minitest, Rubygems, EventMachine, Nokogiri align to keyword.
>  
> ActiveRecord, ActiveSupport, other Active* gems, Cucumber, Thor, Grape,  
> Excon, WebMock, Faraday align to the beginning of the statement.
>  
> RSpec uses both. Yard aligns to keyword after "=", but to statement  
> after "||=".
>  
> Maybe we even should align to the statement by default, because, you  
> know, Rails.
>  
>  

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 :-) 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).  
  
>  
> > Also:
> >  
> > res =
> > method do |x, y|
> > something
> > end
> >  
> > is actually indented like this:
> >  
> > res =
> > method do |x, y|
> > something
> > end
> >  
>  
>  
> Guess we can special-case this.
That’d be great.  


[-- Attachment #2: Type: text/html, Size: 4507 bytes --]

  reply	other threads:[~2013-12-19 20:33 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-18  3:55 bug#16182: 24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens Dmitry Gutov
     [not found] ` <handler.16182.B.138733895212351.ack@debbugs.gnu.org>
2013-12-18  4:05   ` bug#16182: Acknowledgement (24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens) Dmitry Gutov
2013-12-18 10:31     ` Bozhidar Batsov
2013-12-19  4:35       ` Dmitry Gutov
2013-12-19  9:08         ` Bozhidar Batsov
2013-12-19 12:54           ` Bozhidar Batsov
2013-12-19 17:15             ` Dmitry Gutov
2013-12-19 20:33               ` Bozhidar Batsov [this message]
2013-12-19 20:42                 ` Steve Purcell
2013-12-20  5:21                 ` Dmitry Gutov
2013-12-20  9:51                   ` Bozhidar Batsov
2013-12-20 11:57                     ` Dmitry Gutov
2013-12-20 15:46                       ` Bozhidar Batsov
2013-12-21 15:31                         ` Dmitry Gutov
2013-12-21 15:38                           ` Steve Purcell
2013-12-21 15:53                             ` Dmitry Gutov
2013-12-21 16:49                               ` Steve Purcell
2013-12-21 19:32                           ` Adam Doppelt
2013-12-22  2:01                             ` Dmitry Gutov
2013-12-19 13:47           ` Dmitry Gutov
2013-12-18 12:42 ` bug#16182: 24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens Stefan Monnier
2013-12-19  4:57   ` Dmitry Gutov
2013-12-19 13:47     ` Stefan Monnier
2013-12-18 17:57 ` bug#16182: Adam Sokolnicki
2013-12-19  4:48   ` bug#16182: Dmitry Gutov
2013-12-19 18:39 ` bug#16182: Adam Doppelt
2013-12-20 12:44 ` bug#16182: Adam Sokolnicki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B61DDD8463B34984B2ECBF9A00C01CB6@gmail.com \
    --to=bozhidar@batsov.com \
    --cc=16182@debbugs.gnu.org \
    --cc=adam.sokolnicki@gmail.com \
    --cc=dgutov@yandex.ru \
    --cc=steve@sanityinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.