unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Artur Malabarba <bruce.connor.am@gmail.com>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 32496@debbugs.gnu.org, Bozhidar Batsov <bozhidar@batsov.com>
Subject: bug#32496: 27.0.50; Strange indentation when ruby-align-chained-calls is t
Date: Sat, 27 Oct 2018 19:22:16 -0300	[thread overview]
Message-ID: <CAAdUY-J0jWJV16caE+R9X3xwawJmqVxE7vLZbxh9np+Zgvd_Zg@mail.gmail.com> (raw)
In-Reply-To: <fb11a9a6-85df-07e7-9d76-613a261a482e@yandex.ru>

[-- Attachment #1: Type: text/plain, Size: 1669 bytes --]

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 <dgutov@yandex.ru> 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.
>

[-- Attachment #2: Type: text/html, Size: 2524 bytes --]

  reply	other threads:[~2018-10-27 22:22 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 [this message]
2018-11-18  8:36     ` Bozhidar Batsov
2021-09-01  9:53       ` Lars Ingebrigtsen
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CAAdUY-J0jWJV16caE+R9X3xwawJmqVxE7vLZbxh9np+Zgvd_Zg@mail.gmail.com \
    --to=bruce.connor.am@gmail.com \
    --cc=32496@debbugs.gnu.org \
    --cc=bozhidar@batsov.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).