9

I just upgraded to Emacs 24 and can't find ispell. If I try to use ispell I get the error message:

Searching for program: no such file or directory, ispell

After a small amount of searching on the Unix & Linux SE, I found that I should put this code in my .emacs file: (setq ispell-program-name "/path/to/ispell"). But I can't figure out what ispell's path is. Can anybody tell me? I'm on Mac OS10.8 and GNU emacs 24.5.1.

Ruby
  • 335
  • 3
  • 8
  • 1
    Were you getting this error before you added `(setq ispell-program-name "/path/to/ispell")` to your `.emacs`? If so try removing it. Also, you can try running `emacs -Q` from the terminal and then `M-x ispell RET`. For me though, the path to `ispell-program` is `/usr/bin/aspell`, but I am on Linux, and it will likely be different on OS X – elethan Dec 30 '15 at 20:23
  • On Linux systems `ispell` is typically an alias for a program with a conforming interface, not necessary the original `ispell`. Not sure what's going on on Macs, but, quite certainly, you could create an alias for whatever program you run instead, by, say, placing a symlink with the name `ispell` pointing at it somewhere on the `$PATH`. – wvxvw Dec 30 '15 at 20:39
  • @elethan: Yes, I was getting the error before. I haven't evaluated the elisp command yet, since I don't know what the path to ispell is. I've now looked for ispell and aspell in /usr/bin, /usr/local/bin, and some OSX-specific places. But still no joy. – Ruby Dec 30 '15 at 20:41
  • @wvxvw: I haven't begun running a spell program yet. I upgraded to Emacs 24 just yesterday. – Ruby Dec 30 '15 at 20:47
  • Some common replacement are `aspell` and `hunspell`. Try, in terminal, to type either `aspell` or `hunspell` and tab-complete those, maybe something will come up. Also, try `compgen -c | grep spell` in your shell to see what programs are there that have `spell` in their name. Provided your shell is Bash. – wvxvw Dec 30 '15 at 20:58
  • @wvxvw: I found `ispell.el` and `ispell.elc` knocking around in some old Emacs trees that I have in my Dropbox. I copied them to `/usr/local/bin` and put this in my `.emacs`: `(setq ispell-program-name "/usr/local/bin/ispell")`. But now when I run `ispell` I get the updated error message: `Searching for program: no such file or directory, /usr/local/bin/ispell`. But I see `ispell.el` and `ispell.elc` right there in `/usr/local/bin`. Any advice? – Ruby Dec 30 '15 at 21:18
  • 1
    No, these are the "glue" code for Emacs to be able to use the actual spell checker program. They don't do the spell checking. I believe that if you use Homebrew or another package manager, you should be able to install `aspell`. I'm not 100% sure, but I think that Open Office (and Libre Office too) come with `hunspell`. – wvxvw Dec 30 '15 at 21:21

1 Answers1

16

This isn't an Emacs problem. You need to have the ispell program installed on your machine. ispell is available on homebrew, so you can do:

$ brew install ispell

That's probably all you need. If Emacs can't find ispell after you've installed it:

$ which ispell

will tell you the path to the ispell executable.

Alternatively, aspell and hunspell are compatible and can be used instead.

Wilfred Hughes
  • 6,890
  • 2
  • 29
  • 59
  • @WilfridHughes: I found `aspell` on my machine and assigned it to the variable `ispell-program-name`. But I still don't have `ispell` working. I now get the error message: `Error: No word lists can be found for the language "en-US". WARNING: Unable to enter Nroff mode: Unknown mode: "nroff".` I still have an old version of Emacs (22) for which ispell is working fine, with tons of different languages, so I know that the relevant files are somewhere on my machine. But I don't know what to do next! – Ruby Dec 31 '15 at 19:16
  • @WilfridHughes: ^^^ I neglected to clarify that I'm talking about Emacs 24, which I've just updated to. I kept the old Emacs (22) in case of situations like this one. – Ruby Dec 31 '15 at 22:20