I believe now that MuMaMo (the multi major mode support) is fairly stable. It is now possible to have chunks in chunks and it is reasonably fast.
The major mode than once gave the name to this package for web devoloping, nxhtml-mode, has long been stable. There are a lot of other minor things in this package. Of course everything is not perfect. Bug report and taking part in the development is very welcome. Go to the project page on Launchpad if you want to join!
If you want to know how it works, install and test. It will not harm, everything is autoloaded so it will not slow down your Emacs - eh, a tiny little bit perhaps if you really use it, but then you will also get the benefits of it.
If you want to know current bug status go to Launchpad!
I want to thanks the testers and bug reporters (who have been many now), especially to my first testers Hadron Quark and Eric Lilja, for helping me by testing and pointing out bugs and weaknesses, most of them related to editing of PHP.
Without testers all kind of problems I just can't imagine myself would still be there in nXhtml. For example Hadron told me once that he got the error (wrong-type-argument stringp nil). Eh, I replied, are you sure. Yes he was. I tried the same file as him. No error.
The error happened during fontification so the error message above was all we had. A real black box for me. Or perhaps black magic? After much confusion and some hard work we finally found out what it was and I implemented a better way to catch such errors. If Hadron would have given up the problem would still have been there. Some problems are just impossible to solve without good cooperation. So, again, thanks Hadron.
BTW, I will perhaps add some even better way to Emacs to catch these errors so other can benefit from our insights too, but that requires some time and effort which I can't afford right now.
If is now a bit more easy to take care of errors since there is a good bug database for nXhtml at Launchpad.
Because of a bug in Emacs 22.1 you can sometimes (at the end of a line) get long red lines instead of just a single underlined character. Many users (me included) find this quite a bit disturbing. I have therefore added a command to quickly hide/show the underlines. This is on C-c C-w (nxhtml-toggle-visible-warnings, key binding changed to C-c _ in later versions of nXhtml).
This is particular useful for example in the case where you edit a PHP file and are bound to get a lot of XHTML validation errors.
If you want to have attribute values computed by PHP here is a way how to structure that to avoid breaking completion and validation in the XHTML part unnessecary:
<img src="images/linux.png" title="<?php foo("bar");?>"/>
Unfortunately that still breaks XHTML validation since < is not allowed in strings. In the long run I believe the XML validator has to be broken up so that it avoids parsing the string here (in PHP files).
For now I have implemented a workaround. If you are using constructs like those above then turn on mumamo-alt-php-tags-mode. This will temporarily replace the above with
<img src="images/linux.png" title="(?php foo("bar");?)"/>
However on the screen you will still see the original string and when writing to file the correct characters will be used.
The rules for a process instruction in XML, like <?php ... ?> says that the text can contain any text except ?>. So if you want to output that string from PHP then break it up so it does not look as ?> in the source file.
It might be good to break up the beginning part of the process instructions too. And please note that to use XHTML validation or completion you should avoid using < in strings, since it is not allowed there.
Some people have asked why the way to specify chunks in mumamo-mode is not compatible with the old mmm-mode. The answer is that I was not sure that the way used in mmm-mode for specifying the chunks was flexible enough.
Some people have also wondered why MuMaMo does not find chunks just as simple as multi-mode does. The answer is it did from the beginning. However that way (looking around current point) is not stable enough. Multi major modes are a bit different in this respect than normal major modes. More things can go wrong when you are guessing.
You are not supposed to call mumamo-mode yourself any more and mumamo-global-mode is gone. So is also mumamo-chunk-family-by-mode and mumamo-filenames-list. The functionality those gave are all replaced by the new functions for turning on mumamo mode.
This will of course case some problems if you do not notice it when you upgrade nXhtml. If you are using EmacsW32 and upgrade nXhtml you should change the file emacsw32.el.
The reason for this change is that nXml will soon normally not be part of nXhtml so keeping the old top directory name would be confusing.
Unfortunately the chunk dividing routines in mumamo.el can loop, see bug 290364 above. The reason is that I tried to find chunks at current point in a buffer without looking through the buffer from the beginning. Fontification works this way in Emacs. It is a heuristic that sometimes fails however, but the consequences are merely just local errors in fontification.
Chunk dividing must be more stable since it has a global impact on the files fontification. It therefore have to be done from the beginning of the buffer - just like a parser reading the file will do.
I have done first part of this rewrite and I hope chunk dividing can not loop any more. Chunk dividing is now always done from the beginning. However the routines actually finding the chunks still looks both upwards and downwards. I will try to remove this unnecessary complexity later.
To do that use M-x nxhtmlmaint-start-byte-compilation.
A lot of code changes to make byte compilation possible without a lot of warnings. Most changes where just moving code around, but some where bug fixes.
Adding nXml to Emacs 22 startup should be done by using the file nxhtml/autostart22.el.
NOTE 1: if you want to use nxhtml-mode in multi major modes in Emacs 22 (not recommended) you must also customize majmodpri-no-nxml.
NOTE 2: The major mode nxhtml-mode as a major-mode works however very well also in Emacs 22.
Note: I thought that I should make Company Mode the default completion style. However there are still some problem so I kept the old default completion style.
Added simple functions for mirroring html files in Firefox as typing. This works - at least for small files. There is also support for automatic update of Firefox when saving CSS files.
This is a simple framework for communicating with MozRepl which enqueues requests, waiting for response prompt before sending next requests. Maybe this can be used to make some more efficient routines than those I have written here. Any takers?
For larger files (like this one) this version is rather slow since it always changes the whole DOM.
2.00 does not stand for something very exciting, it is just a consecutive number. But - I do believe this is a rather mature version of nXhtml.
This version was never released, but was available as beta for testing (and use). During this beta I tried to finish the rewriting of the rewriting of the chunk dividing routines. (Those needed simplification. Initially I believed that chunks with different major could be created starting from anywhere in the file. This was complex and indeed a bad idea since the chunk dividing markers depends on the content of the file from the top.)
A lot of bugs where fixed during this and new things were added. Some things were removed. But there is no good logg of this anywhere because I did not have time to update that. Sorry. But if you are interested you can have a look at the bug database at Launchpad.
This is the first released version since version 2.05 (which was released in Dec 2009).
One noticeable thing is that the menus were restructered to make it easier to find things. You can find some of the new things there. Most of the rest are internal changes and bug fixes.