all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Peter Oliver <lists.gnu.org@mavit.org.uk>
To: 19073@debbugs.gnu.org
Subject: bug#19073: Ispell fails to initialise when hunspell does not report any loaded dictionaries
Date: Sun, 16 Nov 2014 13:34:57 +0000 (GMT)	[thread overview]
Message-ID: <alpine.LFD.2.10.1411161245250.4053@froglet.home.mavit.org.uk> (raw)

[-- Attachment #1: Type: TEXT/PLAIN, Size: 980 bytes --]

The build of Hunspell 1.3.2 at http://sourceforge.net/projects/ezwinports/files/ from doesn't output the "LOADED DICTIONARY:" section when "hunspell -D" is run.  I don't know if this is a bug in hunspell, or in the build, or if this feature is missing on Windows, or if there is some other reason.

In any case, this missing section confuses function ispell-find-hunspell-dictionaries in Emacs 24.4 (I'm using the build at http://sourceforge.net/projects/emacs-bin/files/releases/emacs-24.4-bin-i686-pc-mingw32.7z/download).  Variable hunspell-default-dict never gets set, meaning function ispell-parse-hunspell-affix-file ends up being called with a nil argument and erroring.

The attached patch gets things working again for me, although I must admit I don't understand the implications of not detecting a default dictionary.

If this patch is used, I believe that I will need to sign legal papers before patches from me can be accepted.  I am happy to do so.

-- 
Peter Oliver

[-- Attachment #2: Type: TEXT/PLAIN, Size: 1462 bytes --]

From 6e508b07b01f62511e356b34b9a0fa8454dcedf3 Mon Sep 17 00:00:00 2001
From: Peter Oliver <git@mavit.org.uk>
Date: Sun, 16 Nov 2014 13:32:45 +0000
Subject: [PATCH] Don't error when no default Hunspell dictionary is detected.

This happens when "hunspell -D" does not report a "LOADED DICTIONARY".
---
 lisp/textmodes/ispell.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 5cdae22..cd77eda 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1291,10 +1291,12 @@ entries if a specific dict was found."
     ;; Parse and set values for default dictionary.
     (setq hunspell-default-dict (car hunspell-default-dict))
     (setq hunspell-default-dict-entry
-	  (ispell-parse-hunspell-affix-file hunspell-default-dict))
+          (and hunspell-default-dict
+               (ispell-parse-hunspell-affix-file hunspell-default-dict)))
     ;; Create an alist of found dicts with only names, except for default dict.
     (setq ispell-hunspell-dictionary-alist
-	  (list (append (list nil) (cdr hunspell-default-dict-entry))))
+          (and hunspell-default-dict-entry
+               (list (append (list nil) (cdr hunspell-default-dict-entry)))))
     (dolist (dict (mapcar 'car ispell-hunspell-dict-paths-alist))
       (if (string= dict hunspell-default-dict)
 	  (add-to-list 'ispell-hunspell-dictionary-alist
-- 
1.8.3.1


             reply	other threads:[~2014-11-16 13:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-16 13:34 Peter Oliver [this message]
2014-11-17 16:45 ` bug#19073: Ispell fails to initialise when hunspell does not report any loaded dictionaries Eli Zaretskii
2014-11-22 20:20   ` Peter Oliver
     [not found] <54C93088.4000908@resiak.org>
2015-01-28 21:09 ` PK
2015-01-29  3:49   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.10.1411161245250.4053@froglet.home.mavit.org.uk \
    --to=lists.gnu.org@mavit.org.uk \
    --cc=19073@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.