Emacs cannot find flyspell/ispell
Asked Answered
G

3

21

On my Mac (Snow Leopard, 10.6.8), I'm using a modified version of Emacs 24.2 provided here to utilize Emacs Speaks Statistics (ESS) from the downloads page. Emacs works, but I haven't yet been able to get a spell checker to work.

To rectify this, I'm following the instructions from this page to download flyspell. I copied the flyspell.el file into my /Applications/Emacs.app/Contents/Resources/site-lisp directory, which is apparently the directory of my emacs load path (note that, for instance, the auctex.el file is located in that directory).

Then, I modified my .emacs file by adding:

(autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t)
(autoload 'flyspell-delay-command "flyspell" "Delay on command." t)
(autoload 'tex-mode-flyspell-verify "flyspell" "" t)
(add-hook 'LaTeX-mode-hook 'turn-on-flyspell)

When I open a .tex file, and use M-x flyspell-mode, I can "auto-complete" it (i.e. by pressing tab it gives me the correct flyspell options) but when I press RET I get:

Searching for program: no such file or directory, ispell

None of the solutions posed in this question or this question worked, so I'm not sure what the issue is here. Does anyone have ideas or has encountered this problem before?

Gennie answered 15/6, 2013 at 19:2 Comment(0)
S
37

Please, please read the documentation provided by Emacs itself before trying arbitrary instructions from random websites.

Emacs 24.2 includes Flyspell. You must not explicitly install it. If you do so, undo this, that is, delete flyspell.el from /Applications/Emacs.app/Contents/Resources/site-lisp. At best, delete /Applications/Emacs.app completely, and re-install it, to start from scratch.

However, Flyspell needs a spell checking tool, which is not included in Emacs. The error message tells you that you have no such tool installed.

You need to install the ASpell spell checker. You can install it with homebrew with brew install aspell.

Subaqueous answered 15/6, 2013 at 21:46 Comment(8)
or Macports as an alternative to Homebrew.Keyser
If the O.P. wants to make his / her life really easy, use Aquamacs instead -- it uses the OSX built-in NSSpellChecker. Then the O.P. doesn't need anything.Keyser
@Keyser Aquamacs is not easy. With Aquamacs, he'd have to install ESS by himself, which is arguably not harder than installing aspell, but it's not easier, too. Plus, Aquamacs still builds on Emacs 23, which is outdated, and not supported anymore by quite some packages.Subaqueous
Actually, installing aspell didn't work for me. After doing brew install ispell --with-lang-en, though, flyspell-mode recognised it.Inglebert
Sorry for the really late comment, but yeah, I got things to work. Thanks especially for the tip with brewGennie
OP's question is not surprising as it is not obvious from the flyspell website that one needs to install aspell.Kerguelen
Installing aspell and ispell alone did not fix the problem for me. I also had to add (setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin")) and (setq exec-path (append exec-path '("/usr/local/bin"))) to my .emacs file, as suggested here.Psalm
As is obvious from the comments here, "RTFM" is not a sufficient response. In fact it is almost never a good response. I have rarely seen a manual that provided more than a bare-bone understanding of a package. Please try to be more helpful if you are going to post on Stackoverflow.Teeters
C
11

I used homebrew to install ispell and apsell and would get which ever one I set in ~/.emacs with

[iMac ~]$ cat .emacs
(setq ispell-program-name "/usr/local/bin/aspell")

There is a similar discussion of this here

Cuprite answered 12/11, 2016 at 3:51 Comment(0)
M
4

On windows I had to do the following to start Ispell process:

  1. downloaded ispell (http://www.ssc.wisc.edu/~dvanness/ispell.htm)
  2. Unzip content in a folder that is in my path (i.e. Windows or c:\windows\system
  3. download aspell (http://aspell.net/win32/)- get the full download. see the link on the page. (whether you need ispell or not, I am not sure)
  4. Add the code shown below to your init.el file

  5. Run aspell installer

  6. Start emacs again, the error should not come up.

    (require 'package)
    (add-to-list 'package-archives
             '("MELPA Stable" . "http://stable.melpa.org/packages/") t)
    (package-initialize)
    (package-refresh-contents)
    
    (package-install 'flycheck)
    
    (global-flycheck-mode)
    
    (use-package flycheck
      :ensure t
      :init
      (global-flycheck-mode t))
    
    (setq ispell-program-name "C:\\Program Files (x86)\\Aspell\\bin\\aspell.exe"
    

You many not have to do all the above but this is what worked for me on Emacs running on Windows 7.

Misjudge answered 9/3, 2017 at 16:54 Comment(5)
This worked, though I did not need to install ispell at all. Just needed to install aspell and set the ispell-program-name to point to it. Aspell is the newer ispell, and seem to work just fine.Pyles
Looks like aspell no longer works on Windows with emacs 26.1Pyles
Got it to work using hunspell instead: lists.gnu.org/archive/html/help-gnu-emacs/2014-04/msg00030.htmlPyles
WARNING: Do not unzip random files the internet into c:\windows\system. Sure it's probably OK here but it's bad practiceCarbaugh
Generally a good point.Misjudge

© 2022 - 2024 — McMap. All rights reserved.