aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2017-12-22 11:11:29 +0200
committerEli Zaretskii2017-12-22 11:11:29 +0200
commitd60faf32757ef007c7b5d07a8b248ee4a6f8f83e (patch)
treec58c29cd4aa6cfadc737174ca0d767662d51e01c
parenta0e3b06725a48379a2e341f90dd090f042ad8e18 (diff)
downloademacs-d60faf32757ef007c7b5d07a8b248ee4a6f8f83e.tar.gz
emacs-d60faf32757ef007c7b5d07a8b248ee4a6f8f83e.zip
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)
-rw-r--r--lisp/textmodes/ispell.el30
1 files 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."
712 (error "%s exited with %s %s" ispell-program-name 712 (error "%s exited with %s %s" ispell-program-name
713 (if (stringp status) "signal" "code") status)) 713 (if (stringp status) "signal" "code") status))
714 714
715 ;; Get relevant version strings. Only xx.yy.... format works well 715 ;; Get relevant version strings.
716 (let (case-fold-search) 716 (let (case-fold-search)
717 (setq ispell-program-version 717 (setq ispell-program-version
718 (and (search-forward-regexp "\\([0-9]+\\.[0-9\\.]+\\)" nil t) 718 (and (search-forward-regexp "\\([0-9]+\\.[0-9.]+\\)" nil t)
719 (match-string 1))) 719 (match-string 1)))
720 720
721 ;; Make sure these variables are (re-)initialized to the default value 721 ;; 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 725
726 (goto-char (point-min)) 726 (goto-char (point-min))
727 (or (setq ispell-really-aspell 727 (or (setq ispell-really-aspell
728 (and (search-forward-regexp 728 (and
729 "(but really Aspell \\([0-9]+\\.[0-9\\.-]+\\)?)" nil t) 729 (search-forward-regexp
730 (match-string 1))) 730 "(but really Aspell \\([0-9]+\\.[0-9.]+\\([-._+ ]?[a-zA-Z0-9]+\\)?\\)?)"
731 nil t)
732 (match-string 1)))
731 (setq ispell-really-hunspell 733 (setq ispell-really-hunspell
732 (and (search-forward-regexp 734 (and
733 "(but really Hunspell \\([0-9]+\\.[0-9\\.-]+\\)?)" 735 (search-forward-regexp
734 nil t) 736 "(but really Hunspell \\([0-9]+\\.[0-9.]+\\([-._+ ]?[a-zA-Z0-9]+\\)?\\)?)"
735 (match-string 1))) 737 nil t)
738 (match-string 1)))
736 (setq ispell-really-enchant 739 (setq ispell-really-enchant
737 (and (search-forward-regexp 740 (and
738 "(but really Enchant \\([0-9]+\\.[0-9\\.-]+\\)?)" 741 (search-forward-regexp
739 nil t) 742 "(but really Enchant \\([0-9]+\\.[0-9.]+\\([-._+ ]?[a-zA-Z0-9]+\\)?\\)?)"
740 (match-string 1))))) 743 nil t)
744 (match-string 1)))))
741 745
742 (let* ((aspell8-minver "0.60") 746 (let* ((aspell8-minver "0.60")
743 (ispell-minver "3.1.12") 747 (ispell-minver "3.1.12")