# spell(2)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

spell - Spell checker service provider

## SYNOPSIS

n spell ["word"] ["rules"] ["correction"] ["rule"]

## DESCRIPTION

spell is a low level command which provides spell checking capabilities for MicroEmacs 2009, it is not designed to be used directly. The action of spell depends on the argument given, which is a bitwise flag defined as follows:-

0x001

If set then gets the input word from the user, i.e. "word" must be supplied. Otherwise the word input is taken from the current buffer.

0x002

If set then keeps getting words from the current buffer until either the end of the buffer is reached or an error is found. If the end of the buffer is reached then the command succeeds setting $result(5) to the value "F". This bit is ignored if bit 0x001 is set. spell sets the current show-region to enclose the problematical word and the command show-region(2) can be used to move around the word.

0x004

Adds the given word to a dictionary determined by the state of bit 0x008. If the word is flagged as erroneous (see bit 0x010) then a "correction" word must be supplied, otherwise a list of "rules" which can be applied to the word must be given, this list can be empty. Note that if the word is not flagged as erroneous and it already exists in the dictionary, the word is not removed, instead a combined rule list is created.

0x008

When set flags that word additions (bit 0x004) and deletions (bit 0x200) should be made to the ignore dictionary. Otherwise word additions are made the last added dictionary and deletions are made to all main dictionaries.

0x010

When set flags that the given word is erroneous, used solely by word additions to create auto-corrections.

0x020

Returns a '|' separated guess list for the given word in $result.

0x040

If bit 0x100 is also set a complete list of valid words derivable from the given word are inserted into the current buffer. Otherwise spell returns $result(5) set to the derivative word created when the given "rule" is applied to "word". The rule applied is the first found of the given rule letter with a matching base ending (see add-spell-rule(2)). The word need not exist as not tests for the legality of the resultant word is used, for example in American, executing

    65 spell "spelling" "V"

returns "`spellingive`" in $result. Returns the empty string if no rule could be applied.

0x080

Used with bit 0x002 to enable double word checking.

0x100

Return information in $result about the given word, or the word which is used to derive the given word. The information consists of the spell status, the word as stored in the dictionary, and either the list of valid rules, or the correction word. See also bit 0x040.

0x200

Delete the given word from a dictionary determined by bit 0x008

If none of the main functions are used (bits 0x004, 0x020, 0x040 & 0x200) then the status flag is returned in the first column of $result. These are defined as follows:-

A

Auto-replace. The word was found and flagged as erroneous. The correction word is given in $result, either next to the flag, or if bit 0x100 is set then after the '>' character.

D

Double word. Indicates that the first problem found is a double occurrence of the same word one after the other.

E

Erroneous. The word was not found, so is Erroneous

N

Not a word. The current word found contains no alphabetic characters so is not deemed to be a word, e.g. 3.141593.

O

Okay. The word was found and is not an erroneous word.

## SEE ALSO

add-dictionary(2), add-spell-rule(2), delete-dictionary(2), save-dictionary(2), show-region(2), spell-buffer(3), spell-word(3), Locale Support.

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>