Subject: Re: bug#33493: 26.1; New Version of Hunspell (1.7.0-1) brakes ispell.el

From: Eli Zaretskii <[email-masked]>
Date: Sun, 25 Nov 2018 18:10:47 +0200

> From: Philipp Uhl <[email-masked]>
> Date: Sun, 25 Nov 2018 00:17:02 +0100
> 
> After the update from hunspell 1.6.2-1 to 1.7.0-1 the ispell package
> printed the following messages:
> 
> Starting new Ispell process hunspell with en_US dictionary...
> Setting up indent for shell type zsh
> Indentation variables are now local.
> Indentation setup for shell type zsh
> Error in post-command-hook (flyspell-post-command-hook): (error "No data 
> for dictionary \"en_US\" in ‘ispell-local-dictionary-alist’ or 
> ‘ispell-dictionary-alist’")
> 
> I checked and ispell-local-dictionary-alist and ispell-dictionary-alist
> are both nil.
> 
> Consequently my hunspell setup did't work but the error occures on
> running (ispell).

This is due to an incompatible change in Hunspell, for a reason that
looks entirely arbitrary to me: Hunspell will now show the LOADED
DICTIONARY header (which ispell.el expects and on which it depends)
only if there's at least one file argument on the command line.  Why
they made that change is anybody's guess.

Does the patch below resolve the problem?

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index e77bc7e..9789968 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1113,7 +1113,12 @@ ispell-find-hunspell-dictionaries
 				 null-device
 				 t
 				 nil
-				 "-D")
+                                 ;; Hunspell 1.7.0 (and later?) won't
+                                 ;; show LOADED DICTIONARY unless
+                                 ;; there's at least one file argument
+                                 ;; on the command line.  So we feed
+                                 ;; it with the null device.
+				 "-D" null-device)
 	    (buffer-string))
 	  "[\n\r]+"
 	  t))