harumph
harumph

Reputation: 179

How to configure emacs tabbing behavior

I've wrestled quite a bit with emacs tabbing, but haven't been able to figure this one out.

In ruby-mode:

SomeClass.create(
  this_is: where_i_want_to_tab,
  because: that_is_how_we_do_it
)

SomeClass.create(
                 this_is: where_emacs_wants_to_put_it,
                 but: my_pull_request_aint_gonna_be_merged_like_this
)

This is maybe a code style decision that the ruby-mode designers made, but is it possible to configure it?

Upvotes: 0

Views: 229

Answers (2)

harumph
harumph

Reputation: 179

Turns out you can configure this in 24.3:

(setq ruby-deep-indent-paren nil)

Upvotes: 0

Bozhidar Batsov
Bozhidar Batsov

Reputation: 56595

This behavior of ruby-mode cannot be configured, but it was changed in Emacs 24.4 (which will be released soon). There code like this:

SomeClass.create(
                 this_is: where_emacs_wants_to_put_it,
                 but: my_pull_request_aint_gonna_be_merged_like_this
)

will be indented like this:

SomeClass.create(
  this_is: where_i_want_to_tab,
  because: that_is_how_we_do_it
)

which is consistent with the existing good practices.

Upvotes: 0

Related Questions