MMM-mode
概要
ひとつのファイル内にいくつかのモードを保持する場合に利用する。
JSPやJavaScript、PHPで利用する。
公式サイト
派生版
Emacs 23 等で問題が発生するので修正されたバージョンが存在する。これを利用している。
インストール
git clone https://github.com/dgutov/mmm-mode.git
cd mmm-mode
./autogen.sh
./configure --prefix=~/.emacs.d --datarootdir=~/.emacs.d/share/ --with-lispdir=~/.emacs.d/lisp/mmm-mode
make install
JSPの設定
http://mail.gnu.org/pipermail/help-emacs-windows/2002-September/002062.html
この内容はmmm-sample.elに記述がある。
(mmm-add-group 'jsp
`((jsp-code
:submode java
:match-face (("<%!" . mmm-declaration-submode-face)
("<%=" . mmm-output-submode-face)
("<%" . mmm-code-submode-face))
:front "<%[!=]?"
:back "%>"
:insert ((?% jsp-code nil @ "<%" @ " " _ " " @ "%>" @)
(?! jsp-declaration nil @ "<%!" @ " " _ " " @ "%>" @)
(?= jsp-expression nil @ "<%=" @ " " _ " " @ "%>" @))
)
(jsp-directive
:submode text-mode
:face mmm-special-submode-face
:front "<%@"
:back "%>"
:insert ((?@ jsp-directive nil @ "<%@" @ " " _ " " @ "%>" @))
)))
