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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s