0

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?

harumph
  • 169
  • 3
  • 10
  • Here are two related threads on tabs with ruby-mode: http://stackoverflow.com/questions/22925053/indent-with-tab-instead-of-spaces-in-emacs-ruby-mode and http://stackoverflow.com/questions/2111041/change-emacs-ruby-mode-indent-to-4-spaces – lawlist Jun 18 '14 at 00:20
  • @lawlist They are related, but are separate issues. – harumph Jun 18 '14 at 14:00

2 Answers2

0

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.

Bozhidar Batsov
  • 55,802
  • 13
  • 100
  • 117
  • What do current ruby devs using emacs do? Hit the space bar? I mostly use Sublime Text, but I've been dabbling in emacs. This is the last pain point. Hopefully 24.4 is released soon :) – harumph Jun 18 '14 at 13:58
  • 1
    @harumph @h They probably use Emacs 24.4 pretest or Emacs trunk already. It's easy to install on OS X and Ubuntu, and there are builds for Windows as well, iirc. On OS X, it's generally recommendable, since it includes a fair amount of OS X-specific improvements as well. –  Jun 18 '14 at 14:32
0

Turns out you can configure this in 24.3:

(setq ruby-deep-indent-paren nil)
harumph
  • 169
  • 3
  • 10