unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitri Paduchikh <dpaduchikh@gmail.com>
To: Noam Postavsky <npostavs@users.sourceforge.net>
Cc: 24435@debbugs.gnu.org
Subject: bug#24435: 25.1; Problem using Hunspell
Date: Wed, 14 Sep 2016 20:33:53 +0500	[thread overview]
Message-ID: <8760pyzeam.fsf@gmail.com> (raw)
In-Reply-To: <CAM-tV-_WXGAdRqiUj0Sv=8RFT1eNaYfS-KC+v2ds_1=mc-+bKg@mail.gmail.com> (Noam Postavsky's message of "Wed, 14 Sep 2016 09:46:56 -0400")

Hello,

Noam Postavsky <npostavs@users.sourceforge.net> wrote:

> On Wed, Sep 14, 2016 at 9:24 AM, Dmitri Paduchikh <dpaduchikh@gmail.com> wrote:

>> Hello,
>>
>> Judging from ispell.el it should work with Hunspell, so I tried to use
>> it. But attempts to check a word produce the following error message.
>>
>> | Starting new Ispell process hunspell with ru_RU dictionary...
>> | hunspell release 3.1.12 or greater is required (ispell-check-version)
>>
>> The latest version of Hunspell is 1.4.1 as can be seen here:
>> https://github.com/hunspell/hunspell/releases
>>
>> As I understand, the problem arises because ispell-check-version finds
>> version information using regexp
>>
>> "(but really Hunspell \\([0-9]+\\.[0-9\\.-]+\\)?)"
>>
>> The output of hunspell -vv does not match it, hence the results.
>>
>> $ hunspell -vv < /dev/null
>> Hunspell 1.4.0

> I guess older Hunspell versions printed a different string. Does it
> work if you change the regexp to

> "\\(?:(but really \\)?Hunspell \\([0-9]+\\.[0-9\\.-]+\\)?)?"

Sadly, it does not. The immediate cause of this error message is that
regexp for ispell-program-version matches the Hunspell output. Then the
corresponding check for Ispell version produces this error. The change
shown below makes the version check pass, but another problem appears:

| Starting new Ispell process hunspell with ru_RU dictionary...
| ispell-phaf: No matching entry for ru_RU in ‘ispell-hunspell-dict-paths-alist’.
|  (ispell-parse-hunspell-affix-file)

It seems that Hunspell itself does not have any difficulty locating the
dictionary.

$ hunspell -a -d ru_RU
Hunspell 1.4.0
проверкаа
& проверкаа 3 0: проверка, проверкам, проверках

Below is the change I made to work arround the version check.

--- orig/ispell.el	2016-06-29 23:52:37.000000000 +0500
+++ ispell.el	2016-09-14 20:01:50.529079147 +0500
@@ -881,7 +881,7 @@
       ;; Get relevant version strings. Only xx.yy.... format works well
       (let (case-fold-search)
 	(setq ispell-program-version
-	      (and (search-forward-regexp "\\([0-9]+\\.[0-9\\.]+\\)" nil t)
+	      (and (search-forward-regexp "\\bIspell Version \\([0-9]+\\.[0-9\\.]+\\)" nil t)
 		   (match-string 1)))
 
 	;; Make sure these variables are (re-)initialized to the default value
@@ -897,7 +897,7 @@
 		       (match-string 1)))
 	    (setq ispell-really-hunspell
 		  (and (search-forward-regexp
-			"(but really Hunspell \\([0-9]+\\.[0-9\\.-]+\\)?)"
+			"\\bHunspell \\([0-9]+\\.[0-9-.]+\\)?"
                         nil t)
 		       (match-string 1)))))
 
@@ -907,12 +907,13 @@
 	    (ispell-minver    "3.1.12")
 	    (hunspell8-minver "1.1.6"))
 
-	(if (ispell-check-minver ispell0-minver ispell-program-version)
-	    (or (ispell-check-minver ispell-minver ispell-program-version)
-		(setq ispell-offset 0))
-	  (error "%s release %s or greater is required"
-		 ispell-program-name
-		 ispell-minver))
+	(cond ((or (null ispell-program-version)
+                   (ispell-check-minver ispell-minver ispell-program-version)))
+              ((ispell-check-minver ispell0-minver ispell-program-version)
+               (setq ispell-offset 0))
+              (:else (error "%s release %s or greater is required"
+                            ispell-program-name
+                            ispell-minver)))
 
 	(cond
 	 (ispell-really-aspell






  reply	other threads:[~2016-09-14 15:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14 13:24 bug#24435: 25.1; Problem using Hunspell Dmitri Paduchikh
2016-09-14 13:46 ` Noam Postavsky
2016-09-14 15:33   ` Dmitri Paduchikh [this message]
2016-09-14 16:57     ` Eli Zaretskii
2016-09-14 17:44       ` Dmitri Paduchikh
2016-09-14 18:50         ` Eli Zaretskii
2016-09-14 20:10           ` Dmitri Paduchikh
2016-09-15 14:25             ` Eli Zaretskii
2016-09-15 15:22               ` Agustin Martin
2016-09-15 16:20                 ` Eli Zaretskii
2016-09-15 17:36                   ` Agustin Martin
2016-09-15 20:59               ` Dmitri Paduchikh
2016-09-16  6:29                 ` Eli Zaretskii
2016-09-16  8:06                   ` Dmitri Paduchikh
2016-09-16  8:34                     ` Eli Zaretskii
2016-09-14 16:40 ` Eli Zaretskii
2016-09-15 13:41   ` Agustin Martin
2016-09-15 21:42     ` Dmitri Paduchikh

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=8760pyzeam.fsf@gmail.com \
    --to=dpaduchikh@gmail.com \
    --cc=24435@debbugs.gnu.org \
    --cc=npostavs@users.sourceforge.net \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).