[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.0 Using ispell from emacs

1.0.1 Checking a single word  
1.0.2 Checking a whole buffer  
1.0.3 Checking a region  
1.0.4 Using Multiple Dictionaries  

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.0.1 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:


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


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.


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


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.


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. See section `Regexps' in emacs.

If the only special character in the regular expression is a leading ^, 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 look program directly from the shell.

Of course, you can also type C-g to stop the command without changing anything.

If you make a change that you don't like, just use emacs' normal undo feature See section `undo' in emacs.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.0.2 Checking a whole buffer

If you want to check the spelling of all the words in a buffer, type the command 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-$ See section 1.0.1 Checking a single 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 X or C-g.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.0.3 Checking a region

You may check the words in the region with the command M-x ispell-region. See See section `mark' in emacs.

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

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.0.4 Using Multiple Dictionaries

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


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

It changes 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 RET you can find out what the current dictionary is.


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

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


An alist of dictionaries and their associated parameters.

Each element of this list is also a list:

    casechars not-casechars otherchars many-otherchars-p

dictionary-name is a possible value of variable ispell-dictionary, nil means the default dictionary.

casechars is a regular expression of valid characters that comprise a word.

not-casechars is the opposite regexp of casechars.

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 `Stevens'' as a correct possessive and other correct formations.

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

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

ispell-args is a list of additional arguments passed to the ispell subprocess.

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

[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by XEmacs Webmaster on October, 2 2007 using texi2html