]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve error message when Hunspell dictionaries are misconfigured
authorEli Zaretskii <eliz@gnu.org>
Sat, 11 Aug 2018 07:34:10 +0000 (10:34 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 11 Aug 2018 07:34:10 +0000 (10:34 +0300)
* lisp/textmodes/ispell.el
(ispell-find-hunspell-dictionaries): Produce a meaningful
error message if Hunspell dictionaries are misconfigured.
(Bug#32319)

lisp/textmodes/ispell.el

index e6f436fa1a12f57df86e23d184bef7d8bf394351..87bcb5d651af8bbe493198babdc6035b29bbe8b9 100644 (file)
@@ -1173,6 +1173,12 @@ dictionary from that list was found."
     ;; Parse and set values for default dictionary.
     (setq hunspell-default-dict (or hunspell-multi-dict
                                    (car hunspell-default-dict)))
+    ;; If hunspell-default-dict is nil, ispell-parse-hunspell-affix-file
+    ;; will barf with an error message that doesn't help users figure
+    ;; out what is wrong.  Produce an error message that points to the
+    ;; root cause of the problem.
+    (or hunspell-default-dict
+        (error "Can't find Hunspell dictionary with a .aff affix file"))
     (setq hunspell-default-dict-entry
          (ispell-parse-hunspell-affix-file hunspell-default-dict))
     ;; Create an alist of found dicts with only names, except for default dict.