From: alex fenton Date: 2004-06-17T19:38:24+09:00 Subject: Re: Emacs Ruby mode & indentation with the tab key wish/bug Hi Moritz Bunkus wrote: > 1) Continued statements should be indented with only ruby-indent-level > spaces. At the moment it produces something like this: > > myvar = 2 + 3 + > 4 + 1 > > I'd like to have it behave more like > > myvar = 2 + 3 + > 4 + 1 I think there's an already option for what you want, I think; the option's called ruby-deep-arglist, which you'll want to switch OFF to use your preferred style. Try the following in your .emacs (add-hook 'ruby-mode-hook '(lambda () (custom-set-variables '(ruby-deep-arglist 0)) )) > 2) Indentation with { } blocks is wrong. It does work nicely with e.g. > upto: .... > but not with "if...": > > if (i == 2) { > asdasd > } > > > After this passage tab indents to column 3, so this case is definitely > broken. Um, the case is broken, but I don't think it's the syntax highlighter :). You don't enclose conditional blocks in { } in Ruby - the 'if' (or 'unless' or 'elsif' or 'else') marks the beginning of the block itself, and you must use 'end' to mark the end of the block. You also don't usually need parens round the conditional statement, unlike Perl. So: if i == 2 puts "foo" end Aah ... isn't that lovely and readable? Cheers alex