On the ess list (emacs.ess.general) there has been the announcement [fn:2] of polymode [fn:1] recently, which is going in this direction.
Since my elisp knowledge is limited to the least, this comment might be irrelevant here, in which case please ignore it. Regards, Andreas Footnotes: [fn:1] https://github.com/vitoshka/polymode [fn:2] http://comments.gmane.org/gmane.emacs.ess.general/6994