Forum: Ruby-core [ruby-trunk - Bug #6854][Open] ruby-mode.el has radical changes in `ruby-deep-indent-paren' logic

Posted by dgutov (Dmitry Gutov) (Guest)
on 2012-08-11 01:05
(Received via mailing list)
Issue #6854 has been reported by dgutov (Dmitry Gutov).

----------------------------------------
Bug #6854: ruby-mode.el has radical changes in `ruby-deep-indent-paren' 
logic
https://bugs.ruby-lang.org/issues/6854

Author: dgutov (Dmitry Gutov)
Status: Open
Priority: Normal
Assignee: nobu (Nobuyoshi Nakada)
Category: misc
Target version:
ruby -v: ruby 1.9.2p290 (2011-07-09) [i386-mingw32]


The following commits make a non-backward compatible change in how 
`ruby-deep-indent-paren' works:

https://github.com/ruby/ruby/commit/85df40e9ab4559...
https://github.com/ruby/ruby/commit/6b0dc7fd81b25b...
https://github.com/ruby/ruby/commit/862048e28d2611...
https://github.com/ruby/ruby/commit/d9e6b7d6a5e81a...

Basically, the change disables deep-indent in all types of parens in 
(almost?) all situations.
If disabling deep-indent was the idea, I think changing the default 
value of this variable to nil would be sufficient.

Personally, I adopted another approach: deep-indent is on by default, 
but it's disabled when the first array element/call argument is not on 
the same line as the paren. This is similar to how indentation works in 
js-mode, for example.
To implement that, I imagine we'd need to make this check in 
`ruby-deep-indent-paren-p' instead of (ruby-expr-beg) call.

I can make a patch that would do that, but first I'd really like to see 
an explanation and/or examples of what exactly the changes above were 
meant to accomplish.
Posted by Nobuyoshi Nakada (nobu)
on 2012-12-03 03:44
(Received via mailing list)
Issue #6854 has been updated by nobu (Nobuyoshi Nakada).

Status changed from Open to Closed

Use Emacs-bundled ruby-mode.el.
----------------------------------------
Bug #6854: ruby-mode.el has radical changes in `ruby-deep-indent-paren' 
logic
https://bugs.ruby-lang.org/issues/6854#change-34335

Author: dgutov (Dmitry Gutov)
Status: Closed
Priority: Normal
Assignee: nobu (Nobuyoshi Nakada)
Category: misc
Target version:
ruby -v: ruby 1.9.2p290 (2011-07-09) [i386-mingw32]


The following commits make a non-backward compatible change in how 
`ruby-deep-indent-paren' works:

https://github.com/ruby/ruby/commit/85df40e9ab4559...
https://github.com/ruby/ruby/commit/6b0dc7fd81b25b...
https://github.com/ruby/ruby/commit/862048e28d2611...
https://github.com/ruby/ruby/commit/d9e6b7d6a5e81a...

Basically, the change disables deep-indent in all types of parens in 
(almost?) all situations.
If disabling deep-indent was the idea, I think changing the default 
value of this variable to nil would be sufficient.

Personally, I adopted another approach: deep-indent is on by default, 
but it's disabled when the first array element/call argument is not on 
the same line as the paren. This is similar to how indentation works in 
js-mode, for example.
To implement that, I imagine we'd need to make this check in 
`ruby-deep-indent-paren-p' instead of (ruby-expr-beg) call.

I can make a patch that would do that, but first I'd really like to see 
an explanation and/or examples of what exactly the changes above were 
meant to accomplish.
Posted by dgutov (Dmitry Gutov) (Guest)
on 2012-12-15 01:40
(Received via mailing list)
Issue #6854 has been updated by dgutov (Dmitry Gutov).


> Use Emacs-bundled ruby-mode.el.

I'm maintaining it.

Should I stop merging changes from this ruby-mode into Emacs-bundled 
version?
----------------------------------------
Bug #6854: ruby-mode.el has radical changes in `ruby-deep-indent-paren' 
logic
https://bugs.ruby-lang.org/issues/6854#change-34756

Author: dgutov (Dmitry Gutov)
Status: Closed
Priority: Normal
Assignee: nobu (Nobuyoshi Nakada)
Category: misc
Target version:
ruby -v: ruby 1.9.2p290 (2011-07-09) [i386-mingw32]


The following commits make a non-backward compatible change in how 
`ruby-deep-indent-paren' works:

https://github.com/ruby/ruby/commit/85df40e9ab4559...
https://github.com/ruby/ruby/commit/6b0dc7fd81b25b...
https://github.com/ruby/ruby/commit/862048e28d2611...
https://github.com/ruby/ruby/commit/d9e6b7d6a5e81a...

Basically, the change disables deep-indent in all types of parens in 
(almost?) all situations.
If disabling deep-indent was the idea, I think changing the default 
value of this variable to nil would be sufficient.

Personally, I adopted another approach: deep-indent is on by default, 
but it's disabled when the first array element/call argument is not on 
the same line as the paren. This is similar to how indentation works in 
js-mode, for example.
To implement that, I imagine we'd need to make this check in 
`ruby-deep-indent-paren-p' instead of (ruby-expr-beg) call.

I can make a patch that would do that, but first I'd really like to see 
an explanation and/or examples of what exactly the changes above were 
meant to accomplish.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.