views:

181

answers:

1

I use emacs when working with Django. .py files work great with Python-mode, .js files work great with js2-mode, .djhtml (templates) work great with django-html-mode -- except for Javascript blocks which aren't auto-indented nor highlighted.

Does anyone know of a way to get syntax-highlighting for Javascript blocks in Django templates in emacs?

+1  A: 

You can use django-nxhtml-mumamo-mode. It is part of the nXhtml package. (It is shipped with Emacs Starter Kit, too.) For JavaScript, it uses javascript-mode instead of js2-mode.

Török Gábor
Works great. Do you know how to stop the dratted chunk-colouring that nxhtml does? Related discussion here: http://stackoverflow.com/questions/1146701/turning-off-chunk-coloring-in-emacs-nxhtml-mode
friism
Right, figured that one out myself, the answer is here: http://ourcomments.org/Emacs/nXhtml/doc/nxhtml.html#multi-colors
friism