Next: , Previous: Filter Interface, Up: Top



12 Filter Modeso

Filter modes are the preferd way to specify combinations of filters which are used regularily and thus abreviate aspell's command line arguments.

A new filter mode is specified by a file named like the filter new mode and prefixed by .amf (AspellModeFile). If such a file is acessible by the path set via filter-path option Aspell will try to load the contained mode specification 1.

12.1 Aspell Mode File

The first key in the maode file has be the mode key. It is checked against the mode name part of the .amf file. If the mode key is missing mode file will be rejected.

The same holds for the aspell key which specifies the verion(s) of aspell wich is(are) required by the filter.

If these two keys are followed by at least one madgic key aspell will be able to select the entire mode from extention and if required from contents of the file to spell implicitly.

The last key of the initial section is the des[c[ription]] key. It gives a short description of the filter mode which will displayed when type

 
  aspell help
This key again is required as it indicates the end of the Aspell Mode File's header section. Any line following specifies filters and their options required by the mode.

The only two keys valid are filter and option. The value of the filter key is equal to the value of aspell's [add|rem]-filter option. The option key has to be followed by the name of a valid aspell option and the corresponding values 2.

12.1.1 MAGIC line format

The value of the magic key consist of at least two fields separated by a`/' the first field specifes a magic expression used to verify mode selection found by looking at the filename extention. The second and any following field contain the file name extensions which may trigger a selection of the mode.

The magic expression may be one of: <empty> or <nomagic> if mode selection should be base uppon file extentions only. In any other case magic expression is a `:' separated list of three elements.

Thre the last element is assumed to be a valid extended possix regular expression 3. It is checked against a maximum count of bytes. This maximum number of bytes is given by the second element. The first is the number of bytes to skip from the file to spell before trying to match regular expression. A value of 0 means the verry first byte of the file.

For a commented example of Aspell mode files and their layout see html.amf


Footnotes

[1] Any line beeing blank or containing a comment will be skiped

[2] these may be empty if the option is of boolean type or of list type and prefixed by rem-all

[3] brackets may be specifed differntly eg: \( <-> (