David Vallner <david / vallner.net> writes:

> D??a Piatok 10 Február 2006 19:15 Edward Faulkner napísal:
>> (In emacs, use M-x indent-region)
>
> I also think you can run emacs in batch mode and have it reindent a whole file 
> somehow.
>
> What I couldn't figure out within the time I get sick of going through info 
> manuals is how to remap RUBY-REINDENT-NEWLINE-AND-INDENT (or however the 
> function is called) to RET in init.el or custom.el in a load hook for 
> ruby-mode.el short of hacking ruby-mode.el itself. Any budding (X)Emacs gurus 
> able to help?
>
> David Vallner

(add-hook 'ruby-mode-hook
          (lambda ()
            (define-key ruby-mode-map [return]
              'ruby-reindent-then-newline-and-indent)))