Richard M. Stallman wrote: > For web template files (like PHP, JSP, Genshi etc) there are however > often several major mode chunks involved. In for example a php file > there may be chunks with these major modes > > - nxhtml-mode / html-mode > - php-mode > - css-mode > - javascript-mode > > It seems to me that if PHP files are likely to contain these other > things, it is good for Emacs to handle them automatically in PHP files. Yes, I agree. > Here's one way: rename the basic PHP mode to `php-only-mode', and > define `php-mode' as the mumamo mode to handle all of these. What do > you think? I am not sure. I liked html+php-mode better. Maybe using the name php-mode would also create confusion since the name is already in use. However php-only-mode may be a good choice. BTW, php-mode.el (or some version of it) is still not in Emacs. I am distributing it as part of nXhtml (and it can also be found on Emacs Wiki). > Another variant is to make `php-mode' check for other languages, and > call either `php-only-mode' or `php-mumamo-mode'. Or perhaps it could > select among a larger variety of modes, depending on what combinations > of languages are actually used in one file. > > If we don't do this, users can cope by adding explicit -*- specs. But > that is inconvenient, so why not do this automatically? I have suggested a different solution to this quite general problem. I think a list of major mode priorities would be better. I have implemented that in majmodpri.el which I am resending here. (I think I might have made some changes since last time I sent it.)