add-dictionary - Declare existence of a spelling dictionary
n add-dictionary "file"
add-dictionary adds the given dictionary (specified by the given file) to the dictionary list. Note that the file may omit the .edf extension, this is automatically added.
The command accepts a numeric argument 'n' which determines the actions to be undertaken. When n is omitted then the dictionary is marked for loading (on demand) - this is the standard invocation used in the start up files.
If an argument of 0 is given the dictionary is created but it is not marked for loading, this can be used to create an empty dictionary.
If an argument of -1 is given the contents of the dictionary are dumped into the current buffer, used for dictionary maintenance. The two main uses of this command are discussed below.
A call to add-dictionary with no numeric argument does not perform an immediate load of the dictionary, instead the dictionary is only loaded on demand, i.e. when a call to spell(2) (usually via spell-word(3) or spell-buffer(3)) is made, this ensures that the start up time for MicroEmacs does not become too long. When the dictionary is loaded it is checked for efficiency, if found to be inefficient it is automatically optimized and flagged as changed. On exiting MicroEmacs, the user is prompted to save any dictionary that has be altered or optimized.
The spelling search order is made from the last dictionary added to the first, as soon as a word is found in a dictionary the search is halted. This implies that if a word has been defined incorrectly in one dictionary, but correct in another, the order in which the dictionaries are added determines the result.
The number of dictionaries allowed is unlimited but note that any words added are always added to the LAST dictionary. The size of the dictionary is restricted to about 16Mb, the size is NOT tested when words are added and if this size is exceeded the results are undefined. However, it is unlikely that this limit will be reached, the largest dictionary created to date is 0.8Mb.
A new main dictionary may be created as follows:-
1)
2)
3)
4)
5)
A call to add-dictionary with a numeric argument n of -1 causes the contents of the given dictionary to be dumped into the current buffer (make sure you are in an empty buffer or *scratch*) where:
xxxx - Good word xxxx with no spell rules allowed
xxxx/abc - Good word xxxx with spell rules abc allowed
xxxx>yyyy - Erroneous word with an auto-replace to yyyy
The dump of the dictionary may be edited, allowing erroneous entries to be removed. The macro file spellutl.emf contains macros edit-dictionary(3) and restore-dictionary(3) which enable the user to edit a dictionary.
MicroEmacs '99 is supplied with a dictionaries for American and British English, it is strongly suggested that these dictionaries are NOT modified in anyway. Ensure that the dictionary is protected by loading the base dictionaries first, followed by a personal dictionary. New words added during spelling will then be added to the personal dictionary rather than the main dictionary.
The MicroEmacs '99 start-up file me.emf executes language.emf which in turn executes the user language setup file, for example american.emf, which adds the main language dictionaries and rules. language.emf then adds the user's dictionary, this process can be simplified to:-
; add the main American dictionary add-dictionary "american" ; reset the spell rules 0 add-spell-rule ; Now add the American spell rules -2 add-spell-rule "A" "" "" "re" ; As in enter > reenter -2 add-spell-rule "I" "" "" "in" ; As in disposed > indisposed . . ; Now add the user dictionary add-dictionary $MENAME
(c) Copyright JASSPA 1999
Last Modified: 1999/03/24
Generated On: 1999/12/01