From: George Ogata Date: 2005-08-30T21:41:33+09:00 Subject: Re: Question about emacs indentation "Sam Kong" writes: > Hi, Konstantin! > > Konstantin Levinski wrote: >> I think I can help with explanation of why emacs behaves as it does, >> and maybe you'd agree that it makes sense. > > Now I understand it. > But it's hard to change habit. > Do you think the emacs way is better? I got used to using C-j instead of RETs and TABs. Give it a bash. >> in emacs/ruby means (ruby-indent-command), which parses vicinity >> of cursor and figures out correct identation. that is, it is not "add a >> tab" but "format this line". >> so to get desired result, you could just use 'end' >> or call (indent-region) - Ctl-Alt-\ - to indent the whole thing in one >> go later. >> >> This way you dont need to care about formatting at all, it's done >> correctly automatically. > > How can I keep tabs instead of spaces? For all modes by default: (set-default 'indent-tabs-mode t) For just ruby-mode: (add-hook 'ruby-mode-hook (lambda () (setq indent-tabs-mode t)))