From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Bozhidar Batsov Newsgroups: gmane.emacs.bugs Subject: bug#32496: 27.0.50; Strange indentation when ruby-align-chained-calls is t Date: Sun, 18 Nov 2018 09:36:17 +0100 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f695d5057aec4b95" X-Trace: blaine.gmane.org 1542530332 13018 195.159.176.226 (18 Nov 2018 08:38:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 18 Nov 2018 08:38:52 +0000 (UTC) Cc: 32496@debbugs.gnu.org, Dmitry Gutov To: Artur Malabarba Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 18 09:38:48 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gOIbP-0003Eq-Jg for geb-bug-gnu-emacs@m.gmane.org; Sun, 18 Nov 2018 09:38:47 +0100 Original-Received: from localhost ([::1]:51597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOIdR-0004ud-1v for geb-bug-gnu-emacs@m.gmane.org; Sun, 18 Nov 2018 03:40:53 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:58475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gOIdC-0004pZ-80 for bug-gnu-emacs@gnu.org; Sun, 18 Nov 2018 03:40:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gOIZi-0003AD-Td for bug-gnu-emacs@gnu.org; Sun, 18 Nov 2018 03:37:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54034) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gOIZi-00039y-N6 for bug-gnu-emacs@gnu.org; Sun, 18 Nov 2018 03:37:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gOIZi-0006A8-Fz for bug-gnu-emacs@gnu.org; Sun, 18 Nov 2018 03:37: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: Sun, 18 Nov 2018 08:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32496 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32496-submit@debbugs.gnu.org id=B32496.154253019823653 (code B ref 32496); Sun, 18 Nov 2018 08:37:02 +0000 Original-Received: (at 32496) by debbugs.gnu.org; 18 Nov 2018 08:36:38 +0000 Original-Received: from localhost ([127.0.0.1]:58292 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gOIZK-00069R-CX for submit@debbugs.gnu.org; Sun, 18 Nov 2018 03:36:38 -0500 Original-Received: from mail-wr1-f48.google.com ([209.85.221.48]:39910) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gOIZG-000698-Sn for 32496@debbugs.gnu.org; Sun, 18 Nov 2018 03:36:36 -0500 Original-Received: by mail-wr1-f48.google.com with SMTP id b13so28825744wrx.6 for <32496@debbugs.gnu.org>; Sun, 18 Nov 2018 00:36:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=batsov-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=81ooY8Vye9xF2bOtMHO0NI3obHdlmCRcHYxoCza1JEI=; b=wOaDWbwKZmNQ0RtjvrTpVt4TFzHlAa88wPCd4znGYCzSDfevUe/dPK0kV8C3hNcgnp lugPoyuL8Ku4MFiMiFgg7dhTghWgjifmWfMG0H4swDwT8INbByrBduvVhSEbS+nQcJWK 8ikY7s0McF5jN8Gcx1qVWPYmXvJzSZIGgvci+kOVNLWaLv1NRpXSLLUEtU8wt3Yreybk 6pEILCGb8xe+pm8FuYehZpZ6BTDVhBPZ+MUirgZiCT344GXxQtgu0xpdjLiXa7MAQt+I JWIPBl9O7DpWE7QY/3MhZ+UnGJ7parqD1mwEgmKth6HhfJyCNcGIoKRh0W2sFOKNLp1P 2X+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=81ooY8Vye9xF2bOtMHO0NI3obHdlmCRcHYxoCza1JEI=; b=oPUI5a/9935pyqzBzUfY1IxG0oaK/NhjouVsLtEVicSdjMi4qqtdVXTf2f+kB3LKtm Q7TzMRdqVUiKkpYiwOTrYCHZMn42IctsPR7+HVOcc3mV2lM+i/AhdZEZLhcV9mJtR6Dp Uk8zU1TJxR/45tmsflIpQ2xQzHqAZBmu+gqWdex2BOygMvzMURFu9CTH/ABuiDUKzY+O sZ7gemwbMNc6xvrJgk7wlF18jGpjIu3xoYGyqMgZCnrsBfIWTrTTIN98xuprvVA+EYF8 yXLvu1iH49spUmuZjdl2R35qfWFVih8Lbg6cMejDsn0K2qPnS5CXk64uYYTWlAhSANbG wGlg== X-Gm-Message-State: AA+aEWZVRGCvSPS7oz1SMk2b6NJx51L6tyQVW787FEQNDpyruOAJLhXc 2uRn7N0R//L81PgNYCz7pELWGXL5vpibfoALaLA= X-Google-Smtp-Source: AFSGD/UIGEDH10qej0Ol4tXpGeegj4hEyv9EnahA58rn+Z6NGDj3MeV2hjd4/WcTBDTo8wxFduqgQjnUZ+rtnsU49cE= X-Received: by 2002:a5d:42ce:: with SMTP id t14mr1683320wrr.51.1542530188873; Sun, 18 Nov 2018 00:36:28 -0800 (PST) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:152493 Archived-At: --000000000000f695d5057aec4b95 Content-Type: text/plain; charset="UTF-8" Sorry for the radio silence - I've been super busy lately. It's hard for me to understand the indentation in the examples in the email (as it seems the same to me). Very simply put - the idea is to align multi-line chained calls on the `.`, as opposed to just nest them under the root receiver as we'd normally do. I think Dmitry implemented this great and it's behaving just as it's supposed to be behaving. Perhaps you misunderstood how this was supposed to behave? What's the indentation you expected? On Sun, 28 Oct 2018 at 00:22, Artur Malabarba wrote: > IIUC, bozhidar was requesting that the dots be aligned to the dot above > (as opposed to being indented by only 2 spaces). He didn't say what should > happen if one of the lines has multiple dots in it. > > The linked github comment does explicitly request the aligning to the last > dot, but it's the only comment that requests that on a very long discussion > that was largely focused on a different topic (whether or not to use > trailing dots). > > Bozhidar, do you have an opinion on this? > > Artur > > > On Wed, 22 Aug 2018 at 09:50, Dmitry Gutov wrote: > >> On 8/22/18 2:36 PM, Artur Malabarba wrote: >> > 1. (setq ruby-align-chained-calls t) >> > 2. (setq ruby-use-smie t) >> > 3. Open a file in ruby-mode, insert the following and indent it >> > >> > ---------- >> > some_variable.where.not(x: nil) >> > .where(y: 2) >> > ---------- >> > >> > Expected behaviour: Nothing would happen, the code is already properly >> > indented. >> > >> > What actually happens: The code gets indented as follows >> > >> > ---------- >> > some_variable.where.not(x: nil) >> > .where(y: 2) >> > ---------- >> > >> > Note that this is conflicts with the indentation enforced by rubocop. >> >> I'd like to point out that this is exactly the behavior Bozhidar asked >> for, back when this variable was introduced. See: >> >> http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg01802.html >> >> and in particular the Example 1 in the referenced comment: >> >> >> https://github.com/rubocop-hq/ruby-style-guide/pull/176#issuecomment-18664622 >> >> So we even have a test (ruby-align-chained-calls) that check that the >> alignment is do to the last dot, and not to the first one. >> > --000000000000f695d5057aec4b95 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Sorry for the radio silence - I've been super bus= y lately.=C2=A0

It's hard for me to understand the = indentation in the examples in the email (as it seems the same to me). Very= simply put - the idea is to align multi-line chained calls on the `.`, as = opposed to just nest them under the root receiver as we'd normally do.<= div>
I think Dmitry implemented this great and it's behav= ing just as it's supposed to be behaving. Perhaps you misunderstood how= this was supposed to behave? What's the indentation you expected?=C2= =A0

On Sun, 28 O= ct 2018 at 00:22, Artur Malabarba <bruce.connor.am@gmail.com> wrote:
IIUC, bozhidar was requesting that the = dots be aligned to the dot above (as opposed to being indented by only 2 sp= aces). He didn't say what should happen if one of the lines has multipl= e dots in it.

The linked github comment does expli= citly request the aligning to the last dot, but it's the only comment t= hat requests that on a very long discussion that was largely focused on a d= ifferent topic (whether or not to use trailing dots).

<= div>Bozhidar, do you have an opinion on this?

=
Artur


On Wed, 22 Aug 2018 at 09:50, Dmitry Gut= ov <dgutov@yandex.= ru> wrote:
On 8/22/18 2:36 P= M, Artur Malabarba wrote:
> 1. (setq ruby-align-chained-calls t)
> 2. (setq ruby-use-smie t)
> 3. Open a file in ruby-mode, insert the following and indent it
>
> ----------
> some_variable.where.not(x: nil)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.where(y: 2)
> ----------
>
> Expected behaviour: Nothing would happen, the code is already properly=
> indented.
>
> What actually happens: The code gets indented as follows
>
> ----------
> some_variable.where.not(x: nil)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0.where(y: 2)
> ----------
>
> Note that this is conflicts with the indentation enforced by rubocop.<= br>
I'd like to point out that this is exactly the behavior Bozhidar asked =
for, back when this variable was introduced. See:

http://lists.gnu.org/archive/html= /emacs-devel/2014-01/msg01802.html

and in particular the Example 1 in the referenced comment:

https://github.com/rubo= cop-hq/ruby-style-guide/pull/176#issuecomment-18664622

So we even have a test (ruby-align-chained-calls) that check that the
alignment is do to the last dot, and not to the first one.
--000000000000f695d5057aec4b95--