Forum: Ruby Ruby syntax highlighting problem with Emacs

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Rich (Guest)
on 2006-01-06 06:37
(Received via mailing list)
I was attempting to install ruby support into my emacs installation by
following the directions at the RubyGarden.  When I load a ruby file,
Emacs switches to Ruby mode but doesn't do syntax highlighting.  Does
anybody have any insight?  Here is the relevant portion of my .emacs
file:

(autoload 'ruby-mode "ruby-mode"
  "Mode for editing ruby source files")
(add-to-list 'auto-mode-alist '("\\.rb\\'" . ruby-mode))
(add-hook 'ruby-mode-hook 'turn-on-font-lock) ;; <- Is supposed to
enable font lock.

(setq interpreter-mode-alist (append '(("^#!.*ruby" . ruby-mode))
                                     interpreter-mode-alist))

(setq ruby-indent-level 4)


I do not have ruby-electric.el installed, for the interested.  Thank
you.

-Rich
Edward F. (Guest)
on 2006-01-06 07:16
(Received via mailing list)
On Fri, Jan 06, 2006 at 01:35:38PM +0900, Rich wrote:
> When I load a ruby file, Emacs switches to Ruby mode but doesn't do
> syntax highlighting.  Does anybody have any insight?

Perhaps you need to turn syntax highlighting on in general:

(global-font-lock-mode 1)
Rich (Guest)
on 2006-01-06 16:08
(Received via mailing list)
That did it.  Thank you very much.
This topic is locked and can not be replied to.