MMM Mode for Emacs

MMM Mode is an Emacs add-on package providing a minor mode that
allows Multiple Major Modes to coexist in one buffer. It is
particularly well-suited to editing embedded code or code that
generates other code. It defines a general syntax—the "submode
class"—for telling it how one major mode should be embedded in
another.

The original author of MMM Mode (Michael Shulman) stopped
maintaining it a long time ago. As of February 2013, development has
moved to Steve Purcell's
GitHub repository. The new release, compatible with Emacs 23 and 24,
is also available for download at the old project page on
SourceForge

There is also an MMM Mode mailing
list hosted by SourceForge, although it hasn't seen much
activity in years.