Subject: 25.2; ispell doesn't parse hunspell dictionaries properly
From: Martin Kletzander <[email-masked]>
To: [email-masked]
Date: Tue, 21 Feb 2017 10:18:57 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

I have hunspell installed in the system with two default dictionaries.
I was trying to setup ispell so that it works properly and I couldn't.
So I started looking at the sources for ispell and I found one part that
can't work.  It may be intentional, but the real problem is that I can't
use spellchecker at all.  When `emacs -Q` is ran, it is enough to do M-$
with *no additinal settings*.  The error message (and following messages
for consecutive M-$) are visible below in 'Recent messages'.

I could only trace the problem to the ispell.el where the error is
printed.  The reason for that is probably the fact that `hunspell -D`
has this output on my system:

SEARCH PATH:
.::/usr/share/hunspell:/usr/share/myspell:/usr/share/myspell/dicts:/Library/Spelling:/home/nert/.openoffice.org/3/user/wordbook:.openoffice.org2/user/wordbook:.openoffice.org2.0/user/wordbook:Library/Spelling:/opt/openoffice.org/basis3.0/share/dict/ooo:/usr/lib/openoffice.org/basis3.0/share/dict/ooo:/opt/openoffice.org2.4/share/dict/ooo:/usr/lib/openoffice.org2.4/share/dict/ooo:/opt/openoffice.org2.3/share/dict/ooo:/usr/lib/openoffice.org2.3/share/dict/ooo:/opt/openoffice.org2.2/share/dict/ooo:/usr/lib/openoffice.org2.2/share/dict/ooo:/opt/openoffice.org2.1/share/dict/ooo:/usr/lib/openoffice.org2.1/share/dict/ooo:/opt/openoffice.org2.0/share/dict/ooo:/usr/lib/openoffice.org2.0/share/dict/ooo
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
/usr/share/hunspell/cs_CZ
/usr/share/hunspell/en_CA
/usr/share/hunspell/en_ZA
/usr/share/hunspell/en_US
/usr/share/hunspell/en_GB
/usr/share/hunspell/en_AU
/usr/share/myspell/cs_CZ
/usr/share/myspell/en_CA
/usr/share/myspell/hyph_cs_CZ
/usr/share/myspell/en_ZA
/usr/share/myspell/en_US
/usr/share/myspell/en_GB
/usr/share/myspell/en_AU
/usr/share/myspell/hyph_en_GB
LOADED DICTIONARY:
/usr/share/hunspell/en_GB.aff
/usr/share/hunspell/en_GB.dic
LOADED DICTIONARY:
/usr/share/hunspell/cs_CZ.aff
/usr/share/hunspell/cs_CZ.dic
Hunspell 1.6.0

I tried various additional settings, setting the multi-dic for hunspell,
setting default dictionaries and nothing helped.  Can't ispell just
detect all the .aff files and then automatically use en_GB,cs_CZ as a
multi-dictionary for hunspell?  That's what I want anyway.

Let me know if I can provide any more information and thank you very
much in advance for looking into this issue.

Martin

P.S.: I seem to recall my previous configuration that made this working,
      but it was probably before lot of emacs and hunspell upgrades.
      The spellchecking is not working for some time for me, it's just
      now that I started looking into this issue.

P.P.S.: If I have (flyspell-mode) in a 'message-mode-hook and I start
        emacsclient with a file that automatically starts in
        message-mode, then emacs crashes due to the default dictionary
        being nil or something in that regard.

In GNU Emacs 25.2.1 (x86_64-pc-linux-gnu)
 of 2017-02-20 built on caroline
System Description:	Gentoo Base System release 2.3

Configured using:
 'configure --prefix=/usr --build=x86_64-pc-linux-gnu
 --host=x86_64-pc-linux-gnu --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --disable-dependency-tracking
 --disable-silent-rules --docdir=/usr/share/doc/emacs-25.2_rc1
 --htmldir=/usr/share/doc/emacs-25.2_rc1/html --libdir=/usr/lib64
 --program-suffix=-emacs-25 --infodir=/usr/share/info/emacs-25
 --localstatedir=/var
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --with-gameuser=:gamestat --without-compress-install
 --with-file-notification=inotify --enable-acl --with-dbus
 --without-modules --with-gpm --without-hesiod --with-kerberos
 --with-kerberos5 --with-xml2 --without-selinux --with-gnutls
 --with-wide-int --with-zlib --with-sound=alsa --with-x --without-ns
 --without-gconf --without-gsettings --with-toolkit-scroll-bars
 --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-xpm
 --with-imagemagick --with-xft --without-cairo --without-libotf
 --without-m17n-flt --with-x-toolkit=no
 GENTOO_PACKAGE=app-editors/emacs-25.2_rc1 'CFLAGS=-O2 -pipe -ggdb
 -march=native' CPPFLAGS= 'LDFLAGS=-Wl,-O1 -Wl,--as-needed''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS NOTIFY ACL GNUTLS
LIBXML2 FREETYPE XFT ZLIB X11

Important settings:
  value of $LC_CTYPE: en_GB.utf8
  value of $LANG: en_GB.utf8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
ispell-find-hunspell-dictionaries: ispell-fhd: Default dict already defined as (en_GB /usr/share/hunspell/en_GB.aff).  Not using /usr/share/hunspell/cs_CZ.aff.

Starting new Ispell process /usr/bin/hunspell with default dictionary...
split-string: Wrong type argument: stringp, nil
next-line: End of buffer
Starting new Ispell process /usr/bin/hunspell with default dictionary...
split-string: Wrong type argument: stringp, nil
Starting new Ispell process /usr/bin/hunspell with default dictionary...
split-string: Wrong type argument: stringp, nil
Starting new Ispell process /usr/bin/hunspell with default dictionary...
split-string: Wrong type argument: stringp, nil

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu
cl-loaddefs pcase cl-lib mail-prsvr mail-utils ispell term/xterm xterm
time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
font-render-setting x multi-tty make-network-process emacs)

Memory information:
((conses 16 91424 6545)
 (symbols 48 20210 0)
 (miscs 40 43 160)
 (strings 32 15556 4780)
 (string-bytes 1 446860)
 (vectors 16 10101)
 (vector-slots 8 389043 14706)
 (floats 8 167 358)
 (intervals 56 258 0)
 (buffers 976 18)
 (heap 1024 13197 776))