1 \input texinfo @c -*-texinfo-*-
2 @comment %**start of header (This is for running Texinfo on a region.)
3 @setfilename ispell.info
6 * Ispell:: Interactive spelling corrector.
8 @comment %**end of header (This is for running Texinfo on a region.)
15 This file documents ISPELL, an interactive spelling corrector.
17 Copyright 1988, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
19 Permission is granted to make and distribute verbatim copies of
20 this manual provided the copyright notice and this permission notice
21 are preserved on all copies.
24 Permission is granted to process this file through TeX and print the
25 results, provided the printed document carries copying permission
26 notice identical to this one except for the removal of this paragraph
27 (this paragraph not being relevant to the printed manual).
30 Permission is granted to copy and distribute modified versions of this
31 manual under the conditions for verbatim copying, provided that the entire
32 resulting derived work is distributed under the terms of a permission
33 notice identical to this one.
35 Permission is granted to copy and distribute translations of this manual
36 into another language, under the above conditions for modified versions,
37 except that this permission notice may be stated in a translation approved
41 @setchapternewpage odd
44 @center @titlefont{ISPELL}
46 @center by Pace Willisson and Geoff Kuenning
52 @comment Include the Distribution inside the titlepage environment so
53 @c that headings are turned off.
56 @vskip 0pt plus 1filll
57 Copyright @copyright{} 1988, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
59 Published by Geoffrey H. Kuenning @*
60 12840 Winthrop Ave., @*
61 Granada Hills, CA 91344-1221 USA
62 @vskip 0pt plus 1filll
64 Permission is granted to make and distribute verbatim copies of
65 this manual provided the copyright notice and this permission notice
66 are preserved on all copies.
68 Permission is granted to copy and distribute modified versions of this
69 manual under the conditions for verbatim copying, provided that the entire
70 resulting derived work is distributed under the terms of a permission
71 notice identical to this one.
73 Permission is granted to copy and distribute translations of this manual
74 into another language, under the above conditions for modified versions,
75 except that this permission notice may be stated in a translation approved
79 @node Top, Emacs, (dir), (dir)
82 * Emacs:: Using ispell from emacs
83 * Old Emacs:: Old Emacs
84 * Private:: Your private dictionary
85 * Command summary:: All commands in emacs mode
86 * Near misses:: Definition of a near miss
87 * History:: Where it came from
89 --- The Detailed Node Listing ---
91 Using ispell from emacs
93 * Word:: Checking a single word
94 * Buffer:: Checking a whole buffer
95 * Region:: Checking a region
96 * Multiple Dictionaries:: Using Multiple Dictionaries
102 @code{Ispell} is a program that helps you to correct spelling and
103 typographical errors in a file. When presented with a word that is not
104 in the dictionary, @code{ispell} attempts to find @dfn{near misses} that
105 might include the word you meant.
107 This manual describes how to use @code{ispell} from within @code{emacs}.
108 Other information about @code{ispell} is available from the @code{Unix}
114 @code{Ispell} is a program that helps you to correct spelling errors in
115 a file, and to find the correct spelling of words. When presented with
116 a word that is not in the dictionary, @code{ispell} attempts to find
117 @dfn{near misses} that might include the word you meant.
119 This manual describes how to use ispell, as well as a little about
125 * Emacs:: Using ispell from emacs
126 * Old Emacs:: Old Emacs
127 * Private:: Your private dictionary
128 * Command summary:: All commands in emacs mode
129 * Near misses:: Definition of a near miss
130 * History:: Where it came from
134 @node Emacs, Old Emacs, Top, Top
135 @section Using ispell from emacs
138 * Word:: Checking a single word
139 * Buffer:: Checking a whole buffer
140 * Region:: Checking a region
141 * Multiple Dictionaries:: Using Multiple Dictionaries
144 @node Word, Buffer, Emacs, Emacs
145 @subsection Checking a single word
147 The simplest emacs command for calling ispell is 'M-$' (meta-dollar. On
148 some terminals, you must type ESC-$.) This checks the spelling of the
149 word under the cursor. If the word is found in the dictionary, then a
150 message is printed in the echo area. Otherwise, ISPELL attempts to
151 generate near misses.
153 If any near misses are found, they are displayed in a separate window,
154 each preceded by a digit or character. If one of these is the word you
155 wanted, just type its digit or character, and it will replace the
156 original word in your buffer.
158 If no near miss is right, or if none are displayed, you have five
164 Insert the word in your private dictionary. Use this if you know that
165 the word is spelled correctly.
169 Accept the word for the duration of this editing session, but do not put
170 it in your private dictionary. Use this if you are not sure about the
171 spelling of the word, but you do not want to look it up immediately, or
172 for terms that appear in your document but are not truly words. The
173 next time you start ispell, it will have forgotten any accepted words.
177 Leave the word alone, and consider it misspelled if it is checked again.
181 Replace the word. This command prompts you for a string in the
182 minibuffer. You may type more than one word, and each word you type
183 is checked again, possibly finding other near misses. This command
184 provides a handy way to close in on a word that you have no idea how
185 to spell. You can keep trying different spellings until you find one
186 that is close enough to get a near miss.
190 Lookup. Display words from the dictionary that contain a
191 specified substring. The substring is a regular expression,
192 which means it can contain special characters to be more
193 selective about which words get displayed.
194 @xref{Regexps, Regexps, Regexps, emacs, emacs}. @refill
196 If the only special character in the regular expression is a leading
197 @code{^}, then a very fast binary search will be used, instead of
198 scanning the whole file.
200 Only a few matching words can be displayed in the ISPELL window.
201 If you want to see more, use the @code{look} program directly from
205 Of course, you can also type @kbd{C-g} to stop the command without
208 If you make a change that you don't like, just use emacs' normal undo
209 feature @xref{undo, undo, undo, emacs, emacs}.
211 @node Buffer, Region, Word, Emacs
212 @subsection Checking a whole buffer
214 If you want to check the spelling of all the words in a buffer, type
215 the command @kbd{M-x ispell-buffer}. This command scans the file, and makes
216 a list of all the misspelled words. When it is done, it moves the
217 cursor to the first word on the list, and acts like you just typed M-$
220 When you finish with one word, the cursor is automatically moved to the
221 next. If you want to stop in the middle of the list type @kbd{X} or
224 @node Region, Multiple Dictionaries, Buffer, Emacs
225 @subsection Checking a region
227 You may check the words in the region with the command @kbd{M-x ispell-region}.
228 See @xref{mark, mark, mark, emacs, emacs}.
230 The commands available are the same as for checking a whole buffer.
232 @node Multiple Dictionaries, , Region, Emacs
233 @subsection Using Multiple Dictionaries
235 Your site may have multiple dictionaries installed: a default one
236 (usually @file{english.hash}), and several others for different
237 languages (e.g. @file{deutsch.hash}) or variations on a language (such as
238 British spelling for English).
242 @item ispell-change-dictionary
243 @findex ispell-change-dictionary
245 This is the command to change the dictionary. It prompts for a new
246 dictionary name, with completion on the elements of @code{ispell-dictionary}.
248 It changes @code{ispell-dictionary} and kills the old ispell process, if
249 one was running. A new one will be started as soon as necessary.
251 By just answering @kbd{RET} you can find out what the current dictionary
254 @item ispell-dictionary
255 @vindex ispell-dictionary
257 If non-nil, a dictionary to use instead of the default one.
258 This is passed to the ispell process using the @code{-d} switch and is
259 used as key in @code{ispell-dictionary-alist}.
261 You should set this variable before your first call to ispell (e.g. in
262 your @file{.emacs}), or use the @kbd{M-x ispell-change-dictionary}
263 command to change it, as changing this variable only takes effect in a
264 newly started ispell process.
266 @item ispell-dictionary-alist
267 @vindex ispell-dictionary-alist
269 An alist of dictionaries and their associated parameters.
271 Each element of this list is also a list:
274 (@var{dictionary-name}
275 @var{casechars} @var{not-casechars} @var{otherchars} @var{many-otherchars-p}
279 @var{dictionary-name} is a possible value of variable
280 @code{ispell-dictionary}, @code{nil} means the default dictionary.
282 @var{casechars} is a regular expression of valid characters that
285 @var{not-casechars} is the opposite regexp of @var{casechars}.
287 @var{otherchars} is a regular expression of other characters that are
288 valid in word constructs. Otherchars cannot be adjacent to each other
289 in a word, nor can they begin or end a word. This implies we can't
290 check @samp{Stevens'} as a correct possessive and other correct
293 Hint: regexp syntax requires the hyphen to be declared first here.
295 @var{many-otherchars-p} is non-nil if many otherchars are to be allowed
296 in a word instead of only one.
298 @var{ispell-args} is a list of additional arguments passed to the ispell
301 Note that the @var{casechars} and @var{otherchars} slots of the alist should
302 contain the same character set as casechars and otherchars in the
303 @var{language}@file{.aff} file (e.g., @file{english.aff}).
307 @node Old Emacs, Private, Emacs, Top
310 Until ispell becomes part of the standard emacs distribution, you will
311 have to explicitly request that it be loaded. Put the following lines
312 in your emacs init file @xref{init file,, init file, emacs, emacs}.
315 (autoload 'ispell-word "ispell" "Check the spelling of word in buffer." t)
316 (autoload 'ispell-region "ispell" "Check the spelling of region." t)
317 (autoload 'ispell-buffer "ispell" "Check the spelling of buffer." t)
318 (global-set-key "\e$" 'ispell-word)
321 (It will do no harm to have these lines in your init file even after
322 ispell is installed by default.)
324 @node Private, Command summary, Old Emacs, Top
325 @section Your private dictionary
327 Whenever ispell is started the file @file{.ispell_words} is read from
328 your home directory (if it exists). This file contains a list of words,
329 one per line. The order of the words is not important, but the case is.
330 Ispell will consider all of the words good, and will use them as
331 possible near misses.
333 The @kbd{I} command adds words to @file{.ispell_words}, so normally you
334 don't have to worry about the file. You may want to check it from
335 time to time to make sure you have not accidentally inserted a
338 @node Command summary, Near misses, Private, Top
339 @section All commands in emacs mode
345 Insert into private dictionary
347 Accept for this session
351 Replace with one or more words
353 Lookup: search the dictionary using a regular expression
356 @item M-x ispell-buffer
358 @item M-x ispell-region
360 @item M-x ispell-change-dictionary
361 Select different dictionary.
364 @node Near misses, History, Command summary, Top
365 @section Definition of a near miss
367 Two words are near each other if they can be made identical with one
368 of the following changes to one of the words:
372 Interchange two adjacent letters.
378 Someday, perhaps ispell will be extended so that words that sound
379 alike would also be considered near misses. If you would like to
380 implement this, see Knuth, Volume 3, page 392 for a description of the
381 Soundex algorithm which might apply.
383 @node History, , Near misses, Top
384 @section Where it came from
386 Ispell has a long and convoluted history. Originally called SPELL, it
387 was written by Ralph E. Gorin in 1971. That version was written in
388 assembly language for the DEC PDP-10 to run under the WAITS operating
389 system at the Stanford Artificial Intelligence Laboratory. Subsequent
390 versions, also in PDP-10 assembly language, were developed for the BBN
391 TENEX, MIT ITS, and DEC TOPS-10 and TOPS-20 operating systems. It was
392 later revised by W. E. Matson (1974), and W. B. Ackerman (1978),
393 changing its name to ISPELL in the process.
395 In 1983, Pace Willisson (pace@@ai.mit.edu) converted this version to
396 the C language and modified it to work under Unix.
398 In 1987, Walt Buehring revised and enhanced ispell, and posted it to the
399 Usenet along with a dictionary. In addition, Walt wrote the first version
400 of "ispell.el", the emacs interface.
402 Geoff Kuenning (geoff@@ITcorp.com, that's me, and by the way I pronounce
403 it "Kenning") picked up this version, fixed many bugs, and added further
404 enhancements. In 1988 I got ambitious and rewrote major portions of the
405 code, resulting in the table-driven multi-lingual version. Ken Stevens
406 (stevens@@hplabs.hp.com) made overwhelming contributions to the elisp
407 support to produce the version you are using now.
409 Due to a misunderstanding involving the Free Software Foundation, it
410 later became necessary to rename this version to ispell to avoid
411 confusion on the part of users.
413 Many other enhancements and bug fixes were provided by other people.
414 Although I omit mention here due to space, many of these people have
415 also made significant contributions to the version of ispell you see
416 here. For a full list of people who have contributed to ispell, refer
417 to the file @file{Contributors} which is distributed with the ispell