On 8/15/06, Ryan Davis <ryand-ruby / zenspider.com> wrote:
>
> On Aug 15, 2006, at 9:20 AM, John Gabriele wrote:
>
> > So, how do I get emacs to recognize Ruby? Am I supposed to copy one or
> > more of the misc/*.el files to my ~/.emacs.d directory?
>
> Yes, and you want to add ruby-mode.el to the autoload list:
>
> (autoload 'ruby-mode "ruby-mode" "Mode for editing ruby source files")
> (add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
> (add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode))
> (autoload 'run-ruby "inf-ruby" "Run an inferior Ruby process")
> (autoload 'inf-ruby-keys "inf-ruby" "Set local key defs for inf-ruby
> in ruby-mode")

I appended those to my ~/.emacs file, but there's still no syntax
highlighting when I open a Ruby source file.

Also, you mention to add ruby-mode.el to the "autoload list", but you
have three lines above for adding stuff to this autoload list. Are
ruby-mode, run-ruby, and inf-ruby-keys three separate thingies inside
ruby-mode.el?

> Check out http://wiki.rubygarden.org/Ruby/page/show/
> InstallingEmacsExtensions

Thanks. That page says:

;; uncomment the next line if you want syntax highlighting
;;(add-hook 'ruby-mode-hook 'turn-on-font-lock)

but I've already got that (global-font-lock-mode t nil (font-lock)) in
my ~/.emacs file. Do I need that "add-hook" line too?

I've tried appending it to the end of ~/.emacs, but still no syntax
highlighting.

Also, I've read here and there on nntp://gnu.emacs.help that the way
I'm trying to get all spaces (and no tabs at all), with 4-space
indents:

|
| '(indent-tabs-mode nil)
| '(tab-width 4)
|

is "evil". Am I doing it right? So far, tabs seem to be coming out
just the way I want. :)

> poke around in there... there is some good stuff.
>
> > Also, are we supposed to use *both* ruby-mode and ruby-electric, or
> > instead, just one or the other?
>
> Yes on ruby-mode, maybe on ruby-electric. Drives me bonkers but you
> might like it.

What does ruby-electric do that ruby-mode doesn't? Do they overlap?
What is it about ruby-electric drives you nuts?

Thanks,
---John