]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix errors in flyspell-post-command-hook
authorEli Zaretskii <eliz@gnu.org>
Tue, 19 Sep 2017 16:32:09 +0000 (19:32 +0300)
committerEli Zaretskii <eliz@gnu.org>
Tue, 19 Sep 2017 16:32:09 +0000 (19:32 +0300)
* lisp/textmodes/ispell.el (ispell-get-decoded-string): Handle the
case of a nil Nth element of the language dictionary slot.  This
avoids errors in 'flyspell-post-command-hook' when switching
dictionaries with some spell-checkers.  (Bug#28501)

lisp/textmodes/ispell.el

index 0c0a51e7df0f8935ebda7f22a2795d74bfbcbc03..6a169622f5244256c382e12741312366d17b9ad0 100644 (file)
@@ -1492,8 +1492,10 @@ This is passed to the Ispell process using the `-p' switch.")
                (assoc ispell-current-dictionary ispell-local-dictionary-alist)
                (assoc ispell-current-dictionary ispell-dictionary-alist)
                (error "No data for dictionary \"%s\" in `ispell-local-dictionary-alist' or `ispell-dictionary-alist'"
-                      ispell-current-dictionary))))
-    (decode-coding-string (nth n slot) (ispell-get-coding-system) t)))
+                      ispell-current-dictionary)))
+         (str (nth n slot)))
+    (if (stringp str)
+        (decode-coding-string str (ispell-get-coding-system) t))))
 
 (defun ispell-get-casechars ()
   (ispell-get-decoded-string 1))