From: Dmitry Gutov <dgutov@yandex.ru>
To: Bozhidar Batsov <bozhidar@batsov.com>
Cc: Steve Purcell <steve@sanityinc.com>,
16182@debbugs.gnu.org, Adam Doppelt <amd@gurge.com>,
Adam Sokolnicki <adam.sokolnicki@gmail.com>
Subject: bug#16182: Acknowledgement (24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens)
Date: Sat, 21 Dec 2013 17:31:14 +0200 [thread overview]
Message-ID: <52B5B442.3010908@yandex.ru> (raw)
In-Reply-To: <2B4249DE35244273B9602A8B72DB6C08@gmail.com>
On 20.12.2013 17:46, Bozhidar Batsov wrote:
> On Friday, December 20, 2013 at 1:57 PM, Dmitry Gutov wrote:
>> On 20.12.2013 11:51, Bozhidar Batsov wrote:
>>> Just a small nitpick - everything that returns a value is actually an
>>> expression, not a statement.
>>
>> It can be both (see "expression statement"). This way it's not
>> ambiguous, because I'm really aligning to the statement: the containing
>> expression, which follows the bob or an [implicit] semicolon.
>>
>> In Rubocop, you've chosen to align to just the parent expression. Maybe
>> we should find a realistic example where one would be different from the
>> other.
> I don’t quite understand what you mean.
This example is indented just like Robocop master likes with (AlignWith:
variable):
b = a = if 3 == 4
1
else
2
end
puts a
puts b
Someone correct me if I'm wrong, but I suspect that users who like less
indentation would prefer to have the `if' body and closer to be aligned
to the beginning of the statement, rather than to `a'.
That's what ruby-mode does now if `if' is in `ruby-align-to-stmt-keywords'.
Another reason to pick this behavior is that "align to parent" is harder
to implement. SMIE has no AST: we can find the position of the parent
token (=), but finding the position of `a' will require manual seeking.
And `a' could be more than a plan variable: maybe something like
`b[a+1]' or `foo[:bar][:qux]`.
`=' is also not the only operator we can handle. Aside from its
variations (||=, etc), we might want to support `||' and others.
And the left side of `||' can be an arbitrary expression.
next prev parent reply other threads:[~2013-12-21 15:31 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-18 3:55 bug#16182: 24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens Dmitry Gutov
[not found] ` <handler.16182.B.138733895212351.ack@debbugs.gnu.org>
2013-12-18 4:05 ` bug#16182: Acknowledgement (24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens) Dmitry Gutov
2013-12-18 10:31 ` Bozhidar Batsov
2013-12-19 4:35 ` Dmitry Gutov
2013-12-19 9:08 ` Bozhidar Batsov
2013-12-19 12:54 ` Bozhidar Batsov
2013-12-19 17:15 ` Dmitry Gutov
2013-12-19 20:33 ` Bozhidar Batsov
2013-12-19 20:42 ` Steve Purcell
2013-12-20 5:21 ` Dmitry Gutov
2013-12-20 9:51 ` Bozhidar Batsov
2013-12-20 11:57 ` Dmitry Gutov
2013-12-20 15:46 ` Bozhidar Batsov
2013-12-21 15:31 ` Dmitry Gutov [this message]
2013-12-21 15:38 ` Steve Purcell
2013-12-21 15:53 ` Dmitry Gutov
2013-12-21 16:49 ` Steve Purcell
2013-12-21 19:32 ` Adam Doppelt
2013-12-22 2:01 ` Dmitry Gutov
2013-12-19 13:47 ` Dmitry Gutov
2013-12-18 12:42 ` bug#16182: 24.3.50; ruby-mode: Indentation style of multiline literals with hanging open paren inside other parens Stefan Monnier
2013-12-19 4:57 ` Dmitry Gutov
2013-12-19 13:47 ` Stefan Monnier
2013-12-18 17:57 ` bug#16182: Adam Sokolnicki
2013-12-19 4:48 ` bug#16182: Dmitry Gutov
2013-12-19 18:39 ` bug#16182: Adam Doppelt
2013-12-20 12:44 ` bug#16182: Adam Sokolnicki
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=52B5B442.3010908@yandex.ru \
--to=dgutov@yandex.ru \
--cc=16182@debbugs.gnu.org \
--cc=adam.sokolnicki@gmail.com \
--cc=amd@gurge.com \
--cc=bozhidar@batsov.com \
--cc=steve@sanityinc.com \
/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.