Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Having eruby-nxhtml-mumamo-mode be set every time I open a .html.erb file

I downloaded nxhtml and unzip it. I then put this in my .emacs file.

(add-to-list 'load-path "~/nxhtml/util")
    (require 'mumamo-fun)
    (setq mumamo-chunk-coloring 'submode-colored)
    (add-to-list 'auto-mode-alist '("\\.rhtml\\'" . eruby-nxhtml-mumamo-mode))
    (add-to-list 'auto-mode-alist '("\\.html\\.erb\\'" . eruby-nxhtml-mumamo-mode))

When I open an .html.erb file it does not have the proper mode set(and therefore improper syntax highlighting). I know the require statement is running correctly b/c I can manually set aquamacs to eruby-nxhtml-mumamo-mode and if I comment out the require line I can't even switch to that mode. I have even tried replacing the eruby...-mode with other modes like c++-mode and other modes I know work and that doesn't work either.

So is my problem with the regex? I am not sure. Any help would be appreciated.

like image 265
SteVwonder Avatar asked Nov 14 '22 07:11

SteVwonder


1 Answers

Try the following:

(add-to-list 'auto-mode-alist '("\\.rhtml?$" . eruby-nxhtml-mumamo-mode))
(add-to-list 'auto-mode-alist '("\\.html?\\.erb$" . eruby-nxhtml-mumamo-mode))

It appears you had an escaped comma at the end of your expressions.

I don't know if the lack of the 'l' in your header was intentional or not, but the question mark should account for it either way. The dollar sign anchors the expression to the end of the string, and are nominally optional, but it's nice to be explicit.

like image 187
angelixd Avatar answered Dec 22 '22 06:12

angelixd