While I was limited to my laptop to work (as Enterprise was still offline with the disk problem, not when I was in the hospital of course), I found myself having to deal with XHTML pages and PHP code (for a little job I found, not yet complete by the way, as I’m still waiting for the full specs); as my editor of choice under OS X is Aquamacs Emacs, I decided to look around a bit, partly because I was having trouble with php-mode itself, that was painting red everything I was writing outside of PHP code, and partly because waiting makes me curious about what else I can use to make my work easier.
And by skimming through the EmacsWiki I found an interesting mode for Emacs (that also works on Aquamacs Emacs of course): nXhtml. It’s an extension of nXML mode (that is in portage as app-emacs/nxml-mode, you can also get extensions for Gentoo XML files, like GuideXML files, through app-emacs/nxml-gentoo-schemas), that ends up specialising in XHTML files and their needs (link checks and similar).
It also features another intersting mode: MuMaMo (short for Multiple Major Modes), that allows to have both nxhtml-mode and php-mode (for instance) loaded in a single Emacs buffer; this allows to have proper highlighting depending on which part of the file are you editing at a given time, it’s quite nice as an idea, and seems also to work almost decently for me.
Now, as usual when I find a decent piece of software, I’m tempted of just packaging it. Unfortunately, it doesn’t seem like this time the packaging would be state of the art, until at least I’m able to contact upstream about it. The reason? While the elisp files are licensed under GPL 2 or later, there are two Perl scripts and a handful of Perl modules that are licensed under this statement:
# This file is free for personal use. For any other use please contact # the author.
“Free for personal use” is a quite strange for a free software support script license. Probably if I contact the author I can get him to relicense them under a suitable license I can actually use to package nxhtml.
The alternative is to get the elisp code not to call these scripts, and instead try to find something else that can replace them. Actually I think it could probably be implemented in pure elisp, if you were an elisp wizard at least, which I’m not.
I also have some doubts on where to install these files: they are currently installed together with the elisp files, but my guts would tell me to put them in something like /usr/libexec/nxhtml-mode as they are not elisp files at all. Oh well, that I’ll take care of later.