Package: dictionaries-common
Version: 1.28.4
Severity: normal

Debian stuff dealing with list of dictionaries available for Emacs sometimes causes problems.

1. Some spell checker and dictionary should be installed,
   e.g. aspell and aspell-en

2. Initial state: user has no customization related to ispell.
   It can be simulated using

       mkdir /tmp/emacs-bug
       HOME=/tmp/emacs-bug emacs

   Do not forget to remove /tmp/emacs/bug/.emacs before retries.

3. Try to customize ispell-dictionary when ispell package is not loaded
   yet, e.g. (add HOME=... if necessary)

       emacs --eval "(customize-option 'ispell-dictionary)"

4. Set some string value, e.g "en_US" and try to save for future
   sessions.

*Actual result*:

custom-push-theme: Symbol’s value as variable is void: default-dictionary

Expected result: customization is saved to ~/.emacs
(or ~/.emacs.d/init.el, etc.)

Workaround for this case:

    M-: (require 'ispell) RET

and save for future sessions again.

I do not mind that such steps could be considered as contrived.
Originally I faced it in a different scenario. Hunspell allows
to combine dictionaries to check mixed-language texts
(it has some problems with suggested correction just after
language is changed in the document however), e.g.

    hunspell -d en_US,ru_RU

Emacs does not allow to specify such configuration directly,
e.g. using M-x ispell-change-dictionary. At first, it is necessary
to properly add such pair as multidictionary. I tried to debug
configuration without touching of main init file using

    emacs -q -l spell-init.el

and got the same error "variable is void: default-dictionary".
At the same time if site-lisp is ignored, no such error appears

    emacs -Q -l spell-init.el

Before I have realized that initialization has some specific when
"-q -l ..." options are used, I suspected something related to
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=655113
"libreoffice-dictionaries: Please make use of existing Debian infrastructure to make these appear under emacs, jed and mutt"

I think, the issue is caused by line 442 in
/usr/share/dictionaries-common/site-elisp/debian-ispell.el

    (or (boundp 'ispell-dictionary)
        (defcustom ispell-dictionary default-dictionary
          "Default dictionary to use if `ispell-local-dictionary' is nil."
          :type '(choice string
                         (const :tag "default" nil))
          :group 'ispell))

where default-dictionary is local to let*. Unsure if defvar will
be better for this purpose.

Reply via email to