Emacs, ERuby and MMM-Mode

V

Vincent Foley

Hi guys, I'm trying to get ruby-mode and html-mode to work together
with mmm-mode in .rhtml files, and I have a problem: the Ruby code is
not colored (syntax highlight). Right now, I have this code in my
..emacs file for eruby:

;; eRuby
(require 'mmm-mode)
(setq mmm-global-mode 'maybe)
(setq mmm-submode-decoration-level 0)
(mmm-add-classes
'((eruby
:submode ruby-mode
:front "<%[=#]?"
:back "%>")))
(add-to-list 'auto-mode-alist '("\\.rhtml$" . html-mode))
(add-to-list 'mmm-mode-ext-classes-alist '(html-mode nil eruby))

Anything seems suspect to you? Got an idea? Oh, and if I set
mmm-submode-decoration-level to 1 or to 2, the Ruby code is
highlighted in a pale gray and I can't read anything anymore

Thanks for the tips.

Vincent
 
N

nobu.nokada

Hi,

At Sun, 28 Nov 2004 03:27:58 +0900,
Vincent Foley wrote in [ruby-talk:121614]:
Hi guys, I'm trying to get ruby-mode and html-mode to work together
with mmm-mode in .rhtml files, and I have a problem: the Ruby code is
not colored (syntax highlight). Right now, I have this code in my
..emacs file for eruby:

It seems working fine to me. But there is a ruby-mode issue
which doesn't indent properly if no block beginning keywords.
 
A

Asfand Yar Qazi

Vincent said:
Hi guys, I'm trying to get ruby-mode and html-mode to work together
with mmm-mode in .rhtml files, and I have a problem: the Ruby code is
not colored (syntax highlight). Right now, I have this code in my
.emacs file for eruby:

;; eRuby
(require 'mmm-mode)
(setq mmm-global-mode 'maybe)
(setq mmm-submode-decoration-level 0)
(mmm-add-classes
'((eruby
:submode ruby-mode
:front "<%[=#]?"
:back "%>")))
(add-to-list 'auto-mode-alist '("\\.rhtml$" . html-mode))
(add-to-list 'mmm-mode-ext-classes-alist '(html-mode nil eruby))

Anything seems suspect to you? Got an idea? Oh, and if I set
mmm-submode-decoration-level to 1 or to 2, the Ruby code is
highlighted in a pale gray and I can't read anything anymore

Thanks for the tips.

Vincent

Don't know if this is relavent, but it works for me.

To get syntax highlighting, I had to make the following modification
to the ruby-mode.el file:

---------------------------cut here----------------------------------
*** /home/asfand/src/packages/ruby/ruby-1.8.1/misc/ruby-mode.el Fri
Dec 19 17:29:09 2003
--- .emacs-lisp/ruby-mode.el Sun Mar 14 07:36:51 2004
***************
*** 162,166 ****
:eek:ptions '(t nil space) :group 'ruby)

! (eval-when-compile (require 'cl))
(defun ruby-imenu-create-index-in-block (prefix beg end)
(let ((index-alist '()) (case-fold-search nil)
--- 162,169 ----
:eek:ptions '(t nil space) :group 'ruby)

! (eval-when-compile
! (require 'cl)
! (require 'font-lock)
! )
(defun ruby-imenu-create-index-in-block (prefix beg end)
(let ((index-alist '()) (case-fold-search nil)
---------------------------cut here----------------------------------

Well, it worked for me, thats all that matters :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top