# Rails.el on Ubuntu

**URL:** <https://www.ruby-forum.com/t/rails-el-on-ubuntu/57269>\
**Category:** Rails\
**Created:** [April 8, 2006, 10:16pm UTC](https://www.ruby-forum.com/t/rails-el-on-ubuntu/57269 "2006-04-08T22:16:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Henrik\_SSiso-8859-1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/3be4f8/32.png) [@Henrik\_SSiso-8859-1](https://www.ruby-forum.com/u/Henrik_SSiso-8859-1)\
**Post date:** [April 8, 2006, 10:16pm UTC](https://www.ruby-forum.com/t/rails-el-on-ubuntu/57269/1 "2006-04-08T22:16:57Z")

</div>

Anybody who have a working .emacs (++) for Ubuntu (or Debian) with the  
newest emacs-rails (v.0.3). I have especially trouble with getting  
HTML Mode Snippets to work.

- Henrik

---

<div class="post-metadata">

**Author:** ![Henrik\_SSiso-8859-1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/3be4f8/32.png) [@Henrik\_SSiso-8859-1](https://www.ruby-forum.com/u/Henrik_SSiso-8859-1)\
**Post date:** [April 9, 2006, 5:34pm UTC](https://www.ruby-forum.com/t/rails-el-on-ubuntu/57269/2 "2006-04-09T17:34:32Z")

</div>

Henrik Ormåsen wrote:

> Anybody who have a working .emacs (++) for Ubuntu (or Debian) with the  
> newest emacs-rails (v.0.3). I have especially trouble with getting  
> HTML Mode Snippets to work.

I’m on kubuntu, with emacs cvs latest. Rails.el works although I had  
some  
troubles with old abbrevs cached in ~/.abbrev\_defs. Removing them  
helped.

---

<div class="post-metadata">

**Author:** ![Henrik\_SSiso-8859-1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/3be4f8/32.png) [@Henrik\_SSiso-8859-1](https://www.ruby-forum.com/u/Henrik_SSiso-8859-1)\
**Post date:** [April 9, 2006, 6:11pm UTC](https://www.ruby-forum.com/t/rails-el-on-ubuntu/57269/3 "2006-04-09T18:11:32Z")

</div>

I am using it on Debian Sarge with no problems. My .emacs has the  
exact code from the wiki. The only problem I am having is with .rhtml  
syntax highlighting which is ugly…dark foreground with a dark  
backgrround makes it impossible to read but it is for \<% %\> section  
only. I am still trying to figure this out. For now I turn off global  
lock to edit rhtml files. I’d appreciate hearing about any solutions.

-bakki

---

<div class="post-metadata">

**Author:** ![Henrik\_SSiso-8859-1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/3be4f8/32.png) [@Henrik\_SSiso-8859-1](https://www.ruby-forum.com/u/Henrik_SSiso-8859-1)\
**Post date:** [April 10, 2006, 6:09pm UTC](https://www.ruby-forum.com/t/rails-el-on-ubuntu/57269/4 "2006-04-10T18:09:18Z")

</div>

Thanks Michael, I’ll use your code and experiment with the colors a  
bit since I prefer a white background.

-bakki

On 4/9/06, Michael T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> This may help some. The first part is just my color scheme, which

---

<div class="post-metadata">

**Author:** ![Henrik\_SSiso-8859-1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/3be4f8/32.png) [@Henrik\_SSiso-8859-1](https://www.ruby-forum.com/u/Henrik_SSiso-8859-1)\
**Post date:** [April 11, 2006, 5:40am UTC](https://www.ruby-forum.com/t/rails-el-on-ubuntu/57269/5 "2006-04-11T05:40:39Z")

</div>

Yes, some people have troubles with snippets in html, but only in Emacs  
21.  
There no problems in GNU/Emacs 22. Also some other things working better  
in  
Emacs 22.

PS: People, please checkout SVN version of Emacs Rails, it is stable  
enough.

---

<div class="post-metadata">

**Author:** ![Henrik\_SSiso-8859-1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/3be4f8/32.png) [@Henrik\_SSiso-8859-1](https://www.ruby-forum.com/u/Henrik_SSiso-8859-1)\
**Post date:** [April 9, 2006, 6:51pm UTC](https://www.ruby-forum.com/t/rails-el-on-ubuntu/57269/6 "2006-04-09T18:51:36Z")

</div>

This may help some. The first part is just my color scheme, which  
kind of matches the Ink look on Textmate. The second section is the  
mmm-mode settings, which define how multi mode gets highlighted (this  
is the ERB stuff). On mine I have a dark slate blue background with  
white text.

;; uncomment the next line if you want syntax highlighting  
(add-hook 'ruby-mode-hook 'turn-on-font-lock)

(cond ((fboundp 'global-font-lock-mode)  
;; Customize face attributes  
(setq font-lock-face-attributes  
;; Symbol-for-Face Foreground Background Bold Italic  
Underline  
'((font-lock-comment-face “Purple”)  
(font-lock-string-face “green”)  
(font-lock-keyword-face “orange red”)  
(font-lock-function-name-face “orange1”)  
(font-lock-variable-name-face “white”)  
(font-lock-type-face “white” “black” “false”  
“false” “true”)  
(font-lock-reference-face “Purple”)  
))  
;; Load the font-lock package.  
(require 'font-lock)  
;; Maximum colors  
(setq font-lock-maximum-decoration t)  
;; Turn on font-lock in all modes that support it  
(global-font-lock-mode t)))

This is the MMM Mode stuff:

(require 'mmm-mode)  
(require 'mmm-auto)  
(setq mmm-global-mode 'maybe)  
(setq mmm-submode-decoration-level 2)  
(set-face-background 'mmm-output-submode-face “DarkSlateBlue”)  
(set-face-background 'mmm-code-submode-face “DarkSlateBlue”)  
(set-face-background 'mmm-comment-submode-face “DarkOliveGreen”)  
(mmm-add-classes  
'((erb-code  
:submode ruby-mode  
:match-face (("\<%#" . mmm-comment-submode-face)  
("\<%=" . mmm-output-submode-face)  
("\<%" . mmm-code-submode-face))  
:front “\<%[#=]?”  
:back “%\>”  
:insert ((?% erb-code nil @ “\<%” @ " " \_ " " @ “%\>” @)  
(?# erb-comment nil @ “\<%#” @ " " \_ " " @ “%\>” @)  
(?= erb-expression nil @ “\<%=” @ " " \_ " " @ “%\>” @))  
)))  
(add-hook 'html-mode-hook  
(lambda ()  
(setq mmm-classes '(erb-code))  
(mmm-mode-on)))  
(add-to-list 'auto-mode-alist '("\.rhtml$" . html-mode))  
(global-set-key [f8] 'mmm-parse-buffer)
