GNU bug report logs - #32496
27.0.50; Strange indentation when ruby-align-chained-calls is t

Previous Next

Package: emacs;

Reported by: bruce.connor.am <at> gmail.com

Date: Wed, 22 Aug 2018 11:37:01 UTC

Severity: minor

Found in version 27.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #26 received at 32496 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Bozhidar Batsov" <bozhidar <at> batsov.dev>
Cc: 32496 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 Artur Malabarba <bruce.connor.am <at> gmail.com>, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: Re: bug#32496: 27.0.50; Strange indentation when
 ruby-align-chained-calls is t
Date: Thu, 02 Sep 2021 08:55:50 +0200
"Bozhidar Batsov" <bozhidar <at> batsov.dev> writes:

> 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`.

So this is coming from:

    ('(:before . ".")
     (if (smie-rule-sibling-p)
         (and ruby-align-chained-calls 0)
       (smie-backward-sexp ".")
       (cons 'column (+ (current-column)
                        ruby-indent-level))))

In the aligned case, I think we should back up to the first "." in the
chain and use that as the column?  But my SMIE-fu is pretty much
non-existent, so I've added Stefan to the CCs.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 257 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.