4

I have update to macOS Sierra after witch spelling in Emacs is broken. The error I get is (ispell-phaf: No matching entry for en_GB in ´ispell-hunspell-dict-paths-alist´)

I have both install aspell and hunspell via homebrew, I have the following content in my ~/Library/Spelling folder:

.
├── dynamic-counts.dat
├── dynamic-text.dat
├── en_AU.aff
├── en_AU.dic
├── en_CA.aff
├── en_CA.dic
├── en_GB.aff
├── en_GB.dic
├── en_US.aff
├── en_US.dic
├── en_ZA.aff
├── en_ZA.dic
├── hyph_en_GB.dic
└── hyph_en_US.dic

And I have the following in my .emacs file:

;;; Set dictonary
(setenv "DICTIONARY" "en_GB")
;;; For loading hunspell insteand of ispell
(setq ispell-local-dictionary "en_GB")
(when (executable-find "hunspell")
 (setq-default ispell-program-name "hunspell")
 (setq ispell-really-hunspell t))

Does someone have an idea as to what is wrong. This worked under MacOS El Capitan and therefore I find it strange that it suddenly does not.

EDIT: Result of hunspell -D

hunspell -D
SEARCH PATH:
.:::/Users/larsnielsen/Library/Spelling:/usr/share/hunspell:/usr/share/myspell:/usr/share/myspell/dicts:/Library/Spelling:/Users/larsnielsen/.openoffice.org/3/user/wordbook:.openoffice.org2/user/wordbook:.openoffice.org2.0/user/wordbook:Library/Spelling:/opt/openoffice.org/basis3.0/share/dict/ooo:/usr/lib/openoffice.org/basis3.0/share/dict/ooo:/opt/openoffice.org2.4/share/dict/ooo:/usr/lib/openoffice.org2.4/share/dict/ooo:/opt/openoffice.org2.3/share/dict/ooo:/usr/lib/openoffice.org2.3/share/dict/ooo:/opt/openoffice.org2.2/share/dict/ooo:/usr/lib/openoffice.org2.2/share/dict/ooo:/opt/openoffice.org2.1/share/dict/ooo:/usr/lib/openoffice.org2.1/share/dict/ooo:/opt/openoffice.org2.0/share/dict/ooo:/usr/lib/openoffice.org2.0/share/dict/ooo
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
/Users/larsnielsen/Library/Spelling/default
/Users/larsnielsen/Library/Spelling/en_AU
/Users/larsnielsen/Library/Spelling/en_CA
/Users/larsnielsen/Library/Spelling/en_GB
/Users/larsnielsen/Library/Spelling/en_US
/Users/larsnielsen/Library/Spelling/en_ZA
/Users/larsnielsen/Library/Spelling/hyph_en_GB
/Users/larsnielsen/Library/Spelling/hyph_en_US
Library/Spelling/default
Library/Spelling/en_AU
Library/Spelling/en_CA
Library/Spelling/en_GB
Library/Spelling/en_US
Library/Spelling/en_ZA
Library/Spelling/hyph_en_GB
Library/Spelling/hyph_en_US
LOADED DICTIONARY:
/Users/larsnielsen/Library/Spelling/default.aff
/Users/larsnielsen/Library/Spelling/default.dic
Hunspell 1.5.4
Lars Nielsen
  • 213
  • 4
  • 9
  • I'm not on MacOS, but you could try `hunspell -D` at a prompt to see if `hunspell` finds the files. Otherwise try to set the env. variable `DICPATH` directing to `~/Library/Spelling` and try it then. – Arash Esbati Dec 06 '16 at 13:19
  • @ArashEsbati I have added the output from hunspell -D to the post and that seems a bit strange to me – Lars Nielsen Dec 06 '16 at 13:22
  • 3
    You see the search path compiled in your binary beneath `SEARCH PATH:` and `~/Library/Spelling` is not there. It means that `hunspell` does not find the files either. Set the environment variable `DICPATH` to `~/Library/Spelling` and try again. Or you move the files into a directory mentioned in that path, e.g. `/Users/larsnielsen/.openoffice.org/3/user/wordbook`. – Arash Esbati Dec 06 '16 at 13:27
  • @ArashEsbati I did this `export DICPATH=$DICPATH:/Users/larsnielsen/Library/Spelling` in `.bash_profile` and that added the path as it should. However I get the same error :/ – Lars Nielsen Dec 06 '16 at 13:39
  • First part solved `:-)`. `hunspell` looks for `LC_ALL`, `LC_MESSAGES` and `LANG` and if non is set, it fallbacks to `default`. You can set them or just copy `en_GB.dic|aff` to `default.dic|aff` in `$DICPATH`. Check man page for `files`. I have `LANG=en_US.UTF-8` and hunspell loads `en_US.aff|dic` as defaults – Arash Esbati Dec 06 '16 at 13:47
  • hmmm did not fix it, same error. But the output of hunspell -D has changed and is change in the question – Lars Nielsen Dec 06 '16 at 13:51
  • oh and hunspell reaches the last line, but does not return, such that I can continued using the command line :/ – Lars Nielsen Dec 06 '16 at 13:53
  • @ArashEsbati I have opened a chat :) – Lars Nielsen Dec 06 '16 at 13:57
  • 1
    If you're running Emacs graphically it doesn't pick up exports from your .bash_profile as it doesn't go anywhere near the shell, so I'd suggest trying to run hunspell -D from within Emacs, eg. with M-!. – Alan Third Dec 07 '16 at 10:38
  • That gives command not found for Hunspell. But I "solved" the problem by switching to aspell – Lars Nielsen Dec 07 '16 at 10:57
  • Based on @ArashEsbati 's comment on `SEARCH PATH`, adding `(setenv "DICPATH" (expand-file-name "~/Library/Spelling"))` to the init file worked for me. – dkim Jan 09 '17 at 14:08

0 Answers0