I am using Emacs 26.1 on MacOS 10.14.2. I am trying to use hunspell with 3 dictionaries that are installed in ~/Library/Spelling but when I start Emacs I got the following error: Wrong type argument: stringp, nil

;; Portuguese dictionary
 (with-eval-after-load "ispell"
   (setq ispell-program-name "hunspell")
   (setq ispell-dictionary "en_GB,en_US,pt_PT")
;;   ispell-set-spellchecker-params has to be called
;;   before ispell-hunspell-add-multi-dic will work
   (ispell-hunspell-add-multi-dic "en_GB,en_US,pt_PT"))
  • It seems that you have an error in your init file, my guess is that it's the call to ispell-set-spellchecker-params, which probably takes some arguments. You could try commenting out different expressions to pin down the problem.
    – user12563
    Jan 15, 2019 at 18:36
  • I commented out the last 2 lines and Emacs starts with no error. But I have no spell checking. I don't know what parameters I am missing after ispell-set-spellchecker-params. I followed the answer to emacs.stackexchange.com/questions/21378/….
    – sbac
    Jan 15, 2019 at 18:57
  • What steps have you taken to configure hunspell to look in ~/Library/Spelling? I don't use hunspell, but perhaps there is a conf file (that either exists already, or can be created in the right location) where a user may specify the path of a dictionary location if it is different than what was specified (or the default) when the program was built.
    – lawlist
    Jan 15, 2019 at 19:38
  • Well I tried to configure hunspell with the following: (setenv "DICPATH" (concat (getenv "HOME") "/Library/Spelling")) but I got an init error.
    – sbac
    Jan 15, 2019 at 20:30


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.