My .emacs file contains the following code to make hunspell work, however I get the following error message when starting flyspell-mode:

Starting new Ispell process hunspell with deutsch-hunspell dictionary...
Error enabling Flyspell mode:
(ispell-phaf: No matching entry for deutsch-hunspell.

Any idea of how to fix this?

(add-to-list 'ispell-local-dictionary-alist '("deutsch-hunspell"
                                              ("-d" "de_DE"); Dictionary file name

(add-to-list 'ispell-local-dictionary-alist '("english-hunspell"
                                              ("-d" "en_US")

(setq ispell-program-name "hunspell"          ; Use hunspell to correct mistakes
      ispell-dictionary   "deutsch-hunspell") ; Default dictionary to use

hunspell -D gives:

 hunspell -D
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
Can't open affix or dictionary files for dictionary named "en_AU".

I am working on an ubuntu 15.10 box with emacs 24.5.1

3 Answers 3


Insert below code into ~/.emacs or ~/.emacs.d/init,

(setq ispell-program-name "hunspell")
(setq ispell-local-dictionary "de_DE")
(setq ispell-local-dictionary-alist
      '(("de_DE" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil nil nil utf-8)))

AFTER above setup, you need turn on flyspell-mode by (flyspell-mode 1).

Please make sure your dictionary is loaded properly. This is hunspell setup instead of Emacs setup.

At Linux, you don't need extra setup (if your dictionaries are installed in a standard location).

At other operating systems, here is the easiest way to hint hunspell where to search the dictionary.

You only need setup environment variable DICPATH by export DICPATH=/usr/share/hunspell/de_DE in Bash (At windows, you can setup environment variable through "Control Panel"). Both de_DE.dic and de_DE.aff should exist in that directory.

Or you just change your locale to de_DE

  • With this I get: Error enabling Flyspell mode: (ispell-phaf: No matching entry for nil. )
    – student
    Feb 1, 2016 at 8:51
  • set environment variable DICPATH
    – chen bin
    Feb 1, 2016 at 12:42
  • I have set the DICTPATH in my .profile file and checked it in my emacs session via getenv. The directory /usr/share/hunspell/ contains the file de_DE.aff and de_DE.dic. Howver I get the same error.
    – student
    Feb 2, 2016 at 18:00
  • what's your OS? emacs version?
    – chen bin
    Feb 2, 2016 at 22:51
  • 1
    Thanks now it works. There was also another problem: I had the line (add-hook 'LaTeX-mode-hook 'turn-on-flyspell) before the dictionaries are setup. Moving this line below the dictionary definitions maked it work.
    – student
    Feb 10, 2016 at 14:44

I compiled Emacs today (March 14, 2016) from git, version for Windows 8.1, 64-bit. Run into the same issue. Found this answer by the indefatigable Eli Zaretskii and shortened the code for hunspell to this lines in my .emacs:

(add-to-list 'exec-path "C:/cygwin64/usr/local/bin")
(setq ispell-program-name (executable-find "hunspell"))
(ispell-change-dictionary "de_DE" t)

OK, you see, hunspell was installed at the given path. I set the DICPATH variable to this locations as well. I set the DICTIONARY variable to "de_DE".

It was hard to find where hunspell stored the personal dictionary. I found it eventually at $HOME, the name of the file was hunspell_de_DE.

So it seems the whole installation is a lot easier nowadays.


What causes the error ispell-phaf: No matching entry ... is the name deutsch-hunspell. By some reason ispell.el assumes that this is a real dictionary name and tries to locate corresponding files, namely deutsch-hunspell.dic and deutsch-hunspell.aff under /usr/share/hunspell directory.

That said, you should use only names found under /usr/share/hunspell/ and only those of them that have an affix file (.aff) that are base dictionaries in hunspell terms (man hunspell for more details).

This does not mean however that if you specify de_DE hunspell will use /usr/share/hunspell/de_DE.{dic,aff} only. You can customize the exact set of dictionaries by means of -d option that will be passed to hunspell. For example, like this:

(setq ispell-local-dictionary-alist
      '(("de_DE" "[[:alpha:]]" "[^[:alpha:]]" "[']" t
         ("-d" "de_DE,de_med") nil iso-8859-1)))

Your Answer

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

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