From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bozhidar Batsov Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <874n66byoo.fsf@yandex.ru> <52B11F12.4070109@yandex.ru> <490C2BFA3C624DB6AB057CD2AA393D9C@gmail.com> <87txe5v4ol.fsf@yandex.ru> <1E72CA8B046B46A6B320EBB9A71FF8CA@gmail.com> <395424D4599947EBA14047DBA9440BB1@gmail.com> <52B329C1.9050602@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="52b35828_1cdce2de_206" X-Trace: ger.gmane.org 1387485194 15054 80.91.229.3 (19 Dec 2013 20:33:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Dec 2013 20:33:14 +0000 (UTC) Cc: Steve Purcell , 16182@debbugs.gnu.org, Adam Sokolnicki To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 19 21:33:19 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VtkHX-0006J2-9o for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Dec 2013 21:33:19 +0100 Original-Received: from localhost ([::1]:46275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtkHW-0003ni-TC for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Dec 2013 15:33:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtkHM-0003fs-Qp for bug-gnu-emacs@gnu.org; Thu, 19 Dec 2013 15:33:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtkHG-0002RI-6e for bug-gnu-emacs@gnu.org; Thu, 19 Dec 2013 15:33:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtkHG-0002RE-2c for bug-gnu-emacs@gnu.org; Thu, 19 Dec 2013 15:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VtkHF-0001vq-Sa for bug-gnu-emacs@gnu.org; Thu, 19 Dec 2013 15:33:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Bozhidar Batsov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Dec 2013 20:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16182 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16182-submit@debbugs.gnu.org id=B16182.13874851747410 (code B ref 16182); Thu, 19 Dec 2013 20:33:01 +0000 Original-Received: (at 16182) by debbugs.gnu.org; 19 Dec 2013 20:32:54 +0000 Original-Received: from localhost ([127.0.0.1]:59007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VtkH6-0001vR-Uq for submit@debbugs.gnu.org; Thu, 19 Dec 2013 15:32:53 -0500 Original-Received: from mail-ea0-f182.google.com ([209.85.215.182]:51829) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VtkH3-0001vH-QL for 16182@debbugs.gnu.org; Thu, 19 Dec 2013 15:32:50 -0500 Original-Received: by mail-ea0-f182.google.com with SMTP id a15so678804eae.13 for <16182@debbugs.gnu.org>; Thu, 19 Dec 2013 12:32:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:message-id:in-reply-to:references:subject :mime-version:content-type; bh=3ATF4d9p2T6pqrM0q1CTSQUKZ9EGkx80iumpdraBJvE=; b=0S2VwGmtHFYLha/4Pb1orNTYcm4nX0SMYoYphQbbgbmEwRkQlmcNuwygG3vlw8zCn/ aPyiJmDqFzxll3ho+CWrW2rglFBO1zLVJWrSTD9c0LGarrvxMqoX5hupAszgHWubwuEN x4/Q6qPEyAkLjUUe9Hy6/djAP6+7hDKcDRU0fO313Dust0vbFeWYe1MHznJwds3NUELN MBTvnbLuXLl5b+OeQTmzr3LIsWFfIBzGu7eetxV7wmlYzE3A/6p47sAGxLSIYKD2pR+f eqHLifqdYynmLQKqwACU9TwmCn/ujNhvpX4m4AK5ackabP11dZXWg68oNrLteRWhMVWZ pVNQ== X-Received: by 10.15.86.75 with SMTP id h51mr532819eez.44.1387485169024; Thu, 19 Dec 2013 12:32:49 -0800 (PST) Original-Received: from [10.0.1.3] (93-152-182-45.ddns.onlinedirect.bg. [93.152.182.45]) by mx.google.com with ESMTPSA id n1sm12425322eep.20.2013.12.19.12.32.47 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 19 Dec 2013 12:32:48 -0800 (PST) In-Reply-To: <52B329C1.9050602@yandex.ru> X-Mailer: sparrow 1.6.4 (build 1178) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:82247 Archived-At: --52b35828_1cdce2de_206 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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: > > =20 > > res =3D method do =7Cx, y=7C > > something > > end > > =20 > > Might make sense to indent those like: > > =20 > > res =3D method do =7Cx, y=7C > > something > > end > > =20 > > for consistency with the if/unless/case indentation by default. > =20 > It might be more consistent, but I don't see any projects doing that. =20 > =46or example, ActiveRecord, Grape, Goliath and Rack don't. > =20 > Check out the examples at the top: > =20 > https://github.com/rails/rails/blob/master/activerecord/lib/active=5Fre= cord/base.rb > =20 > https://github.com/rack/rack/blob/master/lib/rack/builder.rb > =20 > It can be an option, though. Part of the reason people are not using a particular style from time to t= ime is simply lack of tool support. :-) I guess more people would have us= ed that style if their editor supported it. > =20 > --- > =20 > Come to think of it, do you see the =22align end to the keyword=22 styl= e =20 > much=3F I did a grep on my gems directory, and the other style seems to= be =20 > prevalent, especially among the non-core gems: > =20 > Pry, RDoc, Minitest, Rubygems, EventMachine, Nokogiri align to keyword.= > =20 > ActiveRecord, ActiveSupport, other Active* gems, Cucumber, Thor, Grape,= =20 > Excon, WebMock, =46araday align to the beginning of the statement. > =20 > RSpec uses both. Yard aligns to keyword after =22=3D=22, but to stateme= nt =20 > after =22=7C=7C=3D=22. > =20 > Maybe we even should align to the statement by default, because, you =20 > know, Rails. > =20 > =20 Well, even though I develop Rails apps for a living I wouldn=E2=80=99t sa= y the style used in the Rails codebase should be considered some gold sta= ndard - after all they are outdenting =E2=80=9Cprivate/protected=E2=80=9D= there :-) That said - before I started using programming Ruby in Emacs I= aligned to the beginning of the statement, but I stopped because this wa= sn=E2=80=99t supported in ruby-mode. After using the alignment to keyword= style for several years I=E2=80=99ve grown to like it a lot (and it seem= s others are enjoying it as well http://stackoverflow.com/questions/29250= 28/how-do-you-assign-a-variable-with-the-result-of-a-if-else-block). I=E2= =80=99m perfectly fine with alignment to statement becoming the default (= although the change of this default would be fairly visible/disruptive, s= ince as it stands keyword alignment is the only supported style and I gue= ss most Rubyists using Emacs employ it). =20 =20 > =20 > > Also: > > =20 > > res =3D > > method do =7Cx, y=7C > > something > > end > > =20 > > is actually indented like this: > > =20 > > res =3D > > method do =7Cx, y=7C > > something > > end > > =20 > =20 > =20 > Guess we can special-case this. That=E2=80=99d be great. =20 --52b35828_1cdce2de_206 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
On Th= ursday, December 19, 2013 at 7:15 PM, Dmitry Gutov wrote:
On 19.12.2013 14:54, Bozhidar Ba= tsov wrote:
I can confirm th= at your method args indentation fix is working. I did,
however,= notice the following problem after I mentioned the
if/unless/c= ase with assignment indentation. Consider the following:

res =3D method do =7Cx, y=7C
something
en= d

Might make sense to indent those like:

res =3D method do =7Cx, y=7C
some= thing
end

for consistency wi= th the if/unless/case indentation by default.

It might be more consistent, but I don't see any project= s doing that.
=46or example, ActiveRecord, Grape, Goliath and = Rack don't.


It can be an option, though.
=
Part of the reason people are not us= ing 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 suppor= ted it.

---

Come to think of it, = do you see the =22align end to the keyword=22 style
much=3F 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, =46araday align to th= e beginning of the statement.

RSpec uses both. Y= ard aligns to keyword after =22=3D=22, but to statement
after = =22=7C=7C=3D=22.

Maybe we even should align to t= he statement by default, because, you
know, Rails.
=
Well, even though I develop Rails apps for= a living I wouldn=E2=80=99t say the style used in the Rails codebase sho= uld be considered some gold standard - after all they are outdenting =E2=80= =9Cprivate/protected=E2=80=9D there :-) That said - before I started usin= g programming Ruby in Emacs I aligned to the beginning of the statement, = but I stopped because this wasn=E2=80=99t supported in ruby-mode. After u= sing the alignment to keyword style for several years I=E2=80=99ve grown = to like it a lot (and it seems others are enjoying it as well http://stackoverflow.com/ques= tions/2925028/how-do-you-assign-a-variable-with-the-result-of-a-if-else-b= lock). I=E2=80=99m perfectly fine with alignment to statement becomin= g the default (although the change of this default would be fairly visibl= e/disruptive, since as it stands keyword alignment is the only supported = style and I guess most Rubyists using Emacs employ it). 
&= nbsp;

Also:
<= br>
res =3D
method do =7Cx, y=7C
so= mething
end

is actually indented li= ke this:

res =3D
method do =7Cx, y=7C=
something
end

Guess we can special-case this.
That=E2=80=99d be great. 
=20

--52b35828_1cdce2de_206--