4

I recently switched to emacs24 and upgraded to Ubuntu 12.04. I can't seem to get hunspell working correctly again. I find hunspell to be better than aspell generally. Hunspell only wants to use the Australian dictionary and not English US dictionary or freezes up my system. With aspell I have no problem switching dictionaries or running flyspell mode.

My question is how do people have setup interactive spelling in emacs24?? Still using ispell and flyspell or any other setups preferred. Are you using hunspell with emacs24? I may continue to try to get this working but want to confirm elsewhere people don't have any issues.

J Spen
  • 2,614
  • 4
  • 26
  • 41

1 Answers1

5

I use hunspell on OS X (installed via homebrew) with Emacs 24 built from bzr. The relevant portions of my .emacs are below. I have not switched dictionaries however, so I can't help with that. It took me a while to get things set up, and it was a while ago so I don't remember why everything is the way it is.

(setq-default ispell-program-name "hunspell")
(setq ispell-dictionary "american"
  ispell-extra-args '() ;; TeX mode "-t"
  ispell-silently-savep t
  )

(setq flyspell-mode-map nil)

(add-hook 'ispell-initialize-spellchecker-hook
      (lambda ()
    (setq ispell-base-dicts-override-alist
          '((nil ; default
         "[A-Za-z]" "[^A-Za-z]" "[']" t
         ("-d" "en_US" "-i" "utf-8") nil utf-8)
        ("american" ; Yankee English
         "[A-Za-z]" "[^A-Za-z]" "[']" t
         ("-d" "en_US" "-i" "utf-8") nil utf-8)
        ("british" ; British English
         "[A-Za-z]" "[^A-Za-z]" "[']" t
         ("-d" "en_GB" "-i" "utf-8") nil utf-8)))))
Ivan Andrus
  • 5,221
  • 24
  • 31
  • Always get this error when I have a similar setup because tried everything from the interactive spell page to get it working: Starting new Ispell process [american] ... ispell-init-process: Can't open affix or dictionary files for dictionary named "american". @(#) International Ispell Version 3.2.06 (but really Hunspell 1.3.2). ######### Only seems to work if I use the default dictionary which is set to Australian. I can't figure out how to change it. I don't think it is looking in the right directory for the dictionary. How do I change that?? – J Spen Jul 25 '12 at 05:29
  • realized error is with debian-ispell.el and its insistance on having control of setting ispell dictionary list. Only way is to override ispell-local-dictionary-list that I could figure out but just removed the files to eliminate the problem and installed the base ispell and flyspell files. – J Spen Jul 25 '12 at 08:11
  • You should report the bug to debian then. I'm glad you got it figured out. – Ivan Andrus Jul 25 '12 at 11:12
  • 2
    Will do. Breifly looked at modifying the package and I just think updating the default location for libraries when hunspell is set should probably do the trick. Hopefully force it to load the correct libraries. Rw-hunspell figures out the correct libraries but doesn't set ispell directly I think because of some of the hooks in debian-ispell from the looks of it. I will try to submit the bug. – J Spen Jul 25 '12 at 11:33
  • Offtopic but I had seen you wrote something how to ignore regions that someone had linked to there dealing with ispell and think what I want to do is relatively easy to modify that but not sure how. Only needs to check that first text on the line is #+ then if it is in a list of labels a varible that I would set don't spell check region: http://stackoverflow.com/questions/11646880/flyspell-in-org-mode-recognize-latex-syntax-like-auctex#comment15434608_11646880 – J Spen Jul 25 '12 at 15:46
  • Where are your dictionaries located? – garyp Aug 23 '14 at 19:23