Subject: bug#28025: Daemon/server passes string incorrectly to/from Systemd

From: Eli Zaretskii <[email-masked]>
Date: Wed, 09 Aug 2017 19:15:35 +0300

> From: Arthur Miller <[email-masked]>
> Date: Wed, 9 Aug 2017 15:07:27 +0200
> 
> When I start Emacs in daemon mode with Systemd and connect with
> emacsclient, I get nil string when I run spellcheck with ispell.
> 'ispell-word' stack trace from debugger:
> 
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
> string-match("," nil 0)
> split-string(nil "," t)
> ispell-parse-hunspell-affix-file(nil)
> ispell-find-hunspell-dictionaries()
> ispell-set-spellchecker-params()
> ispell-word(nil nil nil t)
> funcall-interactively(ispell-word nil nil nil t)
> call-interactively(ispell-word nil nil)
> command-execute(ispell-word)
> 
> When I start emacs in daemon mode from bash command line
> directly and connect with emacsclient the spellcheck
> works correctly.
> 
> I have checked that all paths are setup correctly. Emacs finds
> dictionaries (DICPATH setts correctly in systemd service file),
> and it also finds spellchecking program (/usr/bin/hunspell).

Can you explain how DICPATH enters this picture?  AFAIR, Hunspell
should be able to find its dictionaries without that variable,
assuming Hunspell is installed correctly.  So why do you need DICPATH?

In any case, please note that Emacs is not the one who looks at the
value of DICPATH: Hunspell is.  That value is _reported_ to Emacs, but
it's Hunspell that reports the value.  So maybe the problem is that
the value of DICPATH visible to Hunspell is empty or invalid.

(Caveat: I know almost nothing about systemd and related atrocities.)