[LON-CAPA-users] Emacs multi-web-mode for developing problems

Joseph Mingrone jrm at mathstat.dal.ca
Thu Jul 4 16:53:57 EDT 2013

Hello all;

If you are working on your capa problems in Emacs, multi-web-mode is
helpful.  With it, when the point is inside <script type="loncapa/perl">
</script> tags, the major mode is set for perl, otherwise the major mode
is set for xml.

This is what I did to get it working.

1. Use git to clone the repository:
% git clone https://github.com/fgallina/multi-web-mode

2. Copy/link/move multi-web-mode.el somewhere in your load-path.

3. Put something like the following in your init file:
(require 'multi-web-mode)
(setq mweb-default-major-mode 'xml-mode)
(setq mweb-tags '((php-mode "<\\?php\\|<\\? \\|<\\?=" "\\?>")
                  ;(js-mode "<script[^>]*>" "</script>")
		  (js-mode "<script>" "</script>")
                  (css-mode "<style[^>]*>" "</style>")
		  (perl-mode "<script type=\"loncapa/perl\">" "</script>")))
(setq mweb-filename-extensions '("php" "htm" "html" "ctp" "phtml" "php4" "php5" "problem"))
(multi-web-global-mode 1)


More information about the LON-CAPA-users mailing list