2

I am unable to use Ispell, after the upgrade to Hunspell 1.7.0. It seems that the "-D" option does not return the loaded dictionary, therefore the function ispell-find-hunspell-dictionaries fails. Calling a fake file (null device) seems to return the proper values. I am using therefore this workaround:

;; Work around for Hunspell 1.7.0 
(defun manage-hunspell-1.7 (old-function-ispell &rest arguments)
  "Add null-device when calling \"hunspell -D\"."
  (if  (equal "-D"  (nth 4 arguments))
    (funcall old-function-ispell "hunspell" null-device t nil "-D" null-device)
    (apply old-function-ispell  arguments)))
(advice-add 'ispell-call-process :around #'manage-hunspell-1.7))

What is the official way to use Hunspell 1.7.0?

antonio
  • 1,762
  • 12
  • 24
  • This approach looks interesting, but seems to given a strange list of dictionaries. I had just set-up my own dictionaries explicitly as a work around, but would prefer some automatic method in this sort of direction. – Andrew Swann Jan 23 '19 at 11:00
  • @AndrewSwann: do you get several loaded dictionaries or several available dictionaries? `ispell-find-hunspell-dictionaries` looks for `.aff` extensions. I have only one `.aff` file as the loaded dictionary. – antonio Jan 23 '19 at 17:13
  • I have just tried this again it looks better than yesterday. `hunspell-dictionary-alist` and `ispell-local-dictionary-alist' get populated with the correct hunspell dictionaries that I have installed. On the other hand `ispell-dictionary-alist` also gets populated with a large number of further entries - I am not sure where they come from. – Andrew Swann Jan 24 '19 at 10:58
  • I have been using this for sometime now, with the `advice-add` wrapped in `(with-eval-after-load "ispell" ...)` and it is working fine. – Andrew Swann Feb 17 '19 at 12:43
  • 2
    If helpful, there's some kind of patch here: https://github.com/emacs-mirror/emacs/commit/2925ce5a7ec1424cfaea9f2f86bd3cab27832584 According to [this](https://www.reddit.com/r/emacs/comments/air595/hunspell_is_periodically_broken_in_emacs/), the problem is that Hunspell developers changed the output of the program for the flag (hunspell -D). – incandescentman Mar 01 '19 at 21:54
  • @incandescentman: as I wrote the "-D" option does not return the loaded dictionary any more, hence my patch. – antonio Mar 02 '19 at 02:06

1 Answers1

0

The null-device workaround(*) is now part of the official ispell-find-hunspell-dictionaries.

(*) hunspell -D /dev/null or the platform equivalent is necessary to print the LOADED DICTIONARY section after the available dictionaries.

antonio
  • 1,762
  • 12
  • 24