From d60faf32757ef007c7b5d07a8b248ee4a6f8f83e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 22 Dec 2017 11:11:29 +0200 Subject: [PATCH] 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) --- lisp/textmodes/ispell.el | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 6a169622f52..25f62e317c8 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -712,10 +712,10 @@ Otherwise returns the library directory name, if that is defined." (error "%s exited with %s %s" ispell-program-name (if (stringp status) "signal" "code") status)) - ;; Get relevant version strings. Only xx.yy.... format works well + ;; Get relevant version strings. (let (case-fold-search) (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))) ;; 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." (goto-char (point-min)) (or (setq ispell-really-aspell - (and (search-forward-regexp - "(but really Aspell \\([0-9]+\\.[0-9\\.-]+\\)?)" nil t) - (match-string 1))) + (and + (search-forward-regexp + "(but really Aspell \\([0-9]+\\.[0-9.]+\\([-._+ ]?[a-zA-Z0-9]+\\)?\\)?)" + nil t) + (match-string 1))) (setq ispell-really-hunspell - (and (search-forward-regexp - "(but really Hunspell \\([0-9]+\\.[0-9\\.-]+\\)?)" - nil t) - (match-string 1))) + (and + (search-forward-regexp + "(but really Hunspell \\([0-9]+\\.[0-9.]+\\([-._+ ]?[a-zA-Z0-9]+\\)?\\)?)" + nil t) + (match-string 1))) (setq ispell-really-enchant - (and (search-forward-regexp - "(but really Enchant \\([0-9]+\\.[0-9\\.-]+\\)?)" - nil t) - (match-string 1))))) + (and + (search-forward-regexp + "(but really Enchant \\([0-9]+\\.[0-9.]+\\([-._+ ]?[a-zA-Z0-9]+\\)?\\)?)" + nil t) + (match-string 1))))) (let* ((aspell8-minver "0.60") (ispell-minver "3.1.12") -- 2.11.4.GIT