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 14:54:56 +0200 Message-ID: <395424D4599947EBA14047DBA9440BB1@gmail.com> References: <874n66byoo.fsf@yandex.ru> <52B11F12.4070109@yandex.ru> <490C2BFA3C624DB6AB057CD2AA393D9C@gmail.com> <87txe5v4ol.fsf@yandex.ru> <1E72CA8B046B46A6B320EBB9A71FF8CA@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="52b2eca0_3f06ecb2_1c26" X-Trace: ger.gmane.org 1387457771 31626 80.91.229.3 (19 Dec 2013 12:56:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Dec 2013 12:56:11 +0000 (UTC) Cc: Steve Purcell , Adam Sokolnicki To: 16182@debbugs.gnu.org, Gutov Dmitry Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 19 13:56:17 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 1Vtd9E-0004y0-Ho for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Dec 2013 13:56:16 +0100 Original-Received: from localhost ([::1]:43693 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vtd9E-0003iW-7E for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Dec 2013 07:56:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vtd97-0003iJ-EA for bug-gnu-emacs@gnu.org; Thu, 19 Dec 2013 07:56:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vtd91-0005qP-FG for bug-gnu-emacs@gnu.org; Thu, 19 Dec 2013 07:56:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vtd91-0005qJ-BA for bug-gnu-emacs@gnu.org; Thu, 19 Dec 2013 07:56:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Vtd90-0004ky-AR for bug-gnu-emacs@gnu.org; Thu, 19 Dec 2013 07:56:02 -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 12:56:02 +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.138745770618184 (code B ref 16182); Thu, 19 Dec 2013 12:56:02 +0000 Original-Received: (at 16182) by debbugs.gnu.org; 19 Dec 2013 12:55:06 +0000 Original-Received: from localhost ([127.0.0.1]:58308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vtd85-0004jA-BD for submit@debbugs.gnu.org; Thu, 19 Dec 2013 07:55:06 -0500 Original-Received: from mail-ea0-f171.google.com ([209.85.215.171]:34793) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vtd81-0004ih-4d for 16182@debbugs.gnu.org; Thu, 19 Dec 2013 07:55:02 -0500 Original-Received: by mail-ea0-f171.google.com with SMTP id h10so456267eak.2 for <16182@debbugs.gnu.org>; Thu, 19 Dec 2013 04:55:00 -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=6WYUNdAEfXpqcHSaex6a76R3cz7iwS3u4GP2HzZSIR4=; b=zjJbQHS33IPU6h0bTkg8CFav0NBTNQLfblhROyHgm4VjhU9TOt1YQ0j9xUnUYOES3V 4J6fEOdX5cQKdljPpx3hHt44QBw4JB11BkX0b/odxgqM9n7E2+/r2F2IwPjKg263MOWF mPffuejR1y9L1q4rFUgNncpROVUCyZlxDOdEjmiy+HzdiNNI/Nv2COu3xsja4afVz1JB O88jY/XbAH5B8U3ww+WLxqmuMfWbQZpTB8OkR9SdJ3/Ds4asnLcXpe1b4nXgEhyO1NAU ZvkRrSCFlX8wXj1UlRMMbYT1KTW1kNxyrQYB6npziaI5iIjX1vHTO0XCN5fKONchxTm1 9Feg== X-Received: by 10.14.150.5 with SMTP id y5mr295370eej.73.1387457699984; Thu, 19 Dec 2013 04:54:59 -0800 (PST) Original-Received: from [192.168.1.28] ([95.87.231.111]) by mx.google.com with ESMTPSA id g47sm9130064eeo.19.2013.12.19.04.54.57 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 19 Dec 2013 04:54:58 -0800 (PST) In-Reply-To: <1E72CA8B046B46A6B320EBB9A71FF8CA@gmail.com> 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:82214 Archived-At: --52b2eca0_3f06ecb2_1c26 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I can confirm that your method args indentation fix is working. I did, ho= wever, notice the following problem after I mentioned the if/unless/case = with assignment indentation. Consider the following: res =3D method do =7Cx, y=7C something end Might make sense to indent those like: res =3D method do =7Cx, y=7C something end for consistency with the if/unless/case indentation by default. Also: res =3D method do =7Cx, y=7C something end is actually indented like this: res =3D method do =7Cx, y=7C something end -- =20 Cheers, Bozhidar On Thursday, December 19, 2013 at 11:08 AM, Bozhidar Batsov wrote: > On Thursday, December 19, 2013 at 6:35 AM, Dmitry Gutov wrote: > > Bozhidar Batsov writes: > > =20 > > > Personally I dislike this style, because you=E2=80=99re basically i= t obscures > > > the semantics of the method arguments, but I acknowledge that I=E2=80= =99ve > > > seen it the wild. > > > =20 > > =20 > > =20 > > Ok, that's a -1, then. > > =20 > > > =46or me it would be more beneficial if we supported a > > > variant of the style: > > > =20 > > > methods.each do =7Cmethod=7C > > > route=5Fset.add=5Froute( > > > self, =7B > > > path=5Finfo: route.route=5Fcompiled, > > > request=5Fmethod: method, > > > =7D, route=5Finfo: route > > > ) > > > end > > > =20 > > =20 > > =20 > > Should work now, with revision 115602. > > =20 > > > Something that=E2=80=99s not mentioned here, but it=E2=80=99s a big= ger problem for the > > > users is probably the fact that we don=E2=80=99t support the follow= ing > > > indentation style: > > > =20 > > > x =3D if something > > > do=5Fsomething > > > end > > > =20 > > > Even if I don=E2=80=99t use and (and the majority of Ruby hackers A= =46AIK) it=E2=80=99s > > > still fairly popular. > > > =20 > > =20 > > =20 > > It's actually easy to do now, but the old engine doesn't support that= > > either. That should be takes as evidence that Emacs Rubyists don't ca= re > > about this variant much (I didn't see it in feature requests either).= > > =20 > > So I'd rather wait for a request from someone who actually would use = it. > > If you'd like to add it now, please propose the name of the user opti= on. > > =20 > > =20 > > =20 > =20 > I recall seeing StackOverflow questions about this in Emacs, but as I n= either practice nor promote this style I=E2=80=99m indifferent to support= ing it in Emacs. I do, however, support it in RuboCop (https://github.com= /bbatsov/rubocop/issues/661). If we decide to have it in Emacs we might u= se a similar name for the config variable - =60ruby-end-alignment=E2=80=99= with two options - =E2=80=98keword and =E2=80=98assignment. =20 > =20 --52b2eca0_3f06ecb2_1c26 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
I can confirm that yo= ur method args indentation fix is working. I did, however, notice the fol= lowing problem after I mentioned the if/unless/case with assignment inden= tation. Consider the following:

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

Might make sense to indent those like:
=

res =3D m= ethod do =7Cx, y=7C
           so= mething
         end
<= br>
for consistency= with the if/unless/case indentation by default. Also:
<= font face=3D=22Trebuchet MS=22>
res =3D
  method do =7Cx, y=7C
    something
  end

is actually indented like this:

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

-- 
Cheers,
Bozhidar

=
=20

On Thursday, December = 19, 2013 at 11:08 AM, Bozhidar Batsov wrote:

On Th= ursday, December 19, 2013 at 6:35 AM, Dmitry Gutov wrote:
Bozhidar Batsov <bozhidar=40batsov.com> writes:

Personally I dis= like this style, because you=E2=80=99re basically it obscures
t= he semantics of the method arguments, but I acknowledge that I=E2=80=99ve=
seen it the wild.

= Ok, that's a -1, then.

=
=46or me it would be more beneficial if we supported a
variant of the style:

methods.each do =7Cmetho= d=7C
route=5Fset.add=5Froute(
self, =7B
path=5Finfo: route.route=5Fcompiled,
request=5Fm= ethod: method,
=7D, route=5Finfo: route
)
=
end

Should work now, wit= h revision 115602.

Something that=E2=80=99s not mentioned here, but it=E2=80=99s a big= ger problem for the
users is probably the fact that we don=E2=80= =99t support the following
indentation style:

x =3D if something
do=5Fsomething
end

Even if I don=E2=80=99t use and (and the majority of Ru= by hackers A=46AIK) it=E2=80=99s
still fairly popular.

It's actually easy to do now, but the= old engine doesn't support that
either. That should be takes a= s evidence that Emacs Rubyists don't care
about this variant mu= ch (I didn't see it in feature requests either).

So I'd rather wait for a request from someone who actually would use it.=
If you'd like to add it now, please propose the name of the us= er option.
=20 =20 =20 =20
I recall seeing StackOverflow questions about th= is in Emacs, but as I neither practice nor promote this style I=E2=80=99m= indifferent to supporting it in Emacs. I do, however, support it in Rubo= Cop (https://github.com/bbatsov/rubocop/issues/= 661). If we decide to have it in Emacs we might use a similar name fo= r the config variable - =60ruby-end-alignment=E2=80=99 with two options -= =E2=80=98keword and =E2=80=98assignment.  

=20 =20 =20 =20 =20

--52b2eca0_3f06ecb2_1c26--