I am new to Emacs and I have a hard time to have spelling check when I use Emacs+AUCTex.

Here is a list of what I have done so far:

  1. I read on a post saying that I should not install Flyspell. So I did not.
  2. I followed some instructions on Homebrew. I think I have installed ispell successfully.
  3. When I tried to install aspell, it says Error: No available formula with the name "aspell-en".

Now when I use M-x ispell, it says Searching for program: No such file or directory, ispell.

I saw different solutions online and tried some, but none of them worked. And since I am new to Emacs, I also do not want to mess up my .emacs file too much. So I come here for some help.

  • Flyspell minor mode comes built-in with emacs. No need to install it. – Heikki Jun 29 '17 at 18:19
  • What command you used to try to install aspell? 'brew install aspell' should work. If it does not, update your brew database and try again. – Heikki Jun 29 '17 at 18:25
  • You have not installed ispell succesfully. There should be an executable with that name. Unix command 'which ispell' should show where it is. – Heikki Jun 29 '17 at 18:27
  • Usually this happens if your Emacs does not read the $PATH properly. Search for what to do in your system to make sure your $PATH is available to Emacs. – n_x_l Apr 23 '19 at 18:08

Firstly you need to get aspell installed correctly. As mentioned in the comments "brew install aspell" should be all you need. If that doesn't work then you have a problem with brew. By default this will install the "aspell" executable (not that it's not called "ispell") into /usr/local/bin. You need to tell Emacs to use "aspell" instead of "ispell" which you can do by adding (setq ispell-program-name "/usr/local/bin/aspell") to your Emacs init file. Running M-x ispell should then run your aspell programme.

  • 1
    From my experience Emacs has a fallback list, and it should be able to find aspell without any configuration. Setting the path to it makes sense if you are trying to install aspell on the fly after you figured out you don't have it and you don't want to restart Emacs. – DoMiNeLa10 Aug 31 '17 at 9:26

flyspell is an independent minor mode which use a few APIs from ispell. So you are actually using flyspell instead of ispell to do the spelling check.

  1. flyspell is built in package of Emacs. You don't need install it manually

  2. "I think I have installed ispell successfully" doesn't make sense. You need install aspell and its dictionaries. Then you need tweak a few variables from ispell to actually use flyspell (as I mentioned, flyspell re-use a few APIs from ispell)

  3. See https://github.com/Homebrew/homebrew-core/issues/2419 , make sure you have the right version of aspell installed from homebrew (try which aspell in shell)

After installing aspell and its dictionaries successfully, you need setup flyspell,

 (setq ispell-program-name "aspell")
 ;; Please note ispell-extra-args contains ACTUAL parameters passed to aspell
 (setq ispell-extra-args '("--sug-mode=ultra" "--lang=en_US")

Usage is simple, either M-x flyspell-buffer to manually check the buffer for once or M-x flyspell-mode to turn on on-the-fly spell checking.

See http://blog.binchen.org/posts/what-s-the-best-spell-check-set-up-in-emacs.html for details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.