Editing ERB and EJS with mmm-mode

364 views
Skip to first unread message

Dmitry Gutov

unread,
Jun 12, 2012, 10:20:47 PM6/12/12
to emacs-o...@googlegroups.com
Hi all,

Our fork of mmm-mode (available at https://github.com/purcell/mmm-mode/
or through MELPA) now provides improved editing support for ERB and
EJS templates, which means syntax highlighting and smart indentation,
including adjustments for if/else/do/end blocks.

That gives it more or less feature parity with rhtml, except it doesn't
overwrite functions in the sgml namespace, and also supports JS and
CSS submodes. As far as I'm concerned, it indents better, too.

For instructions, see mmm-erb.el.

Regarding known issues go, putting unpaired '<' in a submode region will
break indentation on the following lines in primary mode until a closing
tag. So far it hasn't been a problem for me; if it is for you, feel free
to create an issue.

If there's interest, adding support for JSP (or PHP?) shouldn't be too
hard, too.

In other news, mmm-mode has seen a few small but visible fixes in
the last few weeks. If you tried it before and could not get it to
work, you may find it different now.
Also, (setq mmm-parse-when-idle t) to make it reparse buffer when idle.

-- Dmitry

Reply all
Reply to author
Forward
0 new messages