all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Bozhidar Batsov <bozhidar@batsov.com>
Cc: 32496@debbugs.gnu.org,
	Artur Malabarba <bruce.connor.am@gmail.com>,
	Dmitry Gutov <dgutov@yandex.ru>
Subject: bug#32496: 27.0.50; Strange indentation when ruby-align-chained-calls is t
Date: Wed, 01 Sep 2021 11:53:16 +0200	[thread overview]
Message-ID: <87r1e8ei5v.fsf@gnus.org> (raw)
In-Reply-To: <CAM9Zgm1qLgskP1mLNCB6CD6WVw7vPPqPHnMH8_cS32n3V1QTaQ@mail.gmail.com> (Bozhidar Batsov's message of "Sun, 18 Nov 2018 09:36:17 +0100")

Bozhidar Batsov <bozhidar@batsov.com> 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





  reply	other threads:[~2021-09-01  9:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-22 11:36 bug#32496: 27.0.50; Strange indentation when ruby-align-chained-calls is t Artur Malabarba
2018-08-22 12:50 ` Dmitry Gutov
2018-10-27 22:22   ` Artur Malabarba
2018-11-18  8:36     ` Bozhidar Batsov
2021-09-01  9:53       ` Lars Ingebrigtsen [this message]
2021-09-01 10:02         ` Bozhidar Batsov
2021-09-02  6:55           ` Lars Ingebrigtsen
2021-09-08 19:01             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-09 14:25               ` Lars Ingebrigtsen
2020-09-11 17:16 ` Wendel Scardua

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r1e8ei5v.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=32496@debbugs.gnu.org \
    --cc=bozhidar@batsov.com \
    --cc=bruce.connor.am@gmail.com \
    --cc=dgutov@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.