Starting with Emacs 24.4, the ispell package supports Hunspell and its dictionaries out-of-the-box. Therefore, adding the following two lines to the init-file should be enough to set Hunspell as the default spell-checker and German as the default spell-checking language.
(setq ispell-program-name "hunspell"
ispell-dictionary "de_DE")
For Emacs versions before 24.4, proceed with the following.
To check if the dictionary is listed in the path run hunspell -D.
It should output something along those lines:
...
/usr/share/hunspell/en_US
/usr/share/hunspell/de_BE
/usr/share/hunspell/de_LU
/usr/share/hunspell/de_DE
...
Next, add your preferred dictionaries to ispell-local-dictionary-alist in your .emacs file
(add-to-list 'ispell-local-dictionary-alist '("deutsch-hunspell"
"[[:alpha:]]"
"[^[:alpha:]]"
"[']"
t
("-d" "de_DE"); Dictionary file name
nil
iso-8859-1))
(add-to-list 'ispell-local-dictionary-alist '("english-hunspell"
"[[:alpha:]]"
"[^[:alpha:]]"
"[']"
t
("-d" "en_US")
nil
iso-8859-1))
(setq ispell-program-name "hunspell" ; Use hunspell to correct mistakes
ispell-dictionary "deutsch-hunspell") ; Default dictionary to use
In addition to that you can define a function to switch between the german and english dictionaries and bind it to C-c d for example
(defun switch-dictionary-de-en ()
"Switch german and english dictionaries."
(interactive)
(let* ((dict ispell-current-dictionary)
(new (if (string= dict "deutsch-hunspell") "english-hunspell"
"deutsch-hunspell")))
(ispell-change-dictionary new)
(message "Switched dictionary from %s to %s" dict new)))
(global-set-key (kbd "C-c d") 'switch-dictionary-de-en)