On Sat, Apr 20, 2002 at 07:27:18AM +0900, Soso Chs wrote:
> 
>  hi all,
>  
>     I'm new both to ruby and xemacs(emacs), I used xemacs with ruby-mode.el and
>  it seems nice but the identation mechanism behaves a little strange (for me I
>  guess :))). I loaded a ruby program and when I hit enter at the end of an
>  idented line the cursor moves at the begining of the new line. By hitting tab
>  then it moves at the same identation level as the previous line. Is this normal
> ?? Shouldnt move at the same identation level from the first time, when I hit
> enter without having to hit enter?
>     Also, I use a 4 char tab and all of the ruby files from examples, etc use a 
>  2 char tab and the identation it doesnt work as it supposed to be anymore.
>  
>  I would appreciate some hints if someone knows how to handle all of this.
>  
>  thanx in advance
>    sosos

(defun my-ruby-setup ()
  "My Ruby Mode Settings"
  (local-set-key [return] 'ruby-reindent-then-newline-and-indent) ; this fixes the newlines
  (setq tab-width 2)                                              ; if you choose to, this line 
                                                                  ; sets tabs for ruby mode
)
(add-hook 'ruby-mode-hook 'my-ruby-setup)

Tabs, tab width, and spaces are a classic flamewar topic which I hesitate to step into... :)
But you can read about how to set you emacs to handle it one way or another
in the Emacs info file.  Just hit "C-h i" to bring up the info directory and
head to the emacs section.  Search for "Indentation" and "Indentation for programs"

Finally, you can search the emacs customization settings by "M-x customize-apropos"
and searching for tab and/or indent.

-- 
Alan Chen
Digikata LLC
http://digikata.com