Ruby syntax highlight, code folding with emacs

I am trying to get Ruby syntax highlighting and code folding to work with
gnu emacs. I’ve loaded the necessary .el files (ruby-mode, inf-ruby,
rubydb3x). Turned on syntax highlighting (Global font lock mode).

But I cannot get

  • *.rb files to automatically enter Ruby mode
  • syntax highlights (after I manually set ruby mode)

Separately, is there any code-folding (major or minor) mode available?

Any pointers appreciated.

Thanks

I am trying to get Ruby syntax highlighting and code folding to work
with
gnu emacs. I’ve loaded the necessary .el files (ruby-mode, inf-ruby,
rubydb3x). Turned on syntax highlighting (Global font lock mode).

But I cannot get

  • *.rb files to automatically enter Ruby mode

(setq auto-mode-alist
(append '((“\.rb$” . ruby-mode)
(“\.rhtml$” . ruby-mode)
(“\.gem$” . ruby-mode)
(“\.gemspec$” . ruby-mode)
(“[Rr]akefile” . ruby-mode))
auto-mode-alist))

  • syntax highlights (after I manually set ruby mode)

(setq ruby-mode-hook '(lambda () (font-lock-mode 1)))

Separately, is there any code-folding (major or minor) mode available?

I’m not sure. However, from the docs for set-selective-display

C-x $ runs the command set-selective-display
which is an interactive compiled Lisp function in `simple’.
(set-selective-display ARG)

Set selective-display' to ARG; clear it if no arg. When the value of selective-display’ is a number > 0,
lines whose indentation is >= that value are not displayed.
The variable `selective-display’ has a separate value for each buffer.

Jim

···

On May 6, 2004, at 7:13 PM, Its Me wrote:

Jim Menard, jimm@io.com, http://www.io.com/~jimm/
“The American legal system is, of course, just the British kernel with a
shorter uptime and a few clumsy security patches slapped in.”
www.ntk.net