Share your rails-mode config/customizations?

67 views
Skip to first unread message

Stephen Lacy

unread,
Sep 30, 2011, 4:16:47 PM9/30/11
to emacs-o...@googlegroups.com
Hi,

I'm struggling (as are others) with getting indentation correct, especially for function invocation without parenthesis.  for example, I want ruby-mode to indent as:

some_function :parameter, :other, 
  :indented_two_spaces, 
  :more_arguments_go_here 

Currently, the continued arguments are indented to the same level as the function invocation, and I've tried many different possibilities for ruby-deep-indent-paren, ruby-deep-indent-paren-style, etc, and none of the combinations seem to do what I want, although I could just be missing some other import config. 

If lines like that indent correctly (as above), then could you please share your ruby-mode related configuration values?  Thanks! 

Dmitry Gutov

unread,
Oct 8, 2011, 12:17:49 AM10/8/11
to Rails On Emacs
Hi Stephen,

See my answer for this question:
http://stackoverflow.com/questions/4412739/emacs-ruby-mode-indentation-behavior/7622971#7622971
(This is you in the comments, right?)

Works well enough so far.

It shouldn't be hard to change for your style, just replace `arg-
indent` with `(+ prev-indent 2)` in the `cond` at the bottom.

theturingmachine

unread,
Oct 9, 2011, 5:21:47 AM10/9/11
to Rails On Emacs
On a related note:

I've tried playing with ruby-deep-indent-paren set to nil. But I get,
this:

method(:arg1,
:arg2,
)

Is there any way I could make it do:

method(:arg1,
:arg2,
)

I'm using ruby mode from elpa, by the way

Greetings

On Oct 8, 6:17 am, Dmitry Gutov <raa...@gmail.com> wrote:
> Hi Stephen,
>
> See my answer for this question:http://stackoverflow.com/questions/4412739/emacs-ruby-mode-indentatio...

Dmitry Gutov

unread,
Oct 9, 2011, 10:43:06 PM10/9/11
to Rails On Emacs
I don't think you can get this by changing the settings.

Here's a little hack much like the one above: https://gist.github.com/1274520

On Oct 9, 1:21 pm, theturingmachine <theturingmach...@gmail.com>
wrote:

theturingmachine

unread,
Oct 16, 2011, 4:14:07 PM10/16/11
to Rails On Emacs
Thanks, it works for me
Reply all
Reply to author
Forward
0 new messages