Previous: Spellchecking Individual Files, Up: Basic Usage



3.2 Using Aspell with other Applications

3.2.1 With Applications that Expect Ispell

Aspell can be used as a drop in replacement for Ispell for programs that use Ispell through a pipe such as Emacs and LyX. It can also be used with programs that simply call the ispell command and expect the original file to be overwritten with the corrected version. It supports the basic features of Ispell, however it does not currently have a Nroff mode so there may be situations in which you still wish to use Ispell. Nevertheless, I have been using Aspell for Xemacs and LyX since the middle of September of 1998 without any problems.

If you do not have Ispell installed on your system and have installed the Ispell compatibly script than you should not need to do anything as most applications will that expect Ispell will work as expected with Aspell via the Ispell compatibility script.

Otherwise, the recommended way to use Aspell as a replacement for Ispell is to change the ispell command from within the program being used. If the program uses ispell in pipe mode simple change ispell to aspell. If the program calls the ispell command to check the file change ispell with aspell check.

If that is impossible and the program uses Ispell through a pipe than the run-with-aspell script can be used for programs using Ispell in pipe mode. The format of the script is:

     run-with-aspell command

where command is the name of the program with any optional arguments.

The old method of mapping Ispell to Aspell is discouraged because it can create compatibility problems with programs that actually require Ispell such as Ispell's own scripts.

3.2.2 With Emacs and Xemacs

The easiest way to use Aspell with Emacs or Xemacs is to add this line:

(setq-default ispell-program-name "aspell")

to the end of your .emacs file.

For some reason version 3.0 of ispell.el (the lisp program that (x)emacs uses) want to reverse the suggestion list. To fix this add this line:

(setq-default ispell-extra-args '("--reverse"))

after the previous line in your .emacs file and it should solve the problem.

Ispell.el, version 3.1 (December 1, 1998) and better, has the list reversing problem fixed. You can find it at http://www.kdstevens.com/~stevens/ispell-page.html.

3.2.3 With LyX

Version 1.0 of LyX provides support for Aspell's learning from user's mistakes feature.

To use aspell with LyX 1.0 either change the spell_command option in the .lyxrc file or use the run-with-aspell utility.

3.2.4 With VIM

To use Aspell in VIM you simply need to add the following line to your .vimrc file:

map ^T :w!<CR>:!aspell check %<CR>:e! %<CR>

I use Ctrl-T since that's the way you spell check in pico. In order to add a control character to your .vimrc you must type Ctrl-v first. In this case Ctrl-v Ctrl-t.

A more useful way to use Aspell, IMHO, is in combination with Newsbody (http://www.image.dk/~byrial/newsbody/) which is how I use it since VIM is my editor for my mailer and my news reader.

map ^T\\1\\2<CR>:e! %<CR>
map \\1 :w!<CR>
map \\2 :!newsbody -qs -n % -p aspell check \\%f<CR>

3.2.5 With Pine

To use Aspell in Pine simply change the option speller to

     aspell --mode=email check

To change the speller option go to the main menu. Type S for setup, C for config, then W for where is. Type in speller as the word to find. The speller option should be highlighted now. Hit enter, type in the above line, and hit enter again. Then type E for exit setup and Y to save the change.

If you have a strong desire to check other people's comments change speller to

     aspell check

instead which will avoid switching Aspell into email mode.