diff options
| author | Reuben Thomas | 2016-12-04 00:54:04 +0000 |
|---|---|---|
| committer | Reuben Thomas | 2016-12-13 19:43:48 +0000 |
| commit | 8edf0eb4d37194c327742cc75b2dbc1088c962c1 (patch) | |
| tree | e0b879aca85109ce1154734470ba283d2c822021 | |
| parent | f25c8b34c7a500bd0e891a64a73bdf999217efb3 (diff) | |
| download | emacs-8edf0eb4d37194c327742cc75b2dbc1088c962c1.tar.gz emacs-8edf0eb4d37194c327742cc75b2dbc1088c962c1.zip | |
Assume we have version<= for checking ispell version
* lisp/textmodes/ispell.el (ispell-check-minver): Remove.
(ispell-check-version): Use version<= directly.
| -rw-r--r-- | lisp/textmodes/ispell.el | 46 |
1 files changed, 5 insertions, 41 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 25099e3f6c1..14a782d1cec 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el | |||
| @@ -118,42 +118,6 @@ | |||
| 118 | ;; Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r) | 118 | ;; Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r) |
| 119 | ;; can cause misalignment errors. | 119 | ;; can cause misalignment errors. |
| 120 | 120 | ||
| 121 | ;;; Compatibility code for XEmacs and (not too) older emacsen: | ||
| 122 | (defalias 'ispell-check-minver | ||
| 123 | (if (fboundp 'version<=) 'version<= | ||
| 124 | (lambda (minver version) | ||
| 125 | "Check if string VERSION is at least string MINVER. | ||
| 126 | Both must be in [0-9]+.[0-9]+... format. This is a fallback | ||
| 127 | compatibility function in case `version<=' is not available." | ||
| 128 | (let ((pending t) | ||
| 129 | (return t) | ||
| 130 | start-ver start-mver) | ||
| 131 | ;; Loop until an absolute greater or smaller condition is reached | ||
| 132 | ;; or until no elements are left in any of version and minver. In | ||
| 133 | ;; this case version is exactly the minimal, so return OK. | ||
| 134 | (while pending | ||
| 135 | (let (ver mver) | ||
| 136 | (if (string-match "[0-9]+" version start-ver) | ||
| 137 | (setq start-ver (match-end 0) | ||
| 138 | ver (string-to-number (match-string 0 version)))) | ||
| 139 | (if (string-match "[0-9]+" minver start-mver) | ||
| 140 | (setq start-mver (match-end 0) | ||
| 141 | mver (string-to-number (match-string 0 minver)))) | ||
| 142 | |||
| 143 | (if (or ver mver) | ||
| 144 | (progn | ||
| 145 | (or ver (setq ver 0)) | ||
| 146 | (or mver (setq mver 0)) | ||
| 147 | ;; If none of below conditions match, this element is the | ||
| 148 | ;; same. Go checking next element. | ||
| 149 | (if (> ver mver) | ||
| 150 | (setq pending nil) | ||
| 151 | (if (< ver mver) | ||
| 152 | (setq pending nil | ||
| 153 | return nil)))) | ||
| 154 | (setq pending nil)))) | ||
| 155 | return)))) | ||
| 156 | |||
| 157 | ;; XEmacs does not have looking-back | 121 | ;; XEmacs does not have looking-back |
| 158 | (defalias 'ispell-looking-back | 122 | (defalias 'ispell-looking-back |
| 159 | (if (fboundp 'looking-back) 'looking-back | 123 | (if (fboundp 'looking-back) 'looking-back |
| @@ -829,8 +793,8 @@ Otherwise returns the library directory name, if that is defined." | |||
| 829 | (ispell-minver "3.1.12") | 793 | (ispell-minver "3.1.12") |
| 830 | (hunspell8-minver "1.1.6")) | 794 | (hunspell8-minver "1.1.6")) |
| 831 | 795 | ||
| 832 | (if (ispell-check-minver ispell0-minver ispell-program-version) | 796 | (if (version<= ispell0-minver ispell-program-version) |
| 833 | (or (ispell-check-minver ispell-minver ispell-program-version) | 797 | (or (version<= ispell-minver ispell-program-version) |
| 834 | (setq ispell-offset 0)) | 798 | (setq ispell-offset 0)) |
| 835 | (error "%s release %s or greater is required" | 799 | (error "%s release %s or greater is required" |
| 836 | ispell-program-name | 800 | ispell-program-name |
| @@ -838,14 +802,14 @@ Otherwise returns the library directory name, if that is defined." | |||
| 838 | 802 | ||
| 839 | (cond | 803 | (cond |
| 840 | (ispell-really-aspell | 804 | (ispell-really-aspell |
| 841 | (if (ispell-check-minver aspell-minver ispell-really-aspell) | 805 | (if (version<= aspell-minver ispell-really-aspell) |
| 842 | (if (ispell-check-minver aspell8-minver ispell-really-aspell) | 806 | (if (version<= aspell8-minver ispell-really-aspell) |
| 843 | (progn | 807 | (progn |
| 844 | (setq ispell-aspell-supports-utf8 t) | 808 | (setq ispell-aspell-supports-utf8 t) |
| 845 | (setq ispell-encoding8-command "--encoding="))) | 809 | (setq ispell-encoding8-command "--encoding="))) |
| 846 | (setq ispell-really-aspell nil))) | 810 | (setq ispell-really-aspell nil))) |
| 847 | (ispell-really-hunspell | 811 | (ispell-really-hunspell |
| 848 | (if (ispell-check-minver hunspell8-minver ispell-really-hunspell) | 812 | (if (version<= hunspell8-minver ispell-really-hunspell) |
| 849 | (setq ispell-encoding8-command "-i") | 813 | (setq ispell-encoding8-command "-i") |
| 850 | (setq ispell-really-hunspell nil)))))) | 814 | (setq ispell-really-hunspell nil)))))) |
| 851 | result)) | 815 | result)) |