Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm using brew as my package manager for both Emacs and ispell. I have both installed. Doing a quick google, I was unable to figure out how to tell Emacs where ispell is and to load the appropriate dictionaries.

Right now when I do a M-x ispell-check-version, Emacs saucily replies: Searching for program: No such file or directory.

How do I configure Emacs to use ispell?

share|improve this question

3 Answers 3

The variable you're looking for is ispell-program-name. Stuff this somewhere in your .emacs:

(setq ispell-program-name "/path/to/ispell")

Or use M-x set-variable, etc.

References:

  • From the sources to ispell.el

    (defcustom ispell-program-name
      (or (locate-file "aspell"   exec-path exec-suffixes 'file-executable-p)
          (locate-file "ispell"   exec-path exec-suffixes 'file-executable-p)
          (locate-file "hunspell" exec-path exec-suffixes 'file-executable-p)
          "ispell")
      "Program invoked by \\[ispell-word] and \\[ispell-region] commands."
      :type 'string
      :group 'ispell)
    
  • See also: http://emacswiki.org/emacs/InteractiveSpell

Whenever you can't find an Emacs function, remember C-h f (or a variable: C-h v). Entering ispell at the Describe function prompt tells you that ispell is an interactive compiled Lisp function in 'ispell.el'., and from there you can usually find what you're looking for.

share|improve this answer
    
If you use set-variable to set ispell-program-name make sure you put double quotes around the value. In my case it was "/opt/local/bin/aspell" –  Jistanidiot Aug 28 at 14:35

What helped me solve this without editing my .emacs with absolute paths (which I was reluctant to do, as I share the file between different OSs) was installing ispell via brew

brew install ispell --with-lang-en

as explained in this answer (and my comment).

share|improve this answer

Even if you use brew only for the ispell install and have installed emacs from this type of dmg, and you run emacs from an icon in the dock, you'll want to logout and login again, since OS X caches items in your path and won't see ispell immediately. If this information isn't news to you, then you can probably work around this issue anyway.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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