Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enabling flyspell mode on emacs/w32?

Tags:

emacs

flyspell

I need to install/run flyspell mode on emacs/w32.

I installed ispell for windows from this site, and then I followed the procedure written in here.

  1. I downloaded the flyspell-1.7a.el to rename it as flyspell.el, and copied it to the load-path directory.
  2. I modified the .emacs
;;; http://www-sop.inria.fr/members/Manuel.Serrano/flyspell/flyspell.html
;;; flyspell mode
  (require '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) 
)

But, when I run emacs with flymode, I got the following error.

(error "Autoloading failed to define function turn-on-flyspell")

What might be wrong?

SOLUTION with ISPELL

It was ispell for win32's problem, one should use the one that works with emacs/win32 as is explained in the book of emacs.

  1. Download ispell.zip from one of the site.
  2. Copy the ispell.exe to the PATH directory, and copy the English dictionary to the home directory.

SOLUTION with ASPELL

vedang gave a better answer with aspell at this post.

It has windows installer, dictionary install in here. And adding the following line in .emacs works fine with me.

(custom-set-variables
    '(ispell-dictionary "british")
    '(ispell-program-name "H:\\bin\\aspell\\bin\\aspell.exe"))
like image 896
prosseek Avatar asked Sep 27 '10 16:09

prosseek


1 Answers

It makes little sense to both require flyspell (which will load the library), and then also declare autoloads for two of its functions (the purpose of which is to avoid loading the library in advance of those functions being called.

I don't know if this is causing the error (possibly the subsequent autoloads clobber the real definitions?), but there's definitely no need for both.

In fact, on Emacs 23.2.1 (if not much earlier), flyspell.el declares its own autoloads (as do all built-in libraries, I believe), so you really shouldn't have to do any of that at all if you are running a sufficiently up to date version. Which version of Emacs are we talking about?

edit: in fact flyspell-delay-command is not autoloaded by default in 23.2.1, so you might want to retain that line if you decide to remove the require.

like image 110
phils Avatar answered Sep 24 '22 21:09

phils