Saturday, May 19, 2012

(Searching for program No such file or directory aspell)


After installing GNU Emacs on Mac OS 10.7 and trying to spell check a word with M-$ you might see:
(Searching for program No such file or directory aspell)
Here's a quick fix
  1. install homebrew
  2. brew install aspell --lang=en
  3. Add the following to your .emacs and exec each line (C-x e)
(setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin"))
(setq exec-path (append exec-path '("/usr/local/bin")))
The problem is that OS X doesn't come with a aspell or ispell by default so you can install it with Homebrew. Homebrew installs everything in /usr/local/ but GNU Emacs for OS X doesn't look there; i.e. it's not in its path, thus the two lines above add it to Emacs' path.