#916227 dictionaries-common: ispell-find-hunspell-dictionaries fails to find installed dictionaries

Package:
emacs
Source:
emacs
Submitter:
Sebastien Hinderer
Date:
2019-09-23 17:06:06 UTC
Severity:
normal
#916227#5
Date:
2018-12-11 17:07:41 UTC
From:
To:
Dear Maintainer,

For some reason ispell-find-hunspell-dictionaries does not find the installed hunspell dictionaries, leading ispell-hunspell-dictionary-alist to be nil.

Will be happy to provide any information that can help fixing this.

output of hunspell -D is:

```
SEARCH PATH:
.::/usr/share/hunspell:/usr/share/myspell:/usr/share/myspell/dicts:/Library/Spelling:/home/shindere/.openoffice.org/3/user/wordbook:/home/shindere/.openoffice.org2/user/wordbook:/home/shindere/.openoffice.org2.0/user/wordbook:/home/shindere/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/fr_MC
/usr/share/hunspell/fr_LU
/usr/share/hunspell/fr_CH
/usr/share/hunspell/fr_CA
/usr/share/hunspell/fr_BE
/usr/share/hunspell/fr_FR
/usr/share/hunspell/fr
/usr/share/hunspell/en_US
/usr/share/myspell/dicts/fr_MC
/usr/share/myspell/dicts/fr_LU
/usr/share/myspell/dicts/fr_CH
/usr/share/myspell/dicts/fr_CA
/usr/share/myspell/dicts/fr_BE
/usr/share/myspell/dicts/fr_FR
```

Thanks!

Sébastien.

#916227#10
Date:
2018-12-12 10:31:56 UTC
From:
To:
Hi,

GNU Emacs uses its own ispell.el and flyspell.el files, not those provided
by dictionaries-common, which are only for XEmacs. ispell.el has recently
been patched in Emacs to work around this issue, but since XEmacs does not
use hunspell auto-detection I do not think this change is needed in
dictionaries-common ispell.el.

Please let me know if something is not working that way. Otherwise I will
close this bug report.

Thanks for your contribution to Debian.

Regards,

#916227#15
Date:
2018-12-12 10:53:29 UTC
From:
To:
Hello,

Many thanks for your prompt and kind response!

Agustin Martin (2018/12/12 11:31 +0100):

Oh, I wasn't aware of that, sorry.

OK so I am using GNU Emacs, not xemacs. IS there a way for me to get the
correct (patched) version of ispell.el by installing debian packages, or
do I have to do something different, like installing an upstream version
of GNU Emacs?

All the best and thanks again for your assistance,

Sébastien.

#916227#20
Date:
2018-12-12 11:23:00 UTC
From:
To:
No problem. dictionaries-common used to ship {ispell,flyspell}.el also for
GNU Emacs, containing the most recent version patched to work with XEmacs
and older Emacs, but that is no longer true because of compatibility issues.

One possibility is to wait for Emacs 26 to be packaged. I think this change
was not pushed to the Emacs25 (master) branch. Installing Emacs from
upstream is an overkill and will become old at some time.

A temporary hack would be to add an entry to your .emacs file, something
like (if none is explicitly set)

;; ----------------------------
(setq ispell-local-dictionary-alist
      (append ispell-local-dictionary-alist
              '(
		("castellano8"
                 "[[:alpha:]]"
                 "[^[:alpha:]]"
                 "[-]" t ("-d" "es_ES") nil utf-8)
                )))
;; ---------------------------

adapted to your language. Do not forget to remove it once either hunspell or
Emacs are fixed.

Regards,

#916227#25
Date:
2018-12-13 16:41:11 UTC
From:
To:
Dear Agustin, many thanks for your response!

I see. Just a few weeks ago I had a bug that I oculd fix by upgrading
dictionaries-common, the problem fixed by version 1.27.4.

So I really thought the problem was there again.

Thanks! Unfortuantely, I don't think this would work because, as far as
I understand it, the list of dictionaries is computed when a
spell-checking command is run for the first time so I'd expect that such
a definition in the .emacs.el file would be overwritten.

Sébastien.

#916227#30
Date:
2018-12-13 17:56:29 UTC
From:
To:
Please try it.
#916227#35
Date:
2018-12-19 13:21:10 UTC
From:
To:
Hi,

(setq ispell-local-dictionary-alist
      (append ispell-local-dictionary-alist
              '(
            ("francais7"
                 "[[:alpha:]]"
                 "[^[:alpha:]]"
                 "[-]" t ("-d" "fr_FR") nil utf-8)
                )))

When I start emacs I get the following error message:

Symbol's value as variable is void: ispell-local-dictionary-alist

Sébastien.

#916227#40
Date:
2018-12-22 10:52:31 UTC
From:
To:
El mié., 19 dic. 2018 a las 14:21, Sébastien Hinderer
(<Sebastien.Hinderer@inria.fr>) escribió:

Hi, Sébastien

I forgot that ispell.el is not loaded at startup but later on demand.
Try wrapping the code in eval-after-load (I might have missed a
parenthesis)

(eval-after-load "ispell"
(setq ispell-local-dictionary-alist
       (append ispell-local-dictionary-alist
               '(
             ("francais7"
                  "[[:alpha:]]"
                  "[^[:alpha:]]"
                  "[-]" t ("-d" "fr_FR") nil utf-8)
                 )))
)

This should run the code once ispell.el is loaded.

Let me know if this works,

Regards,

#916227#59
Date:
2019-02-01 21:39:44 UTC
From:
To:
tag -1 + patch
thanks

Attached you find the upstream patch prepared for Debian.
It would be great, it this could go into buster...

Greetings
Roland