From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.bugs Subject: bug#32496: 27.0.50; Strange indentation when ruby-align-chained-calls is t Date: Sat, 27 Oct 2018 19:22:16 -0300 Message-ID: References: Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000746a4305793d45fc" X-Trace: blaine.gmane.org 1540678897 3179 195.159.176.226 (27 Oct 2018 22:21:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 27 Oct 2018 22:21:37 +0000 (UTC) Cc: 32496@debbugs.gnu.org, Bozhidar Batsov To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 28 00:21:32 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 1gGWxY-0000ih-6i for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Oct 2018 00:21:32 +0200 Original-Received: from localhost ([::1]:38010 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGWze-0001mr-MA for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Oct 2018 18:23:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gGWz4-0001Yq-Fk for bug-gnu-emacs@gnu.org; Sat, 27 Oct 2018 18:23:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gGWz0-0005Oy-HC for bug-gnu-emacs@gnu.org; Sat, 27 Oct 2018 18:23:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41759) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gGWz0-0005Ot-CG for bug-gnu-emacs@gnu.org; Sat, 27 Oct 2018 18:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gGWz0-0000uT-6n for bug-gnu-emacs@gnu.org; Sat, 27 Oct 2018 18:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Artur Malabarba Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Oct 2018 22:23: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.15406789563453 (code B ref 32496); Sat, 27 Oct 2018 22:23:02 +0000 Original-Received: (at 32496) by debbugs.gnu.org; 27 Oct 2018 22:22:36 +0000 Original-Received: from localhost ([127.0.0.1]:46017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGWya-0000td-8E for submit@debbugs.gnu.org; Sat, 27 Oct 2018 18:22:36 -0400 Original-Received: from mail-it1-f172.google.com ([209.85.166.172]:34908) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGWyY-0000tQ-Di for 32496@debbugs.gnu.org; Sat, 27 Oct 2018 18:22:34 -0400 Original-Received: by mail-it1-f172.google.com with SMTP id p64-v6so5622566itp.0 for <32496@debbugs.gnu.org>; Sat, 27 Oct 2018 15:22:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=ZywxLgF8yl9wMuR6oAZxDl+n0Rx7i2lGvlia9NaPc5s=; b=Q3/X2yqBap3vHDhPyxU3bGLQrzBkfN3+cbTmYS0puI0vyAAcUMPB64BAc7VVpxQRjf dHjAUDORvW84tfOWrFRPjtsuBN4UV7vWhplYzjruAu/mS9V8aeTkg4ejW/jhmiFh+HOF PmXhqNhfMeHUOX2RTGRb1npQqmWpPZw/CTGY9ECrnAxEfINDCn22lkvKc4kI9yTMkyl5 zIDODIVplIuZ7E2g5QAHThugByljJ42reSVy20UiD5fi01VXl1xWbR4HBKZSS1X56Wl1 USYUbet1C6KD4nu05v614ZEC9m3fPIzG25x/fQAQRi1Bx/WabJwDBdhIdOr5RinzNY31 CyfQ== 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:reply-to :from:date:message-id:subject:to:cc; bh=ZywxLgF8yl9wMuR6oAZxDl+n0Rx7i2lGvlia9NaPc5s=; b=O/m/aBdnU+uap8AjBCJtVL8GaXMyomYYumWCYpQohVf0rA+f3Ut7Fbzj7ruIS74IcD 2lgvnNwKqx4p8tEj1jS2iAacScbyxHo1eEyO1NOtrydb0wJ7tCg+3br8zzgDfXS+7rJ+ Y5+omHunTjQKRCNL9WAyL5yylOu2dqbKCnB0531iAMC22vPKKQq20l7XoEJ1CvR2R2/l pM6Z/rUpRhha7ltMJIFQKpZfSNpWfI/RRaFS9KK1mpzCjBN3084ABEhC7XUng5VMaoZK FD1jIivX1/a7T3hpPPn0ADtv3p8ZnXqxKPqUKNfyh9/xlZFxXPXseKh+RsM0cbZtxebY FsoA== X-Gm-Message-State: AGRZ1gKnVCQjKi4UZHU11kJxgkG0Bf51mM89BoNBS6pXZSgNG2qB9dym OSVxkwWd7H8pV2oPQmflTx1H8NBv8o1cjMRn678= X-Google-Smtp-Source: AJdET5cpxJafrF+5JrID0VQwrpyyYylWZU/sa/wCPWiL1FLCnIxDo4y++8plrtdAXMnaFqf00D9COCJYlTmQXfqQpUQ= X-Received: by 2002:a02:97cf:: with SMTP id v15-v6mr6091039jaj.82.1540678948774; Sat, 27 Oct 2018 15:22:28 -0700 (PDT) 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:151721 Archived-At: --000000000000746a4305793d45fc Content-Type: text/plain; charset="UTF-8" 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. > --000000000000746a4305793d45fc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
IIUC, bozhidar was requesting that the dots be aligne= d 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.<= /div>

The linked github comment does explicitly request = the aligning to the last dot, but it's the only comment that requests t= hat 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)
>=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.
--000000000000746a4305793d45fc--