Source

XEmacs / man / ispell.texi

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
\input texinfo    @c -*-texinfo-*-
@comment %**start of header (This is for running Texinfo on a region.)
@setfilename ispell.info
@settitle ISPELL V3.1
@comment %**end of header (This is for running Texinfo on a region.)

@iftex
@finalout
@end iftex

@ifinfo
This file documents ISPELL, an interactive spelling corrector.

Copyright 1988, 1990, 1991, 1992, 1993  Free Software Foundation, Inc.

Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.

@ignore
Permission is granted to process this file through TeX and print the
results, provided the printed document carries copying permission
notice identical to this one except for the removal of this paragraph
(this paragraph not being relevant to the printed manual).

@end ignore
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.

Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be stated in a translation approved
by the Foundation.
@end ifinfo

@setchapternewpage odd
@titlepage
@sp 11
@center @titlefont{ISPELL}
@sp 2
@center by Pace Willisson and Geoff Kuenning
@sp 2
@center Version 3.1
@sp 2
@center December 1993

@comment   Include the Distribution inside the titlepage environment so
@c that headings are turned off. 

@page
@vskip 0pt plus 1filll
Copyright @copyright{} 1988, 1990, 1991, 1992, 1993  Free Software Foundation, Inc.

Published by Geoffrey H. Kuenning @*
12840 Winthrop Ave., @*
Granada Hills, CA  91344-1221 USA
@vskip 0pt plus 1filll

Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.

Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.

Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be stated in a translation approved
by the Foundation.

@end titlepage
@node Top, Emacs, (dir), (dir)

@menu
* Emacs::			Using ispell from emacs
* Old Emacs::			Old Emacs
* Private::			Your private dictionary
* Command summary::		All commands in emacs mode
* Near misses::			Definition of a near miss
* History::			Where it came from

 --- The Detailed Node Listing ---

Using ispell from emacs

* Word::			Checking a single word
* Buffer::			Checking a whole buffer
* Region::			Checking a region
* Multiple Dictionaries::	Using Multiple Dictionaries
@end menu


@iftex
@chapter ISPELL
@code{Ispell} is a program that helps you to correct spelling and
typographical errors in a file.  When presented with a word that is not
in the dictionary, @code{ispell} attempts to find @dfn{near misses} that
might include the word you meant.

This manual describes how to use @code{ispell} from within @code{emacs}.
Other information about @code{ispell} is available from the @code{Unix}
manual pages.
@end iftex

@ifinfo

@code{Ispell} is a program that helps you to correct spelling errors in
a file, and to find the correct spelling of words.  When presented with
a word that is not in the dictionary, @code{ispell} attempts to find
@dfn{near misses} that might include the word you meant.

This manual describes how to use ispell, as well as a little about
its implementation.

@end ifinfo

@menu
* Emacs::			Using ispell from emacs
* Old Emacs::			Old Emacs
* Private::			Your private dictionary
* Command summary::		All commands in emacs mode
* Near misses::			Definition of a near miss
* History::			Where it came from

@end menu

@node Emacs, Old Emacs, Top, Top
@section Using ispell from emacs

@menu
* Word::			Checking a single word
* Buffer::			Checking a whole buffer
* Region::			Checking a region
* Multiple Dictionaries::	Using Multiple Dictionaries
@end menu

@node Word, Buffer, Emacs, Emacs
@subsection Checking a single word

The simplest emacs command for calling ispell is 'M-$' (meta-dollar.  On
some terminals, you must type ESC-$.) This checks the spelling of the
word under the cursor.  If the word is found in the dictionary, then a
message is printed in the echo area.  Otherwise, ISPELL attempts to
generate near misses.

If any near misses are found, they are displayed in a separate window,
each preceded by a digit or character.  If one of these is the word you
wanted, just type its digit or character, and it will replace the
original word in your buffer.

If no near miss is right, or if none are displayed, you have five
choices:

@table @kbd
@item I

Insert the word in your private dictionary.  Use this if you know that
the word is spelled correctly.

@item A

Accept the word for the duration of this editing session, but do not put
it in your private dictionary.  Use this if you are not sure about the
spelling of the word, but you do not want to look it up immediately, or
for terms that appear in your document but are not truly words.  The
next time you start ispell, it will have forgotten any accepted words.

@item SPC

Leave the word alone, and consider it misspelled if it is checked again. 

@item R

Replace the word.  This command prompts you for a string in the
minibuffer.  You may type more than one word, and each word you type
is checked again, possibly finding other near misses.  This command
provides a handy way to close in on a word that you have no idea how
to spell.  You can keep trying different spellings until you find one
that is close enough to get a near miss. 

@item L

Lookup.  Display words from the dictionary that contain a 
specified substring.  The substring is a regular expression,
which means it can contain special characters to be more 
selective about which words get displayed.
@xref{Regexps, Regexps, Regexps, emacs, emacs}. @refill

If the only special character in the regular expression is a leading
@code{^}, then a very fast binary search will be used, instead of
scanning the whole file.

Only a few matching words can be displayed in the ISPELL window.
If you want to see more, use the @code{look} program directly from 
the shell.
@end table

Of course, you can also type @kbd{@ctrl{G}} to stop the command without
changing anything.

If you make a change that you don't like, just use emacs' normal undo
feature @xref{undo, undo, undo, emacs, emacs}.

@node Buffer, Region, Word, Emacs
@subsection Checking a whole buffer

If you want to check the spelling of all the words in a buffer, type
the command @kbd{M-x ispell-buffer}.  This command scans the file, and makes
a list of all the misspelled words.  When it is done, it moves the
cursor to the first word on the list, and acts like you just typed M-$
@xref{Word}.

When you finish with one word, the cursor is automatically moved to the
next.  If you want to stop in the middle of the list type @kbd{X} or
@kbd{@ctrl{G}}.

@node Region, Multiple Dictionaries, Buffer, Emacs
@subsection Checking a region

You may check the words in the region with the command @kbd{M-x ispell-region}.
See @xref{mark, mark, mark, emacs, emacs}.

The commands available are the same as for checking a whole buffer.

@node Multiple Dictionaries,  , Region, Emacs
@subsection Using Multiple Dictionaries

Your site may have multiple dictionaries installed: a default one
(usually @file{english.hash}), and several others for different
languages (e.g. @file{deutsch.hash}) or variations on a language (such as
British spelling for English).  

@table @code

@item ispell-change-dictionary
@findex ispell-change-dictionary

This is the command to change the dictionary.  It prompts for a new
dictionary name, with completion on the elements of @code{ispell-dictionary}.

It changes @code{ispell-dictionary} and kills the old ispell process, if
one was running.  A new one will be started as soon as necessary.

By just answering @kbd{RET} you can find out what the current dictionary
is.

@item ispell-dictionary
@vindex ispell-dictionary

If non-nil, a dictionary to use instead of the default one.
This is passed to the ispell process using the @code{-d} switch and is
used as key in @code{ispell-dictionary-alist}.

You should set this variable before your first call to ispell (e.g. in
your @file{.emacs}), or use the @kbd{M-x ispell-change-dictionary}
command to change it, as changing this variable only takes effect in a
newly started ispell process.

@item ispell-dictionary-alist
@vindex ispell-dictionary-alist

An alist of dictionaries and their associated parameters.

Each element of this list is also a list:

@example
(@var{dictionary-name}
    @var{casechars} @var{not-casechars} @var{otherchars} @var{many-otherchars-p}
    @var{ispell-args})
@end example

@var{dictionary-name} is a possible value of variable
@code{ispell-dictionary}, @code{nil} means the default dictionary.

@var{casechars} is a regular expression of valid characters that
comprise a word.

@var{not-casechars} is the opposite regexp of @var{casechars}.

@var{otherchars} is a regular expression of other characters that are
valid in word constructs.  Otherchars cannot be adjacent to each other
in a word, nor can they begin or end a word.  This implies we can't
check @samp{Stevens'} as a correct possessive and other correct
formations.

Hint: regexp syntax requires the hyphen to be declared first here.

@var{many-otherchars-p} is non-nil if many otherchars are to be allowed
in a word instead of only one.

@var{ispell-args} is a list of additional arguments passed to the ispell
subprocess.

Note that the @var{casechars} and @var{otherchars} slots of the alist should
contain the same character set as casechars and otherchars in the
@var{language}@file{.aff} file (e.g., @file{english.aff}).

@end table

@node Old Emacs, Private, Emacs, Top
@section Old Emacs

Until ispell becomes part of the standard emacs distribution, you will
have to explicitly request that it be loaded.  Put the following lines
in your emacs init file @xref{init file,, init file, emacs, emacs}.

@example
(autoload 'ispell-word "ispell" "Check the spelling of word in buffer." t)
(autoload 'ispell-region "ispell" "Check the spelling of region." t)
(autoload 'ispell-buffer "ispell" "Check the spelling of buffer." t)
(global-set-key "\e$" 'ispell-word)
@end example

(It will do no harm to have these lines in your init file even after
ispell is installed by default.)

@node Private, Command summary, Old Emacs, Top
@section Your private dictionary

Whenever ispell is started the file @file{.ispell_words} is read from
your home directory (if it exists).  This file contains a list of words,
one per line.  The order of the words is not important, but the case is.
Ispell will consider all of the words good, and will use them as
possible near misses.

The @kbd{I} command adds words to @file{.ispell_words}, so normally you
don't have to worry about the file.  You may want to check it from
time to time to make sure you have not accidentally inserted a
misspelled word.

@node Command summary, Near misses, Private, Top
@section All commands in emacs mode

@table @kbd
@item DIGIT
Select a near miss
@item I
Insert into private dictionary
@item A
Accept for this session
@item SPC
Skip this time
@item R
Replace with one or more words
@item L
Lookup: search the dictionary using a regular expression 
@item M-$
Check word
@item M-x ispell-buffer
Check buffer
@item M-x ispell-region
Check region
@item M-x ispell-change-dictionary
Select different dictionary.
@end table

@node Near misses, History, Command summary, Top
@section Definition of a near miss

Two words are near each other if they can be made identical with one
of the following changes to one of the words:

@example
Insert a blank space
Interchange two adjacent letters.
Change one letter.
Delete one letter.
Add one letter.
@end example

Someday, perhaps ispell will be extended so that words that sound
alike would also be considered near misses.  If you would like to
implement this, see Knuth, Volume 3, page 392 for a description of the
Soundex algorithm which might apply. 

@node History,  , Near misses, Top
@section Where it came from

Ispell has a long and convoluted history.  Originally called SPELL, it
was written by Ralph E. Gorin in 1971.  That version was written in
assembly language for the DEC PDP-10 to run under the WAITS operating
system at the Stanford Artificial Intelligence Laboratory.  Subsequent
versions, also in PDP-10 assembly language, were developed for the BBN
TENEX, MIT ITS, and DEC TOPS-10 and TOPS-20 operating systems.  It was
later revised by W. E. Matson (1974), and W. B. Ackerman (1978),
changing its name to ISPELL in the process.

In 1983, Pace Willisson (pace@@ai.mit.edu) converted this version to
the C language and modified it to work under Unix.

In 1987, Walt Buehring revised and enhanced ispell, and posted it to the
Usenet along with a dictionary.  In addition, Walt wrote the first version
of "ispell.el", the emacs interface.

Geoff Kuenning (geoff@@ITcorp.com, that's me, and by the way I pronounce
it "Kenning") picked up this version, fixed many bugs, and added further
enhancements.  In 1988 I got ambitious and rewrote major portions of the
code, resulting in the table-driven multi-lingual version.  Ken Stevens
(stevens@@hplabs.hp.com) made overwhelming contributions to the elisp
support to produce the version you are using now.

Due to a misunderstanding involving the Free Software Foundation, it
later became necessary to rename this version to ispell to avoid
confusion on the part of users.

Many other enhancements and bug fixes were provided by other people.
Although I omit mention here due to space, many of these people have
also made significant contributions to the version of ispell you see
here.  For a full list of people who have contributed to ispell, refer
to the file @file{Contributors} which is distributed with the ispell
sources.

@noindent
Geoff Kuenning @*
geoff@@ITcorp.com @*

@contents

@bye
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.