XMode

by mike dillon <mdillon@gjt.org>

Changes

Writing Mode Files

This plugin allows the user to add custom syntax colorizing modes to jEdit using a simple XML syntax.

Included in the distribution are sample mode files for Transact-SQL, Patch/DIFF, Properties/INI, XML, HTML, CFML, PHP, and Java, as well as the Document Type Definition (DTD) for a jEdit mode file. These files may be found in the 'XMode/modes' directory. The T-SQL, Patch, Props, and Java modes provide the same functionality as the corresponding built in modes. The HTML mode gives slightly different functionality than the built-in mode, as it does not colorize JavaScript. Instead, it colorizes attribute values inside of tags. Adding the JavaScript functionality would not be hard, but it would currently be limited to JavaScript blocks inside plain <SCRIPT> tags (i.e. no LANGUAGE attribute). The XML mode also colorizes attribute values inside of tags. The PHP mode is (IMHO) nearly perfect and is currently in synch with PHP3, but I will add the new PHP4 functions as I start using them more. The ColdFusion mode is only included because i know that too many people (myself occasionally one of them) have to deal with CFML for their work or whatever. This mode isn't perfect (it work get <CFQUERY> or <CFSCRIPT> right), but it's at least as good as the colorization in Allaire's own ColdFusion Studio 4.

After extracting the plugin archive, move the XML files to any directory you like. Then, start jEdit and go to the Global Options dialog. Click on the 'XMode' tab. Type the path where you put the XML files in the 'Grammar directory' box, and click OK. When you restart jEdit, the XML files will be loaded from that directory.

The grammar directory defaults to "$USER_HOME/.jedit/modes/xml" (using platform specific separators).

NOTE: Due to the way jEdit handles file extensions, installing an XMode to handle a certain extension will stop any built-in modes from handling it. Thus if you install the x-java mode, it will be used as the default mode for ".java" files, not the built-in java mode. To restore extension handling by a built-in mode, remove or comment out ("<!--...-->") the offending <EXTENSION>...</ENTENSION> line from the XMode definition. This will only affect freshly opened files; the modes used by buffers in the "desktop" will remain unchanged.