Commit d60faf32 authored by Eli Zaretskii's avatar Eli Zaretskii

Improve detection of speller version in ispell.el

* lisp/textmodes/ispell.el (ispell-check-version): Accept more
general forms of version numbers for Aspell, Hunspell, and
Enchant, to include various beta and prereleases.  (Bug#29801)
parent a0e3b067
...@@ -712,10 +712,10 @@ Otherwise returns the library directory name, if that is defined." ...@@ -712,10 +712,10 @@ Otherwise returns the library directory name, if that is defined."
(error "%s exited with %s %s" ispell-program-name (error "%s exited with %s %s" ispell-program-name
(if (stringp status) "signal" "code") status)) (if (stringp status) "signal" "code") status))
;; Get relevant version strings. Only xx.yy.... format works well ;; Get relevant version strings.
(let (case-fold-search) (let (case-fold-search)
(setq ispell-program-version (setq ispell-program-version
(and (search-forward-regexp "\\([0-9]+\\.[0-9\\.]+\\)" nil t) (and (search-forward-regexp "\\([0-9]+\\.[0-9.]+\\)" nil t)
(match-string 1))) (match-string 1)))
;; Make sure these variables are (re-)initialized to the default value ;; Make sure these variables are (re-)initialized to the default value
...@@ -725,19 +725,23 @@ Otherwise returns the library directory name, if that is defined." ...@@ -725,19 +725,23 @@ Otherwise returns the library directory name, if that is defined."
(goto-char (point-min)) (goto-char (point-min))
(or (setq ispell-really-aspell (or (setq ispell-really-aspell
(and (search-forward-regexp (and
"(but really Aspell \\([0-9]+\\.[0-9\\.-]+\\)?)" nil t) (search-forward-regexp
(match-string 1))) "(but really Aspell \\([0-9]+\\.[0-9.]+\\([-._+ ]?[a-zA-Z0-9]+\\)?\\)?)"
nil t)
(match-string 1)))
(setq ispell-really-hunspell (setq ispell-really-hunspell
(and (search-forward-regexp (and
"(but really Hunspell \\([0-9]+\\.[0-9\\.-]+\\)?)" (search-forward-regexp
nil t) "(but really Hunspell \\([0-9]+\\.[0-9.]+\\([-._+ ]?[a-zA-Z0-9]+\\)?\\)?)"
(match-string 1))) nil t)
(match-string 1)))
(setq ispell-really-enchant (setq ispell-really-enchant
(and (search-forward-regexp (and
"(but really Enchant \\([0-9]+\\.[0-9\\.-]+\\)?)" (search-forward-regexp
nil t) "(but really Enchant \\([0-9]+\\.[0-9.]+\\([-._+ ]?[a-zA-Z0-9]+\\)?\\)?)"
(match-string 1))))) nil t)
(match-string 1)))))
(let* ((aspell8-minver "0.60") (let* ((aspell8-minver "0.60")
(ispell-minver "3.1.12") (ispell-minver "3.1.12")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment