From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!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: Wed, 01 Sep 2021 13:02:56 +0300 Message-ID: References: <87r1e8ei5v.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=3ab6a01989224e25873d6d7e393b4006 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14117"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.5.0-alpha0-1126-g6962059b07-fm-20210901.001-g6962059b Cc: 32496@debbugs.gnu.org, Artur Malabarba , Dmitry Gutov To: "Lars Ingebrigtsen" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 01 17:45:02 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLSQ8-0003Rj-Nn for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 Sep 2021 17:45:02 +0200 Original-Received: from localhost ([::1]:39012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLSQ5-0004Oo-Gd for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 Sep 2021 11:44:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52246) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLS8n-0000kO-KJ for bug-gnu-emacs@gnu.org; Wed, 01 Sep 2021 11:27:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55534) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mLS8l-0003Kb-QU for bug-gnu-emacs@gnu.org; Wed, 01 Sep 2021 11:27:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mLS8l-0006FA-Na for bug-gnu-emacs@gnu.org; Wed, 01 Sep 2021 11:27:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Bozhidar Batsov" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Sep 2021 15:27:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32496 X-GNU-PR-Package: emacs Original-Received: via spool by 32496-submit@debbugs.gnu.org id=B32496.163050999823914 (code B ref 32496); Wed, 01 Sep 2021 15:27:03 +0000 Original-Received: (at 32496) by debbugs.gnu.org; 1 Sep 2021 15:26:38 +0000 Original-Received: from localhost ([127.0.0.1]:38837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLS8L-0006Dd-GC for submit@debbugs.gnu.org; Wed, 01 Sep 2021 11:26:38 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:44709) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLN5X-00012c-Tq for 32496@debbugs.gnu.org; Wed, 01 Sep 2021 06:03:28 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 73FE65C0270; Wed, 1 Sep 2021 06:03:18 -0400 (EDT) Original-Received: from imap43 ([10.202.2.93]) by compute4.internal (MEProxy); Wed, 01 Sep 2021 06:03:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=batsov.dev; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm1; bh=X0VPYt3kGTPwtKQF1kSIMNRwUoZcv+F SD9rAj0kMEvQ=; b=MlFtalZKp5JjsRzGK30ciGPMxkBhz2klLkeKi/AL325aJG/ PHDhkZBiEP/MipKc0SHTrfg++SzmUlqNw3rgG7f6csjpjIFnBVvbCuFxo8/skn4O T7Cb3v6d2aFmMrDRNeImyC3/0fMdVbDFfwhgKxrIkT2nq/zei6OeLbXFJoY3ajsR YLq7nJqsw4MEyqU/9Tix09WszwyJiH6zM9VX6OmQW7jno1iU1ATZ7qs0CQHnHRjp gRUYj88GjumiKcOez9Znxc1QJn6luTzC4PAdHMguvqlbQa3Yu3Hgzn/3Cr6pyQd8 bTEM4/UwxClNXWlqavTy3nX3vSgfTr57/y6qIjg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=X0VPYt 3kGTPwtKQF1kSIMNRwUoZcv+FSD9rAj0kMEvQ=; b=fQOBG0J8isSX41NhmS/fvS gU/vPkMe+PDiu9s8BEi1F7n+sMLQZu5mDvmebiJov1fgUSHofSJl2qsao3M/xSGI Xd4v9+jGvgWeW9Nr2sdNRwnr7XwNKWeRFTkLa2gpgdEdmIrju4xncDbEIBYt6mp6 cO0HccLliiSpoX6iggr8lvZ7AFSitNuQayoDSdexmzM9SPhKgZPp6JDb0mPd6j9x VyANrvpYc2SH2Gn6gzOQr0PBUvJ2ys7cyXmpodNa7oVY7Dy+TA7dt/5W8QYnqVkS F15nR5z3CH5yvKMvzBtwzkZE2q07GKQRLF5PGrf1CKd+GboVyk+2HIDWBfMurDbA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddvfedgvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesrgdtreerreerjeenucfhrhhomhepfdeuohii hhhiuggrrhcuuegrthhsohhvfdcuoegsohiihhhiuggrrhessggrthhsohhvrdguvghvqe enucggtffrrghtthgvrhhnpeehkeevjeetvdelhfehleffkeevhffgieffhfelgedugeet udfgleetfeetheegteenucffohhmrghinhepihhnghgvsghrihhgthhsvghnrdhnohenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsohiihhhi uggrrhessggrthhsohhvrdguvghv X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4B588AC0DD0; Wed, 1 Sep 2021 06:03:17 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: <87r1e8ei5v.fsf@gnus.org> X-Mailman-Approved-At: Wed, 01 Sep 2021 11:26:36 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:213199 Archived-At: --3ab6a01989224e25873d6d7e393b4006 Content-Type: text/plain Ah, I finally understood the issue at hand! It's really hard to discuss indentation problems in e-mail. :D Yeah, I can confirm there's a bug when using (setq ruby-align-chained-calls t) in this example: some_variable.where.not(x: nil) .where(y: 2) The two `where`s should be lined up, but currently the second `where` is lined up with the `not`. some_variable.where.not(x: nil) .where(y: 2) I can also confirm that the first behavior is what RuboCop (Ruby's popular linter/formatter) expects, when configured for aligned chained method calls. On Wed, Sep 1, 2021, at 12:53 PM, Lars Ingebrigtsen wrote: > Bozhidar Batsov writes: > > > 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? > > (I'm going through old bug reports that unfortunately weren't resolved > at the time.) > > The examples were in HTML mail, so they were difficult to understand. > > Emacs (with (setq ruby-align-chained-calls t)) currently aligns like > this: > > some_variable.where > .not(x: nil) > .where(y: 2) > > Which is correct. However, when there's a mixture of keeping things on > one line and breaking, we get this: > > some_variable.where.not(x: nil) > .where(y: 2) > > I think the bug reporter wants: > > some_variable.where.not(x: nil) > .where(y: 2) > > I.e., align multiline chained calls on the first dot, not the last? > > (I don't know Ruby, so I have no opinion here.) > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no > --3ab6a01989224e25873d6d7e393b4006 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
Ah, I finally u= nderstood the issue at hand! It's really hard to discuss indentation pro= blems in e-mail. :D

Yeah, I can confirm the= re's a bug when using (setq ruby-align-chained-calls t) in this exa= mple:

some_variable.where.not(x: nil)
                  =        .where(y: 2)

The= two `where`s should be lined up, but currently the second `where` is li= ned up with the `not`.

some_variable.where.= not(x: nil)
            &nbs= p;                    =   .where(y: 2)

I can also confirm tha= t the first behavior is what RuboCop (Ruby's popular linter/formatter) e= xpects, when configured for aligned chained method calls. 

On Wed, Sep 1, 2021, at 12:53 PM, Lars Ingebrigtsen wro= te:

<= div>> It's hard for me to understand the indentation in the examples = in the email
> (as it seems the same to me). Very simpl= y 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 sup= posed
> to be behaving. Perhaps you misunderstood how t= his was supposed to
> behave? What's the indentation yo= u expected? 

(I'm going through old bu= g reports that unfortunately weren't resolved
at the time.= )

The examples were in HTML mail, so they w= ere difficult to understand.

Emacs (with (s= etq ruby-align-chained-calls t)) currently aligns like
thi= s:

some_variable.where
 =             .not(= x: nil)
        &n= bsp;    .where(y: 2)

Which i= s correct.  However, when there's a mixture of keeping things on
one line and breaking, we get this:

=
some_variable.where.not(x: nil)
   &nb= sp;           &nb= sp;   .where(y: 2)

I think the bu= g reporter wants:

some_variable.where.not(x= : nil)
        &nb= sp;    .where(y: 2)

I.e., al= ign multiline chained calls on the first dot, not the last?


--3ab6a01989224e25873d6d7e393b4006--