Friday, September 02, 2005

Getting emacs to syntax highlight rhtml files

For adding rhtml ruby mode:

Via http://paste.lisp.org/display/4185:

;; eRuby
(setq mmm-global-mode 'maybe)
(setq mmm-submode-decoration-level 2)
(mmm-add-classes
'((eruby
:submode ruby-mode
:front "<%"
:back "%>")))

(add-hook 'html-helper-mode-hook
'(lambda ()
(turn-on-font-lock)
(setq mmm-classes '(eruby))
(set-face-background
'mmm-default-submode-face "gray28")
(mmm-mode-on)))

(add-to-list 'auto-mode-alist '("\\.rhtml$" . html-helper-mode))
(add-to-list 'mmm-mode-ext-classes-alist '(html-helper-mode "\\.rhtml$" eruby))

You'd prolly also need:
Multiple Major Modes for emacs

No comments:

Post a Comment