First, how to set up aspell. Get it from [url=http://aspell.net/]its Web 
site[/url]. Compile and install with

./configure --disable-curses
gmake
pfexec gmake install

You need to add at least one dictionary for aspell. You can get them from the 
aspell Web site and install them by following the directions in the README file 
(the usual configure/make/make install). Make sure that /usr/local/bin is in 
your PATH. Add the following to your .emacs file:

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

And that's it. Spell checking works the way it does under Emacs with any recent 
Linux distro I've tried (not that I've done a lot of testing).

Now, here's how I set up Hunspell. Download it from 
[url=http://hunspell.sourceforge.net/]SourceForge[/url]. Compilation and 
installation works in the usual way (using gmake instead of make). To make it 
use the Myspell/Hunspell dictionaries that are supplied as IPS packages, add 
the following to your .bashrc:

export DICPATH=/usr/lib/firefox/dictionaries
export DICTIONARY=en-US

Hunspell now works from the command line. Here's a sample session:

u...@diotima:~$ hunspell
Hunspell 1.2.8
cet
& cet 15 0: vet, cwt, ct, et, cent, cert, etc, set, cit, cat, net, cot, let, 
cut, get

To set up Emacs for use of Hunspell, I put the following in my .emacs file:

(eval-after-load "ispell"
    (progn
      (setq ispell-dictionary "en-US"
            ispell-extra-args '("-i" "utf-8") ; aspell doesn't understand -i 
utf-8, hunspell needs it
            ispell-silently-savep t)))
(setq-default ispell-program-name "hunspell")

I got the template for this from 
[url=http://www.emacswiki.org/emacs/InteractiveSpell]the Emacs Wiki[/url]. (I 
removed "-a" from ispell-extra-args since it doesn't make any difference, and 
since ispell.el seems to pass it to Hunspell already, without its inclusion in 
ispell-extra-args.)

If you try to spell check a word by using "M-x ispell-word", you get the error 
message "ispell-get-word: Wrong type argument: stringp, nil". "M-x 
ispell-buffer" produces

Spell checking test-buffer using hunspell with en-US dictionary...
Spell-checking using hunspell with en-US dictionary done
ispell-get-line: Wrong type argument: stringp, nil

>From what I can tell by Googling, you run into the same problem if you try to 
>use Emacs with Hunspell under Linux. Hunspell and/or ispell.el need to be 
>changed to work with each other correctly.
-- 
This message posted from opensolaris.org
_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to