Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ispell/aspell on Mac 10.7: "Searching for program: No such file or directory, aspell"

717 views
Skip to first unread message

Marius Hofert

unread,
Oct 24, 2011, 11:27:07 AM10/24/11
to Emacs help
Hi,

I'm working with Emacs 23.3 on Mac OS X 10.7.2. I would like to use aspell for spell checking, but I get an error. Here is what I tried so far and the corresponding results:

1) downloaded and installed aspell-0.60.6.1.tar.gz
2) copied ./scripts/ispell and ./scripts/spell to /usr/local/bin [recommended in README]
3) downloaded and installed aspell6-en-7.1-0.tar.bz2 [English dictionary]
4) tested aspell in the terminal => works
5) downloaded http://www-sop.inria.fr/members/Manuel.Serrano/flyspell/flyspell.html
6) put it in ~/.emacs.d/flyspell under the name "flyspell.el"
7) put in ~/.emacs:
(add-to-list 'load-path "~/.emacs.d/flyspell")
(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)
(setq-default ispell-program-name "aspell")

If I open a .tex file and use M-x flyspell-mode, I obtain: "Searching for program: No such file or directory, aspell".
Without the last line in 7), I obtain "Searching for program: No such file or directory, ispell". Both ispell and aspell are working in the terminal, why not in emacs?

The buffer *Messages* says:
...
Applying style hooks... done
Loading /Users/mhofert/.emacs.d/flyspell/flyspell.el (source)...done
Local Ispell dictionary set to nil
Starting new Ispell process [default] ...
apply: Searching for program: No such file or directory, aspell


Cheers,

Marius

Mario Lassnig

unread,
Oct 24, 2011, 11:34:28 AM10/24/11
to
On 11-10-24 17:27 , Marius Hofert wrote:
> Hi,

Gruezi,

>
> I'm working with Emacs 23.3 on Mac OS X 10.7.2. I would like to use aspell for spell
> checking, but I get an error. Here is what I tried so far and the
corresponding results:
>
> 1) downloaded and installed aspell-0.60.6.1.tar.gz
> 2) copied ./scripts/ispell and ./scripts/spell to /usr/local/bin [recommended in README]
> 3) downloaded and installed aspell6-en-7.1-0.tar.bz2 [English dictionary]
> 4) tested aspell in the terminal => works

Ok until now...

> 5) downloaded http://www-sop.inria.fr/members/Manuel.Serrano/flyspell/flyspell.html
> 6) put it in ~/.emacs.d/flyspell under the name "flyspell.el"
> 7) put in ~/.emacs:
> (add-to-list 'load-path "~/.emacs.d/flyspell")
> (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)

... in principle not necessary, as e23.3 comes with flyspell prepackaged ...

> (setq-default ispell-program-name "aspell")

... the trick comes here:

(setq-default ispell-program-name "/usr/local/bin/aspell")
(setq-default ispell-list-command "list")

Ciao,
Mario

Mario Lassnig

unread,
Oct 24, 2011, 11:36:18 AM10/24/11
to
On 11-10-24 17:27 , Marius Hofert wrote:
> Hi,

Gruezi,

>
> I'm working with Emacs 23.3 on Mac OS X 10.7.2. I would like to use
aspell for spell
> checking, but I get an error. Here is what I tried so far and the
corresponding results:
>
> 1) downloaded and installed aspell-0.60.6.1.tar.gz
> 2) copied ./scripts/ispell and ./scripts/spell to /usr/local/bin
[recommended in README]
> 3) downloaded and installed aspell6-en-7.1-0.tar.bz2 [English dictionary]
> 4) tested aspell in the terminal => works

Ok until now...

> 5) downloaded
http://www-sop.inria.fr/members/Manuel.Serrano/flyspell/flyspell.html
> 6) put it in ~/.emacs.d/flyspell under the name "flyspell.el"
> 7) put in ~/.emacs:
> (add-to-list 'load-path "~/.emacs.d/flyspell")
> (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)

... in principle not necessary, as e23.3 comes with flyspell prepackaged ...

> (setq-default ispell-program-name "aspell")

... the trick comes here:

(setq-default ispell-program-name "/usr/local/bin/aspell")
(setq-default ispell-list-command "list")

Ciao,
Mario

>

Marius Hofert

unread,
Oct 24, 2011, 12:03:12 PM10/24/11
to ma...@lassnig.net, Emacs help
Dear Mario,

thanks a lot for your help.
I also thought that steps 5) to 7) are not necessary, but without manually setting up flyspell.el, I obtained:
Starting new Ispell process [default] ...
Enabling Flyspell mode gave an error

Okay, I removed the flyspell folder (containing flyspell.el) and put in the following in .emacs (as you suggested):
(setq-default ispell-program-name "/usr/local/bin/aspell")
(setq-default ispell-list-command "list")
Without the first command, I get the message "Enabling Flyspell mode gave an error", so even if aspell belongs to PATH it is not found. Hmm...

I also put in the following in .emacs:
(add-hook 'text-mode-hook 'flyspell-mode); enable flyspell mode for text-mode
(mapcar (lambda (mode-hook) (add-hook mode-hook 'flyspell-prog-mode))
'(c-mode-common-hook R-mode-hook emacs-lisp-mode-hook))
The second/third lines are to use flyspell-prog-mode for .c and .R files (and emacs-lisp). However, this does not seem to have an impact when I opened a .c file and put in wrong character sequences in the comments... How does this work?

Cheers,

Marius

Marius Hofert

unread,
Oct 24, 2011, 4:30:07 PM10/24/11
to mario....@cern.ch, Emacs help
Okay, just figured out, that aspell did not work in the emacs shell (only in terminal.app). A restart cleared everything, so aspell is now found and I don't even need the two setq-default commands :-)

Cheers,

Marius

On 2011-10-24, at 20:16 , Mario Lassnig wrote:

> Hi,
>
> On 11-10-24 18:03 , Marius Hofert wrote:
>> Dear Mario,
>>
>> thanks a lot for your help.
>> I also thought that steps 5) to 7) are not necessary, but without manually setting up flyspell.el, I obtained:
>> Starting new Ispell process [default] ...
>> Enabling Flyspell mode gave an error
>
> hmmm, i don't even have any load/require/anything in my init.el...
> it just works for me... (this guy here: http://emacsformacosx.com/)
>
>> Okay, I removed the flyspell folder (containing flyspell.el) and put in the following in .emacs (as you suggested):
>> (setq-default ispell-program-name "/usr/local/bin/aspell")
>> (setq-default ispell-list-command "list")
>> Without the first command, I get the message "Enabling Flyspell mode gave an error", so even if aspell belongs to PATH it is not found. Hmm...
>
> the osx environment is a bit messed up. it's a huge pita to do this correctly. the easiest way is just to put the full path to aspell in the ispell-program-name.
>
>>
>> I also put in the following in .emacs:
>> (add-hook 'text-mode-hook 'flyspell-mode); enable flyspell mode for text-mode
>> (mapcar (lambda (mode-hook) (add-hook mode-hook 'flyspell-prog-mode))
>> '(c-mode-common-hook R-mode-hook emacs-lisp-mode-hook))
>> The second/third lines are to use flyspell-prog-mode for .c and .R files (and emacs-lisp). However, this does not seem to have an impact when I opened a .c file and put in wrong character sequences in the comments... How does this work?
>
> i didn't even know that there's a flyspell-prog mode :-)
> i use it for latex only
>
> cheers,
> mario
>
>>
>> Cheers,
>>
>> Marius
>
> --
> Mario Lassnig
> CERN PH-ADP-DDM 1-R-022
> CH-1211 Geneve 23
> mario....@cern.ch
> +41 22 76 71268
>


Stefan Monnier

unread,
Oct 24, 2011, 5:07:31 PM10/24/11
to
> I also thought that steps 5) to 7) are not necessary, but without manually
> setting up flyspell.el, I obtained:
> Starting new Ispell process [default] ...
> Enabling Flyspell mode gave an error

I'm not sure what's the difference between the flyspell.el we include in
Emacs and the one distributed by Manuel (I thought he had stopped
maintaining it several years ago).
So if you use his version, you may want to contact him.

But AFAIK the flyspell.el that comes with Emacs should work fine under
Mac OS X, so you might want to try that one and investigate why it
doesn't work.


Stefan
0 new messages