I am trying to configure Hunspell in my emacs running in windows. When I type M-x ispell-buffer, I get the following error:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("," nil 0)
  split-string(nil "," t)
  ispell-region(1 25)
  call-interactively(ispell-buffer record nil)
  command-execute(ispell-buffer record)
  execute-extended-command(nil "ispell-buffer" "ispell-bu")
  funcall-interactively(execute-extended-command nil "ispell-buffer" "ispell-bu")
  call-interactively(execute-extended-command nil nil)

My .emacs file looks like this:

(setq exec-path (append exec-path '("D:/programs/emacs/hunspell/bin/")))

(setq ispell-program-name "hunspell")
;; below two lines reset the the hunspell to it STOPS querying locale!
(setq ispell-local-dictionary "en_US")
;; "en_US" is key to lookup in `ispell-local-dictionary-alist`
(setq ispell-local-dictionary-alist
      '(("en_US" "[[:alpha:]]" "[^[:alpha:]]" "[']"
     nil ("-d" "en_US") nil utf-8)))

See Hunspell flyspell and Emacs on windows

Please figure out the version of hunspell you use. It supports either Windows style path or Unix style path but not both. Then setup environment variable DICTPATH properly.

  • Yes. I did it. I added the DICPATH varible in my .emacs file. Thanks. It's working now. – Sreekumar R Jul 18 '17 at 7:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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