unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#25107: Patches to clean up ispell.el
@ 2016-12-04 17:10 Reuben Thomas
       [not found] ` <handler.25107.B.148087148014808.ack@debbugs.gnu.org>
  2016-12-13 19:45 ` bug#25107: Reuben Thomas
  0 siblings, 2 replies; 17+ messages in thread
From: Reuben Thomas @ 2016-12-04 17:10 UTC (permalink / raw)
  To: 25107


[-- Attachment #1.1: Type: text/plain, Size: 995 bytes --]

The attached patch series is mostly aimed at removing XEmacs-specific code,
which is not needed, since our version of ispell.el has been part of GNU
Emacs for some time, and is not imported from upstream (the most recent
upstream release was over 20 years ago). Similarly, some workarounds for
older versions of GNU Emacs are removed (since ispell.el is not distributed
separately); in any case, most of the workarounds seem to pertain to GNU
Emacs pre-version 21.

The pre-VCS change history is also removed by the patch.

This clean-up series is aimed at making things neat before I add enchant
support (bug #17742), which will be a very simple change.

One patch also removes the pre-GNU Emacs maintainer information, so that
attentive users (who read the source!) do not mistakenly try to file bug
reports &c. with the original upstream.

I have supplied the patches as a series for ease of reading, but could
compress them if desired for installation in Emacs git.

-- 
http://rrt.sc3d.org

[-- Attachment #1.2: Type: text/html, Size: 1678 bytes --]

[-- Attachment #2: 0002-Remove-ispell.el-pre-GNU-Emacs-comments.patch --]
[-- Type: text/x-patch, Size: 5307 bytes --]

From 9572d5868e8a58b25a9eda94164f149b102031eb Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 00:49:35 +0000
Subject: [PATCH 02/15] Remove ispell.el pre-GNU Emacs comments

* lisp/textmodes/ispell.el (Commentary): Remove original maintainer
  details, as Emacs version, bug report address and so forth should be
  used instead for this version.  Remove in-line change history; use
  git instead.
---
 lisp/textmodes/ispell.el | 77 ------------------------------------------------
 1 file changed, 77 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 5d5d422..25099e3 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -3,12 +3,7 @@
 ;; Copyright (C) 1994-1995, 1997-2016 Free Software Foundation, Inc.
 
 ;; Author:           Ken Stevens <k.stevens@ieee.org>
-;; Maintainer:       Ken Stevens <k.stevens@ieee.org>
-;; Stevens Mod Date: Mon Jan  7 12:32:44 PST 2003
-;; Stevens Revision: 3.6
 ;; Status          : Release with 3.1.12+ and 3.2.0+ ispell.
-;; Bug Reports     : ispell-el-bugs@itcorp.com
-;; Web Site        : http://kdstevens.com/~stevens/ispell-page.html
 ;; Keywords: unix wp
 
 ;; This file is part of GNU Emacs.
@@ -123,78 +118,6 @@
 ;;  Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r)
 ;;    can cause misalignment errors.
 
-;; HISTORY
-
-;; Modifications made in latest versions:
-
-;; Revision 3.6 2003/01/07 12:32:44	kss
-;; Removed extra -d LIB in dictionary defs. (Pavel Janik)
-;; Filtered process calls with duplicate dictionary entries.
-;; Fixed bug where message-text-end is inside a mime skipped region.
-;; Minor fixes to get ispell menus right in XEmacs
-;; Fixed skip regexp so it doesn't match stuff like `/.\w'.
-;; Detecting dictionary change not working.  Fixed.  kss
-;; function `ispell-change-dictionary' now only completes valid dicts.
-
-;; Revision 3.5 2001/7/11 18:43:57	kss
-;; Added fix for aspell to work in XEmacs (ispell-check-version).
-;; Added Portuguese dictionary definition.
-;; New feature: MIME mail message support, Fcc support.
-;; Bug fix: retain comment syntax on lines with region skipping. (TeX $ bug...)
-;; Improved allocation for graphic mode lines.  (Miles Bader)
-;; Support -v flag for old versions of aspell.  (Eli Zaretskii)
-;; Clear minibuffer on ^G from ispell-help (Tak Ota)
-
-;; Revision 3.4 2000/8/4 09:41:50	kss
-;; Support new color display functions.
-;; Fixed misalignment offset bug when replacing a string after a shift made.
-;; Set to standard Author/Maintainer heading,
-;; ensure localwords lists are separated from the text by newline. (Dave Love)
-;; Added dictionary definition for Italian (William Deakin)
-;; HTML region skipping greatly improved. (Chuck D. Phillips)
-;; improved menus.  Fixed regexp matching http/email addresses.
-;; one arg always for XEmacs sleep-for (gunnar Evermann)
-;; support for synchronous processes (Eli Zaretskii)
-
-;; Revision 3.3  1999/11/29 11:38:34     kss
-;; Only word replacements entered in from the keyboard are rechecked.
-;; This fixes a bug in tex parsing and misalignment.
-;; Exceptions exist for recursive edit and query-replace, with tex error
-;; condition tested.  Recursive editing improved.
-;; XEmacs repair for when `enable-multibyte-characters' defined - Didier Verna.
-;; ispell-help fixed for XEmacs.  Choices minibuffer now displayed in XEmacs.
-;; Only list valid dictionaries in Spell menu.  Russian dictionary doesn't allow
-;; run-together words, and uses koi8-r font.  Don't skip text in html <TT>
-;; fonts.
-
-;; Revision 3.2  1999/5/7 14:25:14	kss
-;; Accept ispell versions 3.X.Y where X>=1
-;; fine tuned latex region skipping.  Fixed bug in ispell-word that did not
-;; point in right place on words < 2 chars.  Simplified ispell-minor-mode.
-;; Fixed bug in TeX parsing when math commands are in the comments.
-;; Removed calls to `when' macro.
-
-;; Revision 3.1  1998/12/1 13:21:52	kss
-;; Improved and fixed customize support.
-;; Improved and fixed comments in variables and messages.
-;; A coding system is now required for all languages.
-;; casechars improved for castellano, castellano8, and norsk dictionaries.
-;; Dictionary norsk7-tex removed.  Dictionary polish added.
-;; Dictionaries redefined at load-time to support dictionary changes.
-;; Menu redefined at load time to support dictionary changes.
-;; ispell-check-version added as an alias for `check-ispell-version'.
-;; Spelling suggestions returned in order generated by ispell.
-;; Small bug fixed in matching ispell error messages.
-;; Robustness added to ensure `case-fold-search' doesn't get redefined.
-;; Fixed bug that didn't respect case of word in `ispell-complete-word'.
-;; Multibyte character coding support added for process interactions.
-;; Ensure ispell process has terminated before starting new process.
-;;  This can otherwise confuse process filters and hang ispell.
-;; Improved skipping support for SGML.
-;; Fixed bug using ^M rather than \r in `ispell-minor-check'.
-;; Improved message reference matching in `ispell-message'.
-;; Fixed bug in returning to nroff mode from tex mode.
-
 ;;; Compatibility code for XEmacs and (not too) older emacsen:
 (defalias 'ispell-check-minver
   (if (fboundp 'version<=) 'version<=
-- 
2.7.4


[-- Attachment #3: 0003-Assume-we-have-version-for-checking-ispell-version.patch --]
[-- Type: text/x-patch, Size: 3683 bytes --]

From 8cf4109cf660239326e18566ab67a2c5d1d19829 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 00:54:04 +0000
Subject: [PATCH 03/15] Assume we have version<= for checking ispell version

* lisp/textmodes/ispell.el (ispell-check-minver): Remove.
(ispell-check-version): Use version<= directly.
---
 lisp/textmodes/ispell.el | 46 +++++-----------------------------------------
 1 file changed, 5 insertions(+), 41 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 25099e3..14a782d 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -118,42 +118,6 @@
 ;;  Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r)
 ;;    can cause misalignment errors.
 
-;;; Compatibility code for XEmacs and (not too) older emacsen:
-(defalias 'ispell-check-minver
-  (if (fboundp 'version<=) 'version<=
-    (lambda (minver version)
-      "Check if string VERSION is at least string MINVER.
-Both must be in [0-9]+.[0-9]+... format.  This is a fallback
-compatibility function in case `version<=' is not available."
-      (let ((pending t)
-            (return t)
-            start-ver start-mver)
-        ;; Loop until an absolute greater or smaller condition is reached
-        ;; or until no elements are left in any of version and minver. In
-        ;; this case version is exactly the minimal, so return OK.
-        (while pending
-          (let (ver mver)
-            (if (string-match "[0-9]+" version start-ver)
-                (setq start-ver (match-end 0)
-                      ver (string-to-number (match-string 0 version))))
-            (if (string-match "[0-9]+" minver start-mver)
-                (setq start-mver (match-end 0)
-                      mver (string-to-number (match-string 0 minver))))
-
-            (if (or ver mver)
-                (progn
-                  (or ver  (setq ver 0))
-                  (or mver (setq mver 0))
-                  ;; If none of below conditions match, this element is the
-                  ;; same. Go checking next element.
-                  (if (> ver mver)
-                      (setq pending nil)
-                    (if (< ver mver)
-                        (setq pending nil
-                              return nil))))
-              (setq pending nil))))
-        return))))
-
 ;; XEmacs does not have looking-back
 (defalias 'ispell-looking-back
   (if (fboundp 'looking-back) 'looking-back
@@ -829,8 +793,8 @@ ispell-check-version
 	    (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)
+	(if (version<= ispell0-minver ispell-program-version)
+	    (or (version<= ispell-minver ispell-program-version)
 		(setq ispell-offset 0))
 	  (error "%s release %s or greater is required"
 		 ispell-program-name
@@ -838,14 +802,14 @@ ispell-check-version
 
 	(cond
 	 (ispell-really-aspell
-	  (if (ispell-check-minver aspell-minver ispell-really-aspell)
-	      (if (ispell-check-minver aspell8-minver ispell-really-aspell)
+	  (if (version<= aspell-minver ispell-really-aspell)
+	      (if (version<= aspell8-minver ispell-really-aspell)
 		  (progn
 		    (setq ispell-aspell-supports-utf8 t)
 		    (setq ispell-encoding8-command "--encoding=")))
 	    (setq ispell-really-aspell nil)))
 	 (ispell-really-hunspell
-	  (if (ispell-check-minver hunspell8-minver ispell-really-hunspell)
+	  (if (version<= hunspell8-minver ispell-really-hunspell)
 	      (setq ispell-encoding8-command "-i")
 	    (setq ispell-really-hunspell nil))))))
     result))
-- 
2.7.4


[-- Attachment #4: 0004-Remove-unused-ispell-looking-back.patch --]
[-- Type: text/x-patch, Size: 1522 bytes --]

From c5b9cfc88078940a631b2239807d8fb1bfaa7685 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 01:06:26 +0000
Subject: [PATCH 04/15] Remove unused ispell-looking-back

* lisp/textmodes/ispell.el (ispell-looking-back): Remove unused alias.
---
 lisp/textmodes/ispell.el | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 14a782d..554905c 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -118,21 +118,6 @@
 ;;  Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r)
 ;;    can cause misalignment errors.
 
-;; XEmacs does not have looking-back
-(defalias 'ispell-looking-back
-  (if (fboundp 'looking-back) 'looking-back
-    (lambda (regexp &optional limit &rest ignored)
-      "Return non-nil if text before point matches regular expression REGEXP.
-Like `looking-at' except matches before point, and is slower.
-LIMIT if non-nil speeds up the search by specifying a minimum
-starting position, to avoid checking matches that would start
-before LIMIT.
-
-This is a stripped down compatibility function for use when
-full featured `looking-back' function is missing."
-      (save-excursion
-        (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t)))))
-
 ;;; XEmacs21 does not have `with-no-warnings'. Taken from org mode.
 (defmacro ispell-with-no-warnings (&rest body)
   (cons (if (fboundp 'with-no-warnings) 'with-no-warnings 'progn) body))
-- 
2.7.4


[-- Attachment #5: 0005-Remove-tests-for-built-in-functions.patch --]
[-- Type: text/x-patch, Size: 3127 bytes --]

From 8fdca7c7c23eaa83aa470276d19a40d1be3a28a4 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 13:52:04 +0000
Subject: [PATCH 05/15] Remove tests for built-in functions

* lisp/textmodes/ispell.el (buffer-substring-no-properties): Remove
back-up definition.
(ispell-command-loop): Remove test for flyspell-unhighlight-at.
(ispell-add-per-file-word-list): Remove tests for comment-padright and
comment-normalize-vars.
---
 lisp/textmodes/ispell.el | 26 ++++++++------------------
 1 file changed, 8 insertions(+), 18 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 554905c..85661e7 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -132,10 +132,6 @@ ispell
   "User variables for Emacs ispell interface."
   :group 'applications)
 
-(if (not (fboundp 'buffer-substring-no-properties))
-    (defun buffer-substring-no-properties (start end)
-      (buffer-substring start end)))
-
 (defalias 'check-ispell-version 'ispell-check-version)
 
 ;;; **********************************************************************
@@ -2300,15 +2296,13 @@ ispell-command-loop
 		   ((= char ?i)		; accept and insert word into pers dict
 		    (ispell-send-string (concat "*" word "\n"))
 		    (setq ispell-pdict-modified-p '(t)) ; dictionary modified!
-		    (and (fboundp 'flyspell-unhighlight-at)
-			 (flyspell-unhighlight-at start))
+		    (flyspell-unhighlight-at start)
 		    nil)
 		   ((or (= char ?a) (= char ?A)) ; accept word without insert
 		    (ispell-send-string (concat "@" word "\n"))
 		    (cl-pushnew word ispell-buffer-session-localwords
                                 :test #'equal)
-		    (and (fboundp 'flyspell-unhighlight-at)
-			 (flyspell-unhighlight-at start))
+		    (flyspell-unhighlight-at start)
 		    (or ispell-buffer-local-name ; session localwords might conflict
 			(setq ispell-buffer-local-name (buffer-name)))
 		    (if (null ispell-pdict-modified-p)
@@ -4286,16 +4280,12 @@ ispell-add-per-file-word-list
 		    (unless found (newline))
 		    (insert (if comment-start
                                 (concat
-                                  (if (fboundp 'comment-padright)
-                                      ;; Try and use the proper comment marker,
-                                      ;; e.g. ";;" rather than ";".
-				      (progn
-					;; XEmacs: comment-normalize-vars
-					;; (newcomment.el) only in >= 21.5
-					(and (fboundp 'comment-normalize-vars)
-					     (comment-normalize-vars))
-					(comment-padright comment-start
-							  (comment-add nil)))
+                                  (progn
+                                   ;; Try and use the proper comment marker,
+                                   ;; e.g. ";;" rather than ";".
+                                    (comment-normalize-vars)
+                                    (comment-padright comment-start
+                                                      (comment-add nil))
                                     comment-start)
                                   " ")
                               "")
-- 
2.7.4


[-- Attachment #6: 0006-Generalise-over-specific-documentation.patch --]
[-- Type: text/x-patch, Size: 1493 bytes --]

From f06962a566835c8b687b78848ab76d7a35c54eee Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 13:55:31 +0000
Subject: [PATCH 06/15] Generalise over-specific documentation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/textmodes/ispell.el (ispell-personal-dictionary): Rather than
document precise personal wordlist filenames for only two supported
spelling checkers, simply say that the default personal dictionary
depends on the chosen spelling checker.  The user can check the
spelling checker’s documentation if necessary.  This is simpler, and
works for other supported (and future, or unknown) spelling checkers.
---
 lisp/textmodes/ispell.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 85661e7..dc46647 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -349,9 +349,7 @@ ispell-use-framepop-p
 ;;;###autoload
 (defcustom ispell-personal-dictionary nil
   "File name of your personal spelling dictionary, or nil.
-If nil, the default personal dictionary, (\"~/.ispell_DICTNAME\" for ispell or
-\"~/.aspell.LANG.pws\" for Aspell) is used, where DICTNAME is the name of your
-default dictionary and LANG the two letter language code."
+If nil, the default personal dictionary for your spelling checker is used."
   :type '(choice file
 		 (const :tag "default" nil))
   :group 'ispell)
-- 
2.7.4


[-- Attachment #7: 0007-Remove-some-XEmacs-specific-code-from-ispell.el.patch --]
[-- Type: text/x-patch, Size: 4259 bytes --]

From 9f87d8487acfeaea22a3d92c2fe74822bd270e33 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 13:59:59 +0000
Subject: [PATCH 07/15] Remove some XEmacs-specific code from ispell.el

* lisp/textmodes/ispell.el: Remove XEmacs menubar setup.
(ispell-int-char): Remove.
---
 lisp/textmodes/ispell.el | 69 +++++-------------------------------------------
 1 file changed, 6 insertions(+), 63 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index dc46647..0bf6c75 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1466,62 +1466,6 @@ ispell-valid-dictionary-list
       ;;(put 'ispell-region 'menu-enable 'mark-active)
       (fset 'ispell-menu-map (symbol-value 'ispell-menu-map))))
 
-;;; XEmacs versions 19 & 20
-(if (and (featurep 'xemacs)
-	 (featurep 'menubar)
-	 ;;(null ispell-menu-xemacs)
-	 (not (and (boundp 'infodock-version) infodock-version)))
-    (let ((dicts (if (fboundp 'ispell-valid-dictionary-list)
-		     (reverse (ispell-valid-dictionary-list))))
-	  (current-menubar (or current-menubar default-menubar))
-	  (menu
-	   '(["Help"		(describe-function 'ispell-help) t]
-	     ;;["Help"		(popup-menu ispell-help-list)	t]
-	     ["Check Message"	ispell-message			t]
-	     ["Check Buffer"	ispell-buffer			t]
-	     ["Check Comments"	ispell-comments-and-strings	t]
-	     ["Check Word"	ispell-word			t]
-	     ["Check Region"	ispell-region  (or (not zmacs-regions) (mark))]
-	     ["Continue Check"	ispell-continue			t]
-	     ["Complete Word Frag"ispell-complete-word-interior-frag t]
-	     ["Complete Word"	ispell-complete-word		t]
-	     ["Kill Process"	(ispell-kill-ispell nil 'clear) t]
-	     ["Customize..."	(customize-group 'ispell)	t]
-	     ;; flyspell-mode may not be bound...
-	     ;;["flyspell"	flyspell-mode
-	     ;;			:style toggle :selected flyspell-mode ]
-	     "-"
-	     ["Save Personal Dict"(ispell-pdict-save t t)	t]
-	     ["Change Dictionary" ispell-change-dictionary	t])))
-      (if (null dicts)
-	  (setq dicts (cons "default" nil)))
-      (dolist (name dicts)
-	(setq menu (append menu
-			   (list
-			     (vector
-			      (concat "Select " (capitalize name))
-			      (list 'ispell-change-dictionary name)
-			      t)))))
-      (setq ispell-menu-xemacs menu)
-      (if current-menubar
-	  (progn
-	    (if (car (find-menu-item current-menubar '("Cmds")))
-		(progn
-		  ;; XEmacs 21.2
-		  (delete-menu-item '("Cmds" "Spell-Check"))
-		  (add-menu '("Cmds") "Spell-Check" ispell-menu-xemacs))
-	      ;; previous
-	      (delete-menu-item '("Edit" "Spell")) ; in case already defined
-	      (add-menu '("Edit") "Spell" ispell-menu-xemacs))))))
-
-(defalias 'ispell-int-char
-  ;; Allow incrementing characters as integers in XEmacs 20
-  (if (and (featurep 'xemacs)
-	   (fboundp 'int-char))
-      'int-char
-    ;; Emacs and XEmacs 19 or earlier
-    'identity))
-
 
 ;;; **********************************************************************
 
@@ -2230,12 +2174,12 @@ ispell-command-loop
 	;; not so good if there are over 20 or 30 options, but then, if
 	;; there are that many you don't want to scan them all anyway...
 	(while (memq count command-characters) ; skip command characters.
-	  (setq count (ispell-int-char (1+ count))
+	  (setq count (1+ count)
 		skipped (1+ skipped)))
 	(insert "(" count ") " (car choices) "  ")
 	(setq choices (cdr choices)
-	      count (ispell-int-char (1+ count))))
-      (setq count (ispell-int-char (- count ?0 skipped))))
+	      count (1+ count)))
+      (setq count (- count ?0 skipped)))
 
     (run-hooks 'ispell-update-post-hook)
 
@@ -2380,13 +2324,12 @@ ispell-command-loop
 					 (window-width))
 				  (insert "\n"))
 				(while (memq count command-characters)
-				  (setq count (ispell-int-char (1+ count))
+				  (setq count (1+ count)
 					skipped (1+ skipped)))
 				(insert "(" count ") " (car choices) "  ")
 				(setq choices (cdr choices)
-				      count (ispell-int-char (1+ count))))
-			      (setq count (ispell-int-char
-					   (- count ?0 skipped))))
+				      count (1+ count)))
+			      (setq count (- count ?0 skipped)))
 			    (setq textwin (selected-window))
 			    (ispell-show-choices)
 			    (select-window textwin))))
-- 
2.7.4


[-- Attachment #8: 0008-Assume-Emacs-supports-alpha-in-regexps.patch --]
[-- Type: text/x-patch, Size: 4626 bytes --]

From a9032afb7b17f9f6499f91ec098434bcbcd077c7 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:02:48 +0000
Subject: [PATCH 08/15] Assume Emacs supports [:alpha:] in regexps

* lisp/textmodes/ispell.el (ispell-emacs-alpha-regexp): Remove.
(ispell-set-spellchecker-params): Remove tests of
ispell-emacs-alpha-regexp.
---
 lisp/textmodes/ispell.el | 55 +++++++++++++++++++-----------------------------
 1 file changed, 22 insertions(+), 33 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 0bf6c75..2e59414 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -666,12 +666,6 @@ ispell-dicts-name2locale-equivs-alist
   "Alist with known matching locales for standard dict names in
   `ispell-dictionary-base-alist'.")
 
-(defvar ispell-emacs-alpha-regexp
-  (if (string-match "^[[:alpha:]]+$" "abcde")
-      "[[:alpha:]]"
-    nil)
-  "[[:alpha:]] if Emacs supports [:alpha:] regexp, nil
-otherwise (current XEmacs does not support it).")
 
 ;;; **********************************************************************
 ;;; The following are used by ispell, and should not be changed.
@@ -1244,11 +1238,9 @@ ispell-set-spellchecker-params
 		   (setq ispell-library-directory (ispell-check-version))
 		   t)
 	       (error nil))
-	     ispell-encoding8-command
-	     ispell-emacs-alpha-regexp)
+	     ispell-encoding8-command)
 	;; auto-detection will only be used if spellchecker is not
-	;; ispell, supports a way  to set communication to UTF-8 and
-	;; Emacs flavor supports [:alpha:]
+	;; ispell and supports a way to set communication to UTF-8.
 	(if ispell-really-aspell
 	    (or ispell-aspell-dictionary-alist
 		(ispell-find-aspell-dictionaries))
@@ -1262,9 +1254,8 @@ ispell-set-spellchecker-params
     ;; installed dictionaries and add to it elements of the original
     ;; list that are not present there. Allow distro info.
     (let ((found-dicts-alist
-	   (if (and ispell-encoding8-command
-		    ispell-emacs-alpha-regexp)
-	       (if ispell-really-aspell
+	   (if ispell-encoding8-command
+               (if ispell-really-aspell
 		   ispell-aspell-dictionary-alist
 		 (if ispell-really-hunspell
 		     ispell-hunspell-dictionary-alist))
@@ -1331,28 +1322,26 @@ ispell-set-spellchecker-params
 	  (push dict all-dicts-alist)))
       (setq ispell-dictionary-alist all-dicts-alist))
 
-    ;; If Emacs flavor supports [:alpha:] use it for global dicts.  If
-    ;; spellchecker also supports UTF-8 via command-line option use it
+    ;; If spellchecker supports UTF-8 via command-line option, use it
     ;; in communication.  This does not affect definitions in your
     ;; init file.
-    (if ispell-emacs-alpha-regexp
-     	(let (tmp-dicts-alist)
-    	  (dolist (adict ispell-dictionary-alist)
-	    (cl-pushnew (if (cadr adict) ;; Do not touch hunspell uninitialized entries
-                            (list
-                             (nth 0 adict)   ; dict name
-                             "[[:alpha:]]"   ; casechars
-                             "[^[:alpha:]]"  ; not-casechars
-                             (nth 3 adict)   ; otherchars
-                             (nth 4 adict)   ; many-otherchars-p
-                             (nth 5 adict)   ; ispell-args
-                             (nth 6 adict)   ; extended-character-mode
-                             (if ispell-encoding8-command
-                                 'utf-8
-                               (nth 7 adict)))
-                          adict)
-                        tmp-dicts-alist :test #'equal))
-	  (setq ispell-dictionary-alist tmp-dicts-alist)))))
+    (let (tmp-dicts-alist)
+      (dolist (adict ispell-dictionary-alist)
+        (cl-pushnew (if (cadr adict) ;; Do not touch hunspell uninitialized entries
+                        (list
+                         (nth 0 adict)   ; dict name
+                         "[[:alpha:]]"   ; casechars
+                         "[^[:alpha:]]"  ; not-casechars
+                         (nth 3 adict)   ; otherchars
+                         (nth 4 adict)   ; many-otherchars-p
+                         (nth 5 adict)   ; ispell-args
+                         (nth 6 adict)   ; extended-character-mode
+                         (if ispell-encoding8-command
+                             'utf-8
+                           (nth 7 adict)))
+                      adict)
+                    tmp-dicts-alist :test #'equal))
+      (setq ispell-dictionary-alist tmp-dicts-alist))))
 
 (defun ispell-valid-dictionary-list ()
   "Return a list of valid dictionaries.
-- 
2.7.4


[-- Attachment #9: 0009-Remove-XEmacs-and-old-Emacs-highlighting-code.patch --]
[-- Type: text/x-patch, Size: 2096 bytes --]

From 01f7558b203c4aad9e566d0be871129b422a244e Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:05:07 +0000
Subject: [PATCH 09/15] Remove XEmacs and old Emacs highlighting code

* lisp/textmodes/ispell.el
(ispell-highlight-spelling-error-xemacs): Remove.
(ispell-highlight-spelling-error): Assume display-color-p exists.
---
 lisp/textmodes/ispell.el | 22 +++-------------------
 1 file changed, 3 insertions(+), 19 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 2e59414..84b7141 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2631,17 +2631,6 @@ ispell-highlight-spelling-error-generic
 	  (if (eq 'block refresh) start (- start 2)) end t))))
 
 
-(defun ispell-highlight-spelling-error-xemacs (start end &optional highlight)
-  "Highlight the word from START to END using `isearch-highlight'.
-When the optional third arg HIGHLIGHT is set, the word is highlighted,
-otherwise it is displayed normally."
-  (if highlight
-      (isearch-highlight start end)
-    (isearch-dehighlight))
-  ;;(sit-for 0)
-  )
-
-
 (defun ispell-highlight-spelling-error-overlay (start end &optional highlight)
   "Highlight the word from START to END using overlays.
 When the optional third arg HIGHLIGHT is set, the word is highlighted
@@ -2677,14 +2666,9 @@ ispell-highlight-spelling-error-overlay
 
 
 (defun ispell-highlight-spelling-error (start end &optional highlight refresh)
-  (cond
-   ((featurep 'xemacs)
-    (ispell-highlight-spelling-error-xemacs start end highlight))
-   ((and (featurep 'faces)
-	 (or (and (fboundp 'display-color-p) (display-color-p))
-	     window-system))
-    (ispell-highlight-spelling-error-overlay start end highlight))
-   (t (ispell-highlight-spelling-error-generic start end highlight refresh))))
+  (if (display-color-p)
+      (ispell-highlight-spelling-error-overlay start end highlight)
+    (ispell-highlight-spelling-error-generic start end highlight refresh)))
 
 (defun ispell-display-buffer (buffer)
   "Show BUFFER in new window above selected one.
-- 
2.7.4


[-- Attachment #10: 0010-Remove-some-commented-out-code.patch --]
[-- Type: text/x-patch, Size: 1373 bytes --]

From d90f4bdfb5ab6a822ac828bcf5d7c4bc84e61e1b Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:15:50 +0000
Subject: [PATCH 10/15] Remove some commented-out code

lisp/textmodes/ispell.el (ispell-process)
ispell-valid-dictionary-list): Remove commented-out code.
---
 lisp/textmodes/ispell.el | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 84b7141..64ca428 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -860,11 +860,7 @@ ispell-process
 
 (defvar ispell-async-processp (and (fboundp 'delete-process)
 				   (fboundp 'process-send-string)
-				   (fboundp 'accept-process-output)
-				   ;;(fboundp 'make-process)
-				   ;;(fboundp 'set-process-filter)
-				   ;;(fboundp 'process-kill-without-query)
-				   )
+				   (fboundp 'accept-process-output))
   "Non-nil means that the OS supports asynchronous processes.")
 
 ;; Make ispell.el work better with aspell.
@@ -1452,7 +1448,6 @@ ispell-valid-dictionary-list
       (define-key ispell-menu-map [ispell-buffer]
 	`(menu-item ,(purecopy "Spell-Check Buffer") ispell-buffer
 		    :help ,(purecopy "Check spelling of selected buffer")))
-      ;;(put 'ispell-region 'menu-enable 'mark-active)
       (fset 'ispell-menu-map (symbol-value 'ispell-menu-map))))
 
 
-- 
2.7.4


[-- Attachment #11: 0011-Remove-XEmacs-specific-code-from-ispell.el.patch --]
[-- Type: text/x-patch, Size: 5173 bytes --]

From 6ff7dd700036d8ab5b70bc596338d25b5b18bfe8 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:19:26 +0000
Subject: [PATCH 11/15] Remove XEmacs-specific code from ispell.el

* lisp/textmodes/ispell.el (ispell-menu-xemacs): Remove
(ispell-menu-map-needed): Remove XEmacs-specific check.
(ispell-word): Remove XEmacs-specific extent code.
(ispell-init-process): Remove XEmacs workaround for local add-hook.
Assume we have set-process-query-on-exit-flag.
(ispell-kill-ispell, ispell-change-dictionary): Remove XEmacs
workaround for called-interactively-p.
---
 lisp/textmodes/ispell.el | 55 +++++++++---------------------------------------
 1 file changed, 10 insertions(+), 45 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 64ca428..8b0c922 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -833,22 +833,10 @@ ispell-menu-map
 ;; Redo menu when loading ispell to get dictionary modifications
 (setq ispell-menu-map nil)
 
-;;;###autoload
-(defvar ispell-menu-xemacs nil
-  "Spelling menu for XEmacs.
-If nil when package is loaded, a standard menu will be set,
-and added as a submenu of the \"Edit\" menu.")
-
-;; Break out XEmacs menu and split into several calls to avoid having
-;; long lines in loaddefs.el.  Detect need off following constant.
-
 ;;; Set up dictionary
 ;;;###autoload
 (defvar ispell-menu-map-needed
-  ;; only needed when not version 18 and not XEmacs.
-  (and (not ispell-menu-map)
-       (not (featurep 'xemacs))
-       'reload))
+  (unless (ispell-menu-map) 'reload))
 
 (defvar ispell-library-directory (condition-case ()
 				     (ispell-check-version)
@@ -1932,32 +1920,20 @@ ispell-word
       (cond ((eq poss t)
 	     (or quietly
 		 (message "%s is correct"
-			  (funcall ispell-format-word-function word)))
-	     (and (featurep 'xemacs)
-		  (extent-at start)
-		  (and (fboundp 'delete-extent)
-		       (delete-extent (extent-at start)))))
+			  (funcall ispell-format-word-function word))))
 	    ((stringp poss)
 	     (or quietly
 		 (message "%s is correct because of root %s"
 			  (funcall ispell-format-word-function word)
-			  (funcall ispell-format-word-function poss)))
-	     (and (featurep 'xemacs)
-		  (extent-at start)
-		  (and (fboundp 'delete-extent)
-		       (delete-extent (extent-at start)))))
+			  (funcall ispell-format-word-function poss))))
 	    ((null poss)
 	     (message "Error checking word %s using %s with %s dictionary"
 		      (funcall ispell-format-word-function word)
 		      (file-name-nondirectory ispell-program-name)
 		      (or ispell-current-dictionary "default")))
 	    (ispell-check-only	      ; called from ispell minor mode.
-	     (if (fboundp 'make-extent)
-		 (if (fboundp 'set-extent-property)
-		     (let ((ext (make-extent start end)))
-		       (set-extent-property ext 'face ispell-highlight-face)
-		       (set-extent-property ext 'priority 2000)))
-	       (beep)
+	     (progn
+               (beep)
 	       (message "%s is incorrect"
                         (funcall ispell-format-word-function word))))
 	    (t				; prompt for correct word.
@@ -2888,10 +2864,7 @@ ispell-init-process
 		;; to avoid over and over ispell kill.
 		(window-buffer (minibuffer-selected-window))
 	      (current-buffer))
-	  ;; 'local does not automatically make hook buffer-local in XEmacs.
-	  (if (featurep 'xemacs)
-	      (make-local-hook 'kill-buffer-hook))
-	  (add-hook 'kill-buffer-hook
+          (add-hook 'kill-buffer-hook
 		    (lambda () (ispell-kill-ispell t)) nil 'local)))
 
       (if ispell-async-processp
@@ -2936,12 +2909,8 @@ ispell-init-process
       (let ((extended-char-mode (ispell-get-extended-character-mode)))
 	(if extended-char-mode		; ~ extended character mode
 	    (ispell-send-string (concat extended-char-mode "\n"))))
-      (if ispell-async-processp
-	  (if (featurep 'emacs)
-	      (set-process-query-on-exit-flag ispell-process nil)
-	    (if (fboundp 'set-process-query-on-exit-flag)
-		(set-process-query-on-exit-flag ispell-process nil)
-	      (process-kill-without-query ispell-process)))))))
+      (when ispell-async-processp
+        (set-process-query-on-exit-flag ispell-process nil)))))
 
 ;;;###autoload
 (defun ispell-kill-ispell (&optional no-error clear)
@@ -2953,9 +2922,7 @@ ispell-kill-ispell
   ;; to optimize the common cases.
   (run-hooks 'ispell-kill-ispell-hook)
   (if (or clear
-	  (if (featurep 'xemacs)
-	      (interactive-p)
-	    (called-interactively-p 'interactive)))
+	  (called-interactively-p 'interactive))
       (setq ispell-buffer-session-localwords nil))
   (if (not (and ispell-process
 		(eq (ispell-process-status) 'run)))
@@ -3004,9 +2971,7 @@ ispell-change-dictionary
 	 ;; Specified dictionary is the default already. Could reload
 	 ;; the dictionaries if needed.
 	 (ispell-internal-change-dictionary)
-	 (and (if (featurep 'xemacs)
-		  (interactive-p)
-		(called-interactively-p 'interactive))
+	 (when (called-interactively-p 'interactive)
 	      (message "No change, using %s dictionary" dict)))
 	(t				; reset dictionary!
 	 (if (or (assoc dict ispell-local-dictionary-alist)
-- 
2.7.4


[-- Attachment #12: 0012-Remove-XEmacs-specific-code-dealing-with-enable-mult.patch --]
[-- Type: text/x-patch, Size: 2152 bytes --]

From 904e47a07c45296fa435b260e4d265e92262a0e8 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:35:42 +0000
Subject: [PATCH 12/15] Remove XEmacs-specific code dealing with
 enable-multibyte-characters

* lisp/textmodes/ispell.el (ispell-decode-string):
(ispell-init-process):  Remove XEmacs-specific guard.
---
 lisp/textmodes/ispell.el | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 8b0c922..8b5ae9e 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1451,17 +1451,8 @@ ispell-current-personal-dictionary
 This is passed to the Ispell process using the `-p' switch.")
 
 (defun ispell-decode-string (str)
-  "Decodes multibyte character strings.
-Protects against bogus binding of `enable-multibyte-characters' in XEmacs."
-  ;; FIXME: enable-multibyte-characters is read-only, so bogus bindings are
-  ;; really nasty (they signal an error in Emacs): Who does that?  --Stef
-  (if (and (or (featurep 'xemacs)
-	       (and (boundp 'enable-multibyte-characters)
-		    enable-multibyte-characters))
-	   (fboundp 'decode-coding-string)
-	   (ispell-get-coding-system))
-      (decode-coding-string str (ispell-get-coding-system))
-    str))
+  "Decodes multibyte character strings."
+  (decode-coding-string str (ispell-get-coding-system)))
 
 ;; Return a string decoded from Nth element of the current dictionary.
 (defun ispell-get-decoded-string (n)
@@ -2869,11 +2860,7 @@ ispell-init-process
 
       (if ispell-async-processp
 	  (set-process-filter ispell-process 'ispell-filter))
-      ;; Protect against XEmacs bogus binding of `enable-multibyte-characters'.
-      (if (and (or (featurep 'xemacs)
-		   (and (boundp 'enable-multibyte-characters)
-			enable-multibyte-characters))
-	       (fboundp 'set-process-coding-system)
+      (if (and enable-multibyte-characters
                ;; Evidently, some people use the synchronous mode even
                ;; when async subprocesses are supported, in which case
                ;; set-process-coding-system is bound, but
-- 
2.7.4


[-- Attachment #13: 0013-Remove-XEmacs-specific-horizontal-scrollbar-handling.patch --]
[-- Type: text/x-patch, Size: 1357 bytes --]

From 1a98d3b69819c479a80f3979235231c37a7a3c8c Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:37:37 +0000
Subject: [PATCH 13/15] Remove XEmacs-specific horizontal scrollbar handling in
 ispell.el

* lisp/textmodes/ispell.el (ispell-command-loop): Remove
XEmacs-specific code.
---
 lisp/textmodes/ispell.el | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 8b5ae9e..4b2a79c 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2094,15 +2094,9 @@ ispell-command-loop
              "--  %b  --  word: " word
              "  --  dict: " (or ispell-current-dictionary "default")
              "  --  prog: " (file-name-nondirectory ispell-program-name)))
-      ;; XEmacs: no need for horizontal scrollbar in choices window
+      ;; No need for horizontal scrollbar in choices window
       (ispell-with-no-warnings
-       (and (fboundp 'set-specifier)
-	    (boundp 'horizontal-scrollbar-visible-p)
-	    (set-specifier horizontal-scrollbar-visible-p nil
-			   (cons (current-buffer) nil))))
-      (ispell-with-no-warnings
-       (and (boundp 'horizontal-scroll-bar)
-	    (setq horizontal-scroll-bar nil)))
+       (setq horizontal-scroll-bar nil))
       (erase-buffer)
       (if guess
 	  (progn
-- 
2.7.4


[-- Attachment #14: 0014-Remove-XEmacs-specific-minibuffer-handling-code-from.patch --]
[-- Type: text/x-patch, Size: 2216 bytes --]

From d087d57bb7306729411abe4b67c0d014aec7716d Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:38:51 +0000
Subject: [PATCH 14/15] Remove XEmacs-specific minibuffer handling code from
 ispell.el

* lisp/textmodes/ispell.el (ispell-init-process): Assume we are not in
XEmacs.
---
 lisp/textmodes/ispell.el | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 4b2a79c..f9d2424 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2792,7 +2792,7 @@ ispell-init-process
 	 (current-ispell-directory default-directory) ;FIXME: Unused?
 	 ;; The default directory for the process.
 	 ;; Use "~/" as default-directory unless using Ispell with per-dir
-	 ;; personal dictionaries and not in a minibuffer under XEmacs
+	 ;; personal dictionaries
 	 (default-directory
 	   (if (or ispell-really-aspell
 		   ispell-really-hunspell
@@ -2805,9 +2805,8 @@ ispell-init-process
 						     ".ispell_"
 						     (or dict-bname
 							 "default")))))
-		   ;; Ispell, in a minibuffer, and XEmacs
-		   (and (window-minibuffer-p)
-			(not (fboundp 'minibuffer-selected-window))))
+		   ;; Ispell, in a minibuffer
+		   (window-minibuffer-p))
 	       (expand-file-name "~/")
 	     (expand-file-name default-directory))))
     ;; Check if process needs restart
@@ -2839,12 +2838,11 @@ ispell-init-process
 
       (unless (equal ispell-process-directory (expand-file-name "~/"))
 	;; At this point, `ispell-process-directory' will be "~/" unless using
-	;; Ispell with directory-specific dicts and not in XEmacs minibuffer.
+	;; Ispell with directory-specific dicts.
 	;; If not, kill ispell process when killing buffer.  It may be in a
 	;; removable device that would otherwise become un-mountable.
 	(with-current-buffer
-	    (if (and (window-minibuffer-p)                  ;; In minibuffer
-		     (fboundp 'minibuffer-selected-window)) ;; Not XEmacs.
+	    (if (window-minibuffer-p)                  ;; In minibuffer
 		;; In this case kill ispell only when parent buffer is killed
 		;; to avoid over and over ispell kill.
 		(window-buffer (minibuffer-selected-window))
-- 
2.7.4


[-- Attachment #15: 0015-Remove-remaining-mentions-of-XEmacs-from-ispell.el.patch --]
[-- Type: text/x-patch, Size: 1465 bytes --]

From 275fb8a2f7eb3a3850df7341a965bb9d523d300f Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:39:42 +0000
Subject: [PATCH 15/15] Remove remaining mentions of XEmacs from ispell.el

* lisp/textmodes/ispell.el (ispell-valid-dictionary-list):
(ispell-add-per-file-word-list): Remove mentions of XEmacs from
comments.
---
 lisp/textmodes/ispell.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index f9d2424..a10f04b 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1331,8 +1331,7 @@ ispell-valid-dictionary-list
   "Return a list of valid dictionaries.
 The variable `ispell-library-directory' defines their location."
   ;; Initialize variables and dictionaries alists for desired spellchecker.
-  ;; Make sure ispell.el is loaded to avoid some autoload loops in XEmacs
-  ;; (and may be others)
+  ;; Make sure ispell.el is loaded to avoid some autoload loops.
   (if (featurep 'ispell)
       (ispell-set-spellchecker-params))
 
@@ -4187,6 +4186,6 @@ ispell-add-per-file-word-list
 ; LocalWords:  minipage pers dict unhighlight buf grep sync prev inc
 ; LocalWords:  fn oldot NB AIX msg init read's bufs pt cmd Quinlan eg
 ; LocalWords:  uuencoded unidiff sc nn VM SGML eval IspellPersDict
-; LocalWords:  lns XEmacs HTML casechars Multibyte
+; LocalWords:  lns HTML casechars Multibyte
 
 ;;; ispell.el ends here
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* bug#25107: Acknowledgement (Patches to clean up ispell.el)
       [not found] ` <handler.25107.B.148087148014808.ack@debbugs.gnu.org>
@ 2016-12-04 22:11   ` Reuben Thomas
  2016-12-05 21:38     ` Reuben Thomas
  0 siblings, 1 reply; 17+ messages in thread
From: Reuben Thomas @ 2016-12-04 22:11 UTC (permalink / raw)
  To: 25107


[-- Attachment #1.1: Type: text/plain, Size: 121 bytes --]

Attached, a new patchset which fixes a typo in one of the previous patches
and adds a few more.

-- 
http://rrt.sc3d.org

[-- Attachment #1.2: Type: text/html, Size: 413 bytes --]

[-- Attachment #2: 0002-Remove-ispell.el-pre-GNU-Emacs-comments.patch --]
[-- Type: text/x-patch, Size: 5307 bytes --]

From 9572d5868e8a58b25a9eda94164f149b102031eb Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 00:49:35 +0000
Subject: [PATCH 02/21] Remove ispell.el pre-GNU Emacs comments

* lisp/textmodes/ispell.el (Commentary): Remove original maintainer
  details, as Emacs version, bug report address and so forth should be
  used instead for this version.  Remove in-line change history; use
  git instead.
---
 lisp/textmodes/ispell.el | 77 ------------------------------------------------
 1 file changed, 77 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 5d5d422..25099e3 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -3,12 +3,7 @@
 ;; Copyright (C) 1994-1995, 1997-2016 Free Software Foundation, Inc.
 
 ;; Author:           Ken Stevens <k.stevens@ieee.org>
-;; Maintainer:       Ken Stevens <k.stevens@ieee.org>
-;; Stevens Mod Date: Mon Jan  7 12:32:44 PST 2003
-;; Stevens Revision: 3.6
 ;; Status          : Release with 3.1.12+ and 3.2.0+ ispell.
-;; Bug Reports     : ispell-el-bugs@itcorp.com
-;; Web Site        : http://kdstevens.com/~stevens/ispell-page.html
 ;; Keywords: unix wp
 
 ;; This file is part of GNU Emacs.
@@ -123,78 +118,6 @@
 ;;  Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r)
 ;;    can cause misalignment errors.
 
-;; HISTORY
-
-;; Modifications made in latest versions:
-
-;; Revision 3.6 2003/01/07 12:32:44	kss
-;; Removed extra -d LIB in dictionary defs. (Pavel Janik)
-;; Filtered process calls with duplicate dictionary entries.
-;; Fixed bug where message-text-end is inside a mime skipped region.
-;; Minor fixes to get ispell menus right in XEmacs
-;; Fixed skip regexp so it doesn't match stuff like `/.\w'.
-;; Detecting dictionary change not working.  Fixed.  kss
-;; function `ispell-change-dictionary' now only completes valid dicts.
-
-;; Revision 3.5 2001/7/11 18:43:57	kss
-;; Added fix for aspell to work in XEmacs (ispell-check-version).
-;; Added Portuguese dictionary definition.
-;; New feature: MIME mail message support, Fcc support.
-;; Bug fix: retain comment syntax on lines with region skipping. (TeX $ bug...)
-;; Improved allocation for graphic mode lines.  (Miles Bader)
-;; Support -v flag for old versions of aspell.  (Eli Zaretskii)
-;; Clear minibuffer on ^G from ispell-help (Tak Ota)
-
-;; Revision 3.4 2000/8/4 09:41:50	kss
-;; Support new color display functions.
-;; Fixed misalignment offset bug when replacing a string after a shift made.
-;; Set to standard Author/Maintainer heading,
-;; ensure localwords lists are separated from the text by newline. (Dave Love)
-;; Added dictionary definition for Italian (William Deakin)
-;; HTML region skipping greatly improved. (Chuck D. Phillips)
-;; improved menus.  Fixed regexp matching http/email addresses.
-;; one arg always for XEmacs sleep-for (gunnar Evermann)
-;; support for synchronous processes (Eli Zaretskii)
-
-;; Revision 3.3  1999/11/29 11:38:34     kss
-;; Only word replacements entered in from the keyboard are rechecked.
-;; This fixes a bug in tex parsing and misalignment.
-;; Exceptions exist for recursive edit and query-replace, with tex error
-;; condition tested.  Recursive editing improved.
-;; XEmacs repair for when `enable-multibyte-characters' defined - Didier Verna.
-;; ispell-help fixed for XEmacs.  Choices minibuffer now displayed in XEmacs.
-;; Only list valid dictionaries in Spell menu.  Russian dictionary doesn't allow
-;; run-together words, and uses koi8-r font.  Don't skip text in html <TT>
-;; fonts.
-
-;; Revision 3.2  1999/5/7 14:25:14	kss
-;; Accept ispell versions 3.X.Y where X>=1
-;; fine tuned latex region skipping.  Fixed bug in ispell-word that did not
-;; point in right place on words < 2 chars.  Simplified ispell-minor-mode.
-;; Fixed bug in TeX parsing when math commands are in the comments.
-;; Removed calls to `when' macro.
-
-;; Revision 3.1  1998/12/1 13:21:52	kss
-;; Improved and fixed customize support.
-;; Improved and fixed comments in variables and messages.
-;; A coding system is now required for all languages.
-;; casechars improved for castellano, castellano8, and norsk dictionaries.
-;; Dictionary norsk7-tex removed.  Dictionary polish added.
-;; Dictionaries redefined at load-time to support dictionary changes.
-;; Menu redefined at load time to support dictionary changes.
-;; ispell-check-version added as an alias for `check-ispell-version'.
-;; Spelling suggestions returned in order generated by ispell.
-;; Small bug fixed in matching ispell error messages.
-;; Robustness added to ensure `case-fold-search' doesn't get redefined.
-;; Fixed bug that didn't respect case of word in `ispell-complete-word'.
-;; Multibyte character coding support added for process interactions.
-;; Ensure ispell process has terminated before starting new process.
-;;  This can otherwise confuse process filters and hang ispell.
-;; Improved skipping support for SGML.
-;; Fixed bug using ^M rather than \r in `ispell-minor-check'.
-;; Improved message reference matching in `ispell-message'.
-;; Fixed bug in returning to nroff mode from tex mode.
-
 ;;; Compatibility code for XEmacs and (not too) older emacsen:
 (defalias 'ispell-check-minver
   (if (fboundp 'version<=) 'version<=
-- 
2.7.4


[-- Attachment #3: 0003-Assume-we-have-version-for-checking-ispell-version.patch --]
[-- Type: text/x-patch, Size: 3683 bytes --]

From 8cf4109cf660239326e18566ab67a2c5d1d19829 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 00:54:04 +0000
Subject: [PATCH 03/21] Assume we have version<= for checking ispell version

* lisp/textmodes/ispell.el (ispell-check-minver): Remove.
(ispell-check-version): Use version<= directly.
---
 lisp/textmodes/ispell.el | 46 +++++-----------------------------------------
 1 file changed, 5 insertions(+), 41 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 25099e3..14a782d 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -118,42 +118,6 @@
 ;;  Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r)
 ;;    can cause misalignment errors.
 
-;;; Compatibility code for XEmacs and (not too) older emacsen:
-(defalias 'ispell-check-minver
-  (if (fboundp 'version<=) 'version<=
-    (lambda (minver version)
-      "Check if string VERSION is at least string MINVER.
-Both must be in [0-9]+.[0-9]+... format.  This is a fallback
-compatibility function in case `version<=' is not available."
-      (let ((pending t)
-            (return t)
-            start-ver start-mver)
-        ;; Loop until an absolute greater or smaller condition is reached
-        ;; or until no elements are left in any of version and minver. In
-        ;; this case version is exactly the minimal, so return OK.
-        (while pending
-          (let (ver mver)
-            (if (string-match "[0-9]+" version start-ver)
-                (setq start-ver (match-end 0)
-                      ver (string-to-number (match-string 0 version))))
-            (if (string-match "[0-9]+" minver start-mver)
-                (setq start-mver (match-end 0)
-                      mver (string-to-number (match-string 0 minver))))
-
-            (if (or ver mver)
-                (progn
-                  (or ver  (setq ver 0))
-                  (or mver (setq mver 0))
-                  ;; If none of below conditions match, this element is the
-                  ;; same. Go checking next element.
-                  (if (> ver mver)
-                      (setq pending nil)
-                    (if (< ver mver)
-                        (setq pending nil
-                              return nil))))
-              (setq pending nil))))
-        return))))
-
 ;; XEmacs does not have looking-back
 (defalias 'ispell-looking-back
   (if (fboundp 'looking-back) 'looking-back
@@ -829,8 +793,8 @@ ispell-check-version
 	    (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)
+	(if (version<= ispell0-minver ispell-program-version)
+	    (or (version<= ispell-minver ispell-program-version)
 		(setq ispell-offset 0))
 	  (error "%s release %s or greater is required"
 		 ispell-program-name
@@ -838,14 +802,14 @@ ispell-check-version
 
 	(cond
 	 (ispell-really-aspell
-	  (if (ispell-check-minver aspell-minver ispell-really-aspell)
-	      (if (ispell-check-minver aspell8-minver ispell-really-aspell)
+	  (if (version<= aspell-minver ispell-really-aspell)
+	      (if (version<= aspell8-minver ispell-really-aspell)
 		  (progn
 		    (setq ispell-aspell-supports-utf8 t)
 		    (setq ispell-encoding8-command "--encoding=")))
 	    (setq ispell-really-aspell nil)))
 	 (ispell-really-hunspell
-	  (if (ispell-check-minver hunspell8-minver ispell-really-hunspell)
+	  (if (version<= hunspell8-minver ispell-really-hunspell)
 	      (setq ispell-encoding8-command "-i")
 	    (setq ispell-really-hunspell nil))))))
     result))
-- 
2.7.4


[-- Attachment #4: 0004-Remove-unused-ispell-looking-back.patch --]
[-- Type: text/x-patch, Size: 1522 bytes --]

From c5b9cfc88078940a631b2239807d8fb1bfaa7685 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 01:06:26 +0000
Subject: [PATCH 04/21] Remove unused ispell-looking-back

* lisp/textmodes/ispell.el (ispell-looking-back): Remove unused alias.
---
 lisp/textmodes/ispell.el | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 14a782d..554905c 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -118,21 +118,6 @@
 ;;  Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r)
 ;;    can cause misalignment errors.
 
-;; XEmacs does not have looking-back
-(defalias 'ispell-looking-back
-  (if (fboundp 'looking-back) 'looking-back
-    (lambda (regexp &optional limit &rest ignored)
-      "Return non-nil if text before point matches regular expression REGEXP.
-Like `looking-at' except matches before point, and is slower.
-LIMIT if non-nil speeds up the search by specifying a minimum
-starting position, to avoid checking matches that would start
-before LIMIT.
-
-This is a stripped down compatibility function for use when
-full featured `looking-back' function is missing."
-      (save-excursion
-        (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t)))))
-
 ;;; XEmacs21 does not have `with-no-warnings'. Taken from org mode.
 (defmacro ispell-with-no-warnings (&rest body)
   (cons (if (fboundp 'with-no-warnings) 'with-no-warnings 'progn) body))
-- 
2.7.4


[-- Attachment #5: 0005-Remove-tests-for-built-in-functions.patch --]
[-- Type: text/x-patch, Size: 3127 bytes --]

From 8fdca7c7c23eaa83aa470276d19a40d1be3a28a4 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 13:52:04 +0000
Subject: [PATCH 05/21] Remove tests for built-in functions

* lisp/textmodes/ispell.el (buffer-substring-no-properties): Remove
back-up definition.
(ispell-command-loop): Remove test for flyspell-unhighlight-at.
(ispell-add-per-file-word-list): Remove tests for comment-padright and
comment-normalize-vars.
---
 lisp/textmodes/ispell.el | 26 ++++++++------------------
 1 file changed, 8 insertions(+), 18 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 554905c..85661e7 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -132,10 +132,6 @@ ispell
   "User variables for Emacs ispell interface."
   :group 'applications)
 
-(if (not (fboundp 'buffer-substring-no-properties))
-    (defun buffer-substring-no-properties (start end)
-      (buffer-substring start end)))
-
 (defalias 'check-ispell-version 'ispell-check-version)
 
 ;;; **********************************************************************
@@ -2300,15 +2296,13 @@ ispell-command-loop
 		   ((= char ?i)		; accept and insert word into pers dict
 		    (ispell-send-string (concat "*" word "\n"))
 		    (setq ispell-pdict-modified-p '(t)) ; dictionary modified!
-		    (and (fboundp 'flyspell-unhighlight-at)
-			 (flyspell-unhighlight-at start))
+		    (flyspell-unhighlight-at start)
 		    nil)
 		   ((or (= char ?a) (= char ?A)) ; accept word without insert
 		    (ispell-send-string (concat "@" word "\n"))
 		    (cl-pushnew word ispell-buffer-session-localwords
                                 :test #'equal)
-		    (and (fboundp 'flyspell-unhighlight-at)
-			 (flyspell-unhighlight-at start))
+		    (flyspell-unhighlight-at start)
 		    (or ispell-buffer-local-name ; session localwords might conflict
 			(setq ispell-buffer-local-name (buffer-name)))
 		    (if (null ispell-pdict-modified-p)
@@ -4286,16 +4280,12 @@ ispell-add-per-file-word-list
 		    (unless found (newline))
 		    (insert (if comment-start
                                 (concat
-                                  (if (fboundp 'comment-padright)
-                                      ;; Try and use the proper comment marker,
-                                      ;; e.g. ";;" rather than ";".
-				      (progn
-					;; XEmacs: comment-normalize-vars
-					;; (newcomment.el) only in >= 21.5
-					(and (fboundp 'comment-normalize-vars)
-					     (comment-normalize-vars))
-					(comment-padright comment-start
-							  (comment-add nil)))
+                                  (progn
+                                   ;; Try and use the proper comment marker,
+                                   ;; e.g. ";;" rather than ";".
+                                    (comment-normalize-vars)
+                                    (comment-padright comment-start
+                                                      (comment-add nil))
                                     comment-start)
                                   " ")
                               "")
-- 
2.7.4


[-- Attachment #6: 0006-Generalise-over-specific-documentation.patch --]
[-- Type: text/x-patch, Size: 1493 bytes --]

From f06962a566835c8b687b78848ab76d7a35c54eee Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 13:55:31 +0000
Subject: [PATCH 06/21] Generalise over-specific documentation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/textmodes/ispell.el (ispell-personal-dictionary): Rather than
document precise personal wordlist filenames for only two supported
spelling checkers, simply say that the default personal dictionary
depends on the chosen spelling checker.  The user can check the
spelling checker’s documentation if necessary.  This is simpler, and
works for other supported (and future, or unknown) spelling checkers.
---
 lisp/textmodes/ispell.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 85661e7..dc46647 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -349,9 +349,7 @@ ispell-use-framepop-p
 ;;;###autoload
 (defcustom ispell-personal-dictionary nil
   "File name of your personal spelling dictionary, or nil.
-If nil, the default personal dictionary, (\"~/.ispell_DICTNAME\" for ispell or
-\"~/.aspell.LANG.pws\" for Aspell) is used, where DICTNAME is the name of your
-default dictionary and LANG the two letter language code."
+If nil, the default personal dictionary for your spelling checker is used."
   :type '(choice file
 		 (const :tag "default" nil))
   :group 'ispell)
-- 
2.7.4


[-- Attachment #7: 0007-Remove-some-XEmacs-specific-code-from-ispell.el.patch --]
[-- Type: text/x-patch, Size: 4259 bytes --]

From 9f87d8487acfeaea22a3d92c2fe74822bd270e33 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 13:59:59 +0000
Subject: [PATCH 07/21] Remove some XEmacs-specific code from ispell.el

* lisp/textmodes/ispell.el: Remove XEmacs menubar setup.
(ispell-int-char): Remove.
---
 lisp/textmodes/ispell.el | 69 +++++-------------------------------------------
 1 file changed, 6 insertions(+), 63 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index dc46647..0bf6c75 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1466,62 +1466,6 @@ ispell-valid-dictionary-list
       ;;(put 'ispell-region 'menu-enable 'mark-active)
       (fset 'ispell-menu-map (symbol-value 'ispell-menu-map))))
 
-;;; XEmacs versions 19 & 20
-(if (and (featurep 'xemacs)
-	 (featurep 'menubar)
-	 ;;(null ispell-menu-xemacs)
-	 (not (and (boundp 'infodock-version) infodock-version)))
-    (let ((dicts (if (fboundp 'ispell-valid-dictionary-list)
-		     (reverse (ispell-valid-dictionary-list))))
-	  (current-menubar (or current-menubar default-menubar))
-	  (menu
-	   '(["Help"		(describe-function 'ispell-help) t]
-	     ;;["Help"		(popup-menu ispell-help-list)	t]
-	     ["Check Message"	ispell-message			t]
-	     ["Check Buffer"	ispell-buffer			t]
-	     ["Check Comments"	ispell-comments-and-strings	t]
-	     ["Check Word"	ispell-word			t]
-	     ["Check Region"	ispell-region  (or (not zmacs-regions) (mark))]
-	     ["Continue Check"	ispell-continue			t]
-	     ["Complete Word Frag"ispell-complete-word-interior-frag t]
-	     ["Complete Word"	ispell-complete-word		t]
-	     ["Kill Process"	(ispell-kill-ispell nil 'clear) t]
-	     ["Customize..."	(customize-group 'ispell)	t]
-	     ;; flyspell-mode may not be bound...
-	     ;;["flyspell"	flyspell-mode
-	     ;;			:style toggle :selected flyspell-mode ]
-	     "-"
-	     ["Save Personal Dict"(ispell-pdict-save t t)	t]
-	     ["Change Dictionary" ispell-change-dictionary	t])))
-      (if (null dicts)
-	  (setq dicts (cons "default" nil)))
-      (dolist (name dicts)
-	(setq menu (append menu
-			   (list
-			     (vector
-			      (concat "Select " (capitalize name))
-			      (list 'ispell-change-dictionary name)
-			      t)))))
-      (setq ispell-menu-xemacs menu)
-      (if current-menubar
-	  (progn
-	    (if (car (find-menu-item current-menubar '("Cmds")))
-		(progn
-		  ;; XEmacs 21.2
-		  (delete-menu-item '("Cmds" "Spell-Check"))
-		  (add-menu '("Cmds") "Spell-Check" ispell-menu-xemacs))
-	      ;; previous
-	      (delete-menu-item '("Edit" "Spell")) ; in case already defined
-	      (add-menu '("Edit") "Spell" ispell-menu-xemacs))))))
-
-(defalias 'ispell-int-char
-  ;; Allow incrementing characters as integers in XEmacs 20
-  (if (and (featurep 'xemacs)
-	   (fboundp 'int-char))
-      'int-char
-    ;; Emacs and XEmacs 19 or earlier
-    'identity))
-
 
 ;;; **********************************************************************
 
@@ -2230,12 +2174,12 @@ ispell-command-loop
 	;; not so good if there are over 20 or 30 options, but then, if
 	;; there are that many you don't want to scan them all anyway...
 	(while (memq count command-characters) ; skip command characters.
-	  (setq count (ispell-int-char (1+ count))
+	  (setq count (1+ count)
 		skipped (1+ skipped)))
 	(insert "(" count ") " (car choices) "  ")
 	(setq choices (cdr choices)
-	      count (ispell-int-char (1+ count))))
-      (setq count (ispell-int-char (- count ?0 skipped))))
+	      count (1+ count)))
+      (setq count (- count ?0 skipped)))
 
     (run-hooks 'ispell-update-post-hook)
 
@@ -2380,13 +2324,12 @@ ispell-command-loop
 					 (window-width))
 				  (insert "\n"))
 				(while (memq count command-characters)
-				  (setq count (ispell-int-char (1+ count))
+				  (setq count (1+ count)
 					skipped (1+ skipped)))
 				(insert "(" count ") " (car choices) "  ")
 				(setq choices (cdr choices)
-				      count (ispell-int-char (1+ count))))
-			      (setq count (ispell-int-char
-					   (- count ?0 skipped))))
+				      count (1+ count)))
+			      (setq count (- count ?0 skipped)))
 			    (setq textwin (selected-window))
 			    (ispell-show-choices)
 			    (select-window textwin))))
-- 
2.7.4


[-- Attachment #8: 0008-Assume-Emacs-supports-alpha-in-regexps.patch --]
[-- Type: text/x-patch, Size: 4626 bytes --]

From a9032afb7b17f9f6499f91ec098434bcbcd077c7 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:02:48 +0000
Subject: [PATCH 08/21] Assume Emacs supports [:alpha:] in regexps

* lisp/textmodes/ispell.el (ispell-emacs-alpha-regexp): Remove.
(ispell-set-spellchecker-params): Remove tests of
ispell-emacs-alpha-regexp.
---
 lisp/textmodes/ispell.el | 55 +++++++++++++++++++-----------------------------
 1 file changed, 22 insertions(+), 33 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 0bf6c75..2e59414 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -666,12 +666,6 @@ ispell-dicts-name2locale-equivs-alist
   "Alist with known matching locales for standard dict names in
   `ispell-dictionary-base-alist'.")
 
-(defvar ispell-emacs-alpha-regexp
-  (if (string-match "^[[:alpha:]]+$" "abcde")
-      "[[:alpha:]]"
-    nil)
-  "[[:alpha:]] if Emacs supports [:alpha:] regexp, nil
-otherwise (current XEmacs does not support it).")
 
 ;;; **********************************************************************
 ;;; The following are used by ispell, and should not be changed.
@@ -1244,11 +1238,9 @@ ispell-set-spellchecker-params
 		   (setq ispell-library-directory (ispell-check-version))
 		   t)
 	       (error nil))
-	     ispell-encoding8-command
-	     ispell-emacs-alpha-regexp)
+	     ispell-encoding8-command)
 	;; auto-detection will only be used if spellchecker is not
-	;; ispell, supports a way  to set communication to UTF-8 and
-	;; Emacs flavor supports [:alpha:]
+	;; ispell and supports a way to set communication to UTF-8.
 	(if ispell-really-aspell
 	    (or ispell-aspell-dictionary-alist
 		(ispell-find-aspell-dictionaries))
@@ -1262,9 +1254,8 @@ ispell-set-spellchecker-params
     ;; installed dictionaries and add to it elements of the original
     ;; list that are not present there. Allow distro info.
     (let ((found-dicts-alist
-	   (if (and ispell-encoding8-command
-		    ispell-emacs-alpha-regexp)
-	       (if ispell-really-aspell
+	   (if ispell-encoding8-command
+               (if ispell-really-aspell
 		   ispell-aspell-dictionary-alist
 		 (if ispell-really-hunspell
 		     ispell-hunspell-dictionary-alist))
@@ -1331,28 +1322,26 @@ ispell-set-spellchecker-params
 	  (push dict all-dicts-alist)))
       (setq ispell-dictionary-alist all-dicts-alist))
 
-    ;; If Emacs flavor supports [:alpha:] use it for global dicts.  If
-    ;; spellchecker also supports UTF-8 via command-line option use it
+    ;; If spellchecker supports UTF-8 via command-line option, use it
     ;; in communication.  This does not affect definitions in your
     ;; init file.
-    (if ispell-emacs-alpha-regexp
-     	(let (tmp-dicts-alist)
-    	  (dolist (adict ispell-dictionary-alist)
-	    (cl-pushnew (if (cadr adict) ;; Do not touch hunspell uninitialized entries
-                            (list
-                             (nth 0 adict)   ; dict name
-                             "[[:alpha:]]"   ; casechars
-                             "[^[:alpha:]]"  ; not-casechars
-                             (nth 3 adict)   ; otherchars
-                             (nth 4 adict)   ; many-otherchars-p
-                             (nth 5 adict)   ; ispell-args
-                             (nth 6 adict)   ; extended-character-mode
-                             (if ispell-encoding8-command
-                                 'utf-8
-                               (nth 7 adict)))
-                          adict)
-                        tmp-dicts-alist :test #'equal))
-	  (setq ispell-dictionary-alist tmp-dicts-alist)))))
+    (let (tmp-dicts-alist)
+      (dolist (adict ispell-dictionary-alist)
+        (cl-pushnew (if (cadr adict) ;; Do not touch hunspell uninitialized entries
+                        (list
+                         (nth 0 adict)   ; dict name
+                         "[[:alpha:]]"   ; casechars
+                         "[^[:alpha:]]"  ; not-casechars
+                         (nth 3 adict)   ; otherchars
+                         (nth 4 adict)   ; many-otherchars-p
+                         (nth 5 adict)   ; ispell-args
+                         (nth 6 adict)   ; extended-character-mode
+                         (if ispell-encoding8-command
+                             'utf-8
+                           (nth 7 adict)))
+                      adict)
+                    tmp-dicts-alist :test #'equal))
+      (setq ispell-dictionary-alist tmp-dicts-alist))))
 
 (defun ispell-valid-dictionary-list ()
   "Return a list of valid dictionaries.
-- 
2.7.4


[-- Attachment #9: 0009-Remove-XEmacs-and-old-Emacs-highlighting-code.patch --]
[-- Type: text/x-patch, Size: 2096 bytes --]

From 01f7558b203c4aad9e566d0be871129b422a244e Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:05:07 +0000
Subject: [PATCH 09/21] Remove XEmacs and old Emacs highlighting code

* lisp/textmodes/ispell.el
(ispell-highlight-spelling-error-xemacs): Remove.
(ispell-highlight-spelling-error): Assume display-color-p exists.
---
 lisp/textmodes/ispell.el | 22 +++-------------------
 1 file changed, 3 insertions(+), 19 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 2e59414..84b7141 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2631,17 +2631,6 @@ ispell-highlight-spelling-error-generic
 	  (if (eq 'block refresh) start (- start 2)) end t))))
 
 
-(defun ispell-highlight-spelling-error-xemacs (start end &optional highlight)
-  "Highlight the word from START to END using `isearch-highlight'.
-When the optional third arg HIGHLIGHT is set, the word is highlighted,
-otherwise it is displayed normally."
-  (if highlight
-      (isearch-highlight start end)
-    (isearch-dehighlight))
-  ;;(sit-for 0)
-  )
-
-
 (defun ispell-highlight-spelling-error-overlay (start end &optional highlight)
   "Highlight the word from START to END using overlays.
 When the optional third arg HIGHLIGHT is set, the word is highlighted
@@ -2677,14 +2666,9 @@ ispell-highlight-spelling-error-overlay
 
 
 (defun ispell-highlight-spelling-error (start end &optional highlight refresh)
-  (cond
-   ((featurep 'xemacs)
-    (ispell-highlight-spelling-error-xemacs start end highlight))
-   ((and (featurep 'faces)
-	 (or (and (fboundp 'display-color-p) (display-color-p))
-	     window-system))
-    (ispell-highlight-spelling-error-overlay start end highlight))
-   (t (ispell-highlight-spelling-error-generic start end highlight refresh))))
+  (if (display-color-p)
+      (ispell-highlight-spelling-error-overlay start end highlight)
+    (ispell-highlight-spelling-error-generic start end highlight refresh)))
 
 (defun ispell-display-buffer (buffer)
   "Show BUFFER in new window above selected one.
-- 
2.7.4


[-- Attachment #10: 0010-Remove-some-commented-out-code.patch --]
[-- Type: text/x-patch, Size: 1373 bytes --]

From d90f4bdfb5ab6a822ac828bcf5d7c4bc84e61e1b Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:15:50 +0000
Subject: [PATCH 10/21] Remove some commented-out code

lisp/textmodes/ispell.el (ispell-process)
ispell-valid-dictionary-list): Remove commented-out code.
---
 lisp/textmodes/ispell.el | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 84b7141..64ca428 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -860,11 +860,7 @@ ispell-process
 
 (defvar ispell-async-processp (and (fboundp 'delete-process)
 				   (fboundp 'process-send-string)
-				   (fboundp 'accept-process-output)
-				   ;;(fboundp 'make-process)
-				   ;;(fboundp 'set-process-filter)
-				   ;;(fboundp 'process-kill-without-query)
-				   )
+				   (fboundp 'accept-process-output))
   "Non-nil means that the OS supports asynchronous processes.")
 
 ;; Make ispell.el work better with aspell.
@@ -1452,7 +1448,6 @@ ispell-valid-dictionary-list
       (define-key ispell-menu-map [ispell-buffer]
 	`(menu-item ,(purecopy "Spell-Check Buffer") ispell-buffer
 		    :help ,(purecopy "Check spelling of selected buffer")))
-      ;;(put 'ispell-region 'menu-enable 'mark-active)
       (fset 'ispell-menu-map (symbol-value 'ispell-menu-map))))
 
 
-- 
2.7.4


[-- Attachment #11: 0011-Remove-XEmacs-specific-code-from-ispell.el.patch --]
[-- Type: text/x-patch, Size: 5171 bytes --]

From e9ab68711c988d9fdfba7d5ec97c3e0ea50efd86 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:19:26 +0000
Subject: [PATCH 11/21] Remove XEmacs-specific code from ispell.el

* lisp/textmodes/ispell.el (ispell-menu-xemacs): Remove
(ispell-menu-map-needed): Remove XEmacs-specific check.
(ispell-word): Remove XEmacs-specific extent code.
(ispell-init-process): Remove XEmacs workaround for local add-hook.
Assume we have set-process-query-on-exit-flag.
(ispell-kill-ispell, ispell-change-dictionary): Remove XEmacs
workaround for called-interactively-p.
---
 lisp/textmodes/ispell.el | 55 +++++++++---------------------------------------
 1 file changed, 10 insertions(+), 45 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 64ca428..25afb3d 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -833,22 +833,10 @@ ispell-menu-map
 ;; Redo menu when loading ispell to get dictionary modifications
 (setq ispell-menu-map nil)
 
-;;;###autoload
-(defvar ispell-menu-xemacs nil
-  "Spelling menu for XEmacs.
-If nil when package is loaded, a standard menu will be set,
-and added as a submenu of the \"Edit\" menu.")
-
-;; Break out XEmacs menu and split into several calls to avoid having
-;; long lines in loaddefs.el.  Detect need off following constant.
-
 ;;; Set up dictionary
 ;;;###autoload
 (defvar ispell-menu-map-needed
-  ;; only needed when not version 18 and not XEmacs.
-  (and (not ispell-menu-map)
-       (not (featurep 'xemacs))
-       'reload))
+  (unless ispell-menu-map 'reload))
 
 (defvar ispell-library-directory (condition-case ()
 				     (ispell-check-version)
@@ -1932,32 +1920,20 @@ ispell-word
       (cond ((eq poss t)
 	     (or quietly
 		 (message "%s is correct"
-			  (funcall ispell-format-word-function word)))
-	     (and (featurep 'xemacs)
-		  (extent-at start)
-		  (and (fboundp 'delete-extent)
-		       (delete-extent (extent-at start)))))
+			  (funcall ispell-format-word-function word))))
 	    ((stringp poss)
 	     (or quietly
 		 (message "%s is correct because of root %s"
 			  (funcall ispell-format-word-function word)
-			  (funcall ispell-format-word-function poss)))
-	     (and (featurep 'xemacs)
-		  (extent-at start)
-		  (and (fboundp 'delete-extent)
-		       (delete-extent (extent-at start)))))
+			  (funcall ispell-format-word-function poss))))
 	    ((null poss)
 	     (message "Error checking word %s using %s with %s dictionary"
 		      (funcall ispell-format-word-function word)
 		      (file-name-nondirectory ispell-program-name)
 		      (or ispell-current-dictionary "default")))
 	    (ispell-check-only	      ; called from ispell minor mode.
-	     (if (fboundp 'make-extent)
-		 (if (fboundp 'set-extent-property)
-		     (let ((ext (make-extent start end)))
-		       (set-extent-property ext 'face ispell-highlight-face)
-		       (set-extent-property ext 'priority 2000)))
-	       (beep)
+	     (progn
+               (beep)
 	       (message "%s is incorrect"
                         (funcall ispell-format-word-function word))))
 	    (t				; prompt for correct word.
@@ -2888,10 +2864,7 @@ ispell-init-process
 		;; to avoid over and over ispell kill.
 		(window-buffer (minibuffer-selected-window))
 	      (current-buffer))
-	  ;; 'local does not automatically make hook buffer-local in XEmacs.
-	  (if (featurep 'xemacs)
-	      (make-local-hook 'kill-buffer-hook))
-	  (add-hook 'kill-buffer-hook
+          (add-hook 'kill-buffer-hook
 		    (lambda () (ispell-kill-ispell t)) nil 'local)))
 
       (if ispell-async-processp
@@ -2936,12 +2909,8 @@ ispell-init-process
       (let ((extended-char-mode (ispell-get-extended-character-mode)))
 	(if extended-char-mode		; ~ extended character mode
 	    (ispell-send-string (concat extended-char-mode "\n"))))
-      (if ispell-async-processp
-	  (if (featurep 'emacs)
-	      (set-process-query-on-exit-flag ispell-process nil)
-	    (if (fboundp 'set-process-query-on-exit-flag)
-		(set-process-query-on-exit-flag ispell-process nil)
-	      (process-kill-without-query ispell-process)))))))
+      (when ispell-async-processp
+        (set-process-query-on-exit-flag ispell-process nil)))))
 
 ;;;###autoload
 (defun ispell-kill-ispell (&optional no-error clear)
@@ -2953,9 +2922,7 @@ ispell-kill-ispell
   ;; to optimize the common cases.
   (run-hooks 'ispell-kill-ispell-hook)
   (if (or clear
-	  (if (featurep 'xemacs)
-	      (interactive-p)
-	    (called-interactively-p 'interactive)))
+	  (called-interactively-p 'interactive))
       (setq ispell-buffer-session-localwords nil))
   (if (not (and ispell-process
 		(eq (ispell-process-status) 'run)))
@@ -3004,9 +2971,7 @@ ispell-change-dictionary
 	 ;; Specified dictionary is the default already. Could reload
 	 ;; the dictionaries if needed.
 	 (ispell-internal-change-dictionary)
-	 (and (if (featurep 'xemacs)
-		  (interactive-p)
-		(called-interactively-p 'interactive))
+	 (when (called-interactively-p 'interactive)
 	      (message "No change, using %s dictionary" dict)))
 	(t				; reset dictionary!
 	 (if (or (assoc dict ispell-local-dictionary-alist)
-- 
2.7.4


[-- Attachment #12: 0012-Remove-XEmacs-specific-code-dealing-with-enable-mult.patch --]
[-- Type: text/x-patch, Size: 2152 bytes --]

From 672d7629625e046802a80e591f7d4c994ce5da91 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:35:42 +0000
Subject: [PATCH 12/21] Remove XEmacs-specific code dealing with
 enable-multibyte-characters

* lisp/textmodes/ispell.el (ispell-decode-string):
(ispell-init-process):  Remove XEmacs-specific guard.
---
 lisp/textmodes/ispell.el | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 25afb3d..568b8a2 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1451,17 +1451,8 @@ ispell-current-personal-dictionary
 This is passed to the Ispell process using the `-p' switch.")
 
 (defun ispell-decode-string (str)
-  "Decodes multibyte character strings.
-Protects against bogus binding of `enable-multibyte-characters' in XEmacs."
-  ;; FIXME: enable-multibyte-characters is read-only, so bogus bindings are
-  ;; really nasty (they signal an error in Emacs): Who does that?  --Stef
-  (if (and (or (featurep 'xemacs)
-	       (and (boundp 'enable-multibyte-characters)
-		    enable-multibyte-characters))
-	   (fboundp 'decode-coding-string)
-	   (ispell-get-coding-system))
-      (decode-coding-string str (ispell-get-coding-system))
-    str))
+  "Decodes multibyte character strings."
+  (decode-coding-string str (ispell-get-coding-system)))
 
 ;; Return a string decoded from Nth element of the current dictionary.
 (defun ispell-get-decoded-string (n)
@@ -2869,11 +2860,7 @@ ispell-init-process
 
       (if ispell-async-processp
 	  (set-process-filter ispell-process 'ispell-filter))
-      ;; Protect against XEmacs bogus binding of `enable-multibyte-characters'.
-      (if (and (or (featurep 'xemacs)
-		   (and (boundp 'enable-multibyte-characters)
-			enable-multibyte-characters))
-	       (fboundp 'set-process-coding-system)
+      (if (and enable-multibyte-characters
                ;; Evidently, some people use the synchronous mode even
                ;; when async subprocesses are supported, in which case
                ;; set-process-coding-system is bound, but
-- 
2.7.4


[-- Attachment #13: 0013-Remove-XEmacs-specific-horizontal-scrollbar-handling.patch --]
[-- Type: text/x-patch, Size: 1357 bytes --]

From 8732725bae456398d4cf2d5e5e336cbe2a9d63de Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:37:37 +0000
Subject: [PATCH 13/21] Remove XEmacs-specific horizontal scrollbar handling in
 ispell.el

* lisp/textmodes/ispell.el (ispell-command-loop): Remove
XEmacs-specific code.
---
 lisp/textmodes/ispell.el | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 568b8a2..f7dac11 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2094,15 +2094,9 @@ ispell-command-loop
              "--  %b  --  word: " word
              "  --  dict: " (or ispell-current-dictionary "default")
              "  --  prog: " (file-name-nondirectory ispell-program-name)))
-      ;; XEmacs: no need for horizontal scrollbar in choices window
+      ;; No need for horizontal scrollbar in choices window
       (ispell-with-no-warnings
-       (and (fboundp 'set-specifier)
-	    (boundp 'horizontal-scrollbar-visible-p)
-	    (set-specifier horizontal-scrollbar-visible-p nil
-			   (cons (current-buffer) nil))))
-      (ispell-with-no-warnings
-       (and (boundp 'horizontal-scroll-bar)
-	    (setq horizontal-scroll-bar nil)))
+       (setq horizontal-scroll-bar nil))
       (erase-buffer)
       (if guess
 	  (progn
-- 
2.7.4


[-- Attachment #14: 0014-Remove-XEmacs-specific-minibuffer-handling-code-from.patch --]
[-- Type: text/x-patch, Size: 2216 bytes --]

From 29b7791c658166847f426d3b703ca0d06344e669 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:38:51 +0000
Subject: [PATCH 14/21] Remove XEmacs-specific minibuffer handling code from
 ispell.el

* lisp/textmodes/ispell.el (ispell-init-process): Assume we are not in
XEmacs.
---
 lisp/textmodes/ispell.el | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index f7dac11..7b932d1 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2792,7 +2792,7 @@ ispell-init-process
 	 (current-ispell-directory default-directory) ;FIXME: Unused?
 	 ;; The default directory for the process.
 	 ;; Use "~/" as default-directory unless using Ispell with per-dir
-	 ;; personal dictionaries and not in a minibuffer under XEmacs
+	 ;; personal dictionaries
 	 (default-directory
 	   (if (or ispell-really-aspell
 		   ispell-really-hunspell
@@ -2805,9 +2805,8 @@ ispell-init-process
 						     ".ispell_"
 						     (or dict-bname
 							 "default")))))
-		   ;; Ispell, in a minibuffer, and XEmacs
-		   (and (window-minibuffer-p)
-			(not (fboundp 'minibuffer-selected-window))))
+		   ;; Ispell, in a minibuffer
+		   (window-minibuffer-p))
 	       (expand-file-name "~/")
 	     (expand-file-name default-directory))))
     ;; Check if process needs restart
@@ -2839,12 +2838,11 @@ ispell-init-process
 
       (unless (equal ispell-process-directory (expand-file-name "~/"))
 	;; At this point, `ispell-process-directory' will be "~/" unless using
-	;; Ispell with directory-specific dicts and not in XEmacs minibuffer.
+	;; Ispell with directory-specific dicts.
 	;; If not, kill ispell process when killing buffer.  It may be in a
 	;; removable device that would otherwise become un-mountable.
 	(with-current-buffer
-	    (if (and (window-minibuffer-p)                  ;; In minibuffer
-		     (fboundp 'minibuffer-selected-window)) ;; Not XEmacs.
+	    (if (window-minibuffer-p)                  ;; In minibuffer
 		;; In this case kill ispell only when parent buffer is killed
 		;; to avoid over and over ispell kill.
 		(window-buffer (minibuffer-selected-window))
-- 
2.7.4


[-- Attachment #15: 0015-Remove-remaining-mentions-of-XEmacs-from-ispell.el.patch --]
[-- Type: text/x-patch, Size: 1465 bytes --]

From 54f32a6527346782f0fa6afa2005d93e788a5eb7 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:39:42 +0000
Subject: [PATCH 15/21] Remove remaining mentions of XEmacs from ispell.el

* lisp/textmodes/ispell.el (ispell-valid-dictionary-list):
(ispell-add-per-file-word-list): Remove mentions of XEmacs from
comments.
---
 lisp/textmodes/ispell.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 7b932d1..097fd4d 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1331,8 +1331,7 @@ ispell-valid-dictionary-list
   "Return a list of valid dictionaries.
 The variable `ispell-library-directory' defines their location."
   ;; Initialize variables and dictionaries alists for desired spellchecker.
-  ;; Make sure ispell.el is loaded to avoid some autoload loops in XEmacs
-  ;; (and may be others)
+  ;; Make sure ispell.el is loaded to avoid some autoload loops.
   (if (featurep 'ispell)
       (ispell-set-spellchecker-params))
 
@@ -4187,6 +4186,6 @@ ispell-add-per-file-word-list
 ; LocalWords:  minipage pers dict unhighlight buf grep sync prev inc
 ; LocalWords:  fn oldot NB AIX msg init read's bufs pt cmd Quinlan eg
 ; LocalWords:  uuencoded unidiff sc nn VM SGML eval IspellPersDict
-; LocalWords:  lns XEmacs HTML casechars Multibyte
+; LocalWords:  lns HTML casechars Multibyte
 
 ;;; ispell.el ends here
-- 
2.7.4


[-- Attachment #16: 0016-Remove-support-for-old-versions-of-supercite-and-GNU.patch --]
[-- Type: text/x-patch, Size: 1484 bytes --]

From 2605df9188a45b245373a9fe576ed13b18dd23cd Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 19:20:19 +0000
Subject: [PATCH 16/21] Remove support for old versions of supercite and GNUS
 from ispell.el

* lisp/textmodes/ispell.el (ispell-message): Require supercite >= 3.0
and GNUS >= 5.  Not exactly the bleeding edge!
---
 lisp/textmodes/ispell.el | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 097fd4d..8093228 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -3864,16 +3864,11 @@ ispell-message
 	       "   \\|\t"))
 	   (cite-regexp			;Prefix of quoted text
 	    (cond
-	     ((functionp 'sc-cite-regexp)	; sc 3.0
+	     ((functionp 'sc-cite-regexp)	; supercite >= 3.0
 	      (ispell-with-no-warnings
 	       (concat "\\(" (sc-cite-regexp) "\\)" "\\|"
 		       (ispell-non-empty-string sc-reference-tag-string))))
-	     ((boundp 'sc-cite-regexp)		; sc 2.3
-	      (concat "\\(" sc-cite-regexp "\\)" "\\|"
-		      (ispell-with-no-warnings
-		       (ispell-non-empty-string sc-reference-tag-string))))
-	     ((or (equal major-mode 'news-reply-mode) ;GNUS 4 & below
-		  (equal major-mode 'message-mode))   ;GNUS 5
+	     ((equal major-mode 'message-mode)  ; GNUS >= 5
 	      (concat "In article <" "\\|"
 		      "[^,;&+=\n]+ <[^,;&+=]+> writes:" "\\|"
 		      (ispell-with-no-warnings message-cite-prefix-regexp)
-- 
2.7.4


[-- Attachment #17: 0017-Remove-unused-constant.patch --]
[-- Type: text/x-patch, Size: 924 bytes --]

From 00c1bd1eea383be7791862221ca9798e5d51d7f7 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 21:47:02 +0000
Subject: [PATCH 17/21] Remove unused constant

* lisp/textmodes/ispell.el (ispell-required-version): Remove.
---
 lisp/textmodes/ispell.el | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 8093228..d1001cd 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -673,10 +673,6 @@ ispell-dicts-name2locale-equivs-alist
 
 
 
-;; The version must be 3.1 or greater for this version of ispell.el
-;; There is an incompatibility between version 3.1.12 and lower versions.
-(defconst ispell-required-version '(3 1 12)
-  "Ispell versions with which this version of ispell.el is known to work.")
 (defvar ispell-offset -1
   "Offset that maps protocol differences between ispell 3.1 versions.")
 
-- 
2.7.4


[-- Attachment #18: 0018-Remove-support-for-ispell-3.1.12.patch --]
[-- Type: text/x-patch, Size: 1795 bytes --]

From 155e9e2bbf9b82ad597e31729922966bbddffed5 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 21:50:18 +0000
Subject: [PATCH 18/21] Remove support for ispell < 3.1.12

* lisp/textmodes/ispell.el (ispell-offset): Remove.
(ispell-check-version): Require ispell >= 3.1.12, released in 1994.
(ispell-process-line): No longer use ispell-offset.
---
 lisp/textmodes/ispell.el | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index d1001cd..724ce3d 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -673,9 +673,6 @@ ispell-dicts-name2locale-equivs-alist
 
 
 
-(defvar ispell-offset -1
-  "Offset that maps protocol differences between ispell 3.1 versions.")
-
 (defconst ispell-version "ispell.el 3.6 - 7-Jan-2003")
 
 
@@ -758,13 +755,10 @@ ispell-check-version
 
       (let ((aspell-minver    "0.50")
 	    (aspell8-minver   "0.60")
-	    (ispell0-minver   "3.1.0")
 	    (ispell-minver    "3.1.12")
 	    (hunspell8-minver "1.1.6"))
 
-	(if (version<= ispell0-minver ispell-program-version)
-	    (or (version<= ispell-minver ispell-program-version)
-		(setq ispell-offset 0))
+	(unless (version<= ispell-minver ispell-program-version)
 	  (error "%s release %s or greater is required"
 		 ispell-program-name
 		 ispell-minver))
@@ -3358,7 +3352,7 @@ ispell-process-line
 	  ;; Markers can move with highlighting!  This destroys
 	  ;; end of region markers line-end and ispell-region-end
 	  (let ((word-start
-		 (copy-marker (+ ispell-start ispell-offset (car (cdr poss)))))
+		 (copy-marker (+ ispell-start (car (cdr poss)))))
 		(word-len (length (car poss)))
 		(line-end (copy-marker ispell-end))
 		(line-start (copy-marker ispell-start))
-- 
2.7.4


[-- Attachment #19: 0019-Remove-boundp-test-for-always-bound-symbol.patch --]
[-- Type: text/x-patch, Size: 1134 bytes --]

From 04918d868b1c7accf57a74129c1edebadcf1e636 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 21:55:19 +0000
Subject: [PATCH 19/21] Remove boundp test for always-bound symbol
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/textmodes/ispell.el (ispell-message): mail-yank-prefix is
defvar’d at the top of the file, so remove a test to see if it is
bound.
---
 lisp/textmodes/ispell.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 724ce3d..c733332 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -3849,8 +3849,7 @@ ispell-message
 		       (point-max)))
 		    (t (min (point-max) (funcall ispell-message-text-end))))))
 	   (default-prefix   ; Vanilla cite prefix (just used for cite-regexp)
-	     (if (and (boundp 'mail-yank-prefix) mail-yank-prefix)
-		 (ispell-non-empty-string mail-yank-prefix)
+	     (if (ispell-non-empty-string mail-yank-prefix)
 	       "   \\|\t"))
 	   (cite-regexp			;Prefix of quoted text
 	    (cond
-- 
2.7.4


[-- Attachment #20: 0020-Remove-meaningless-defconst-ispell-version.patch --]
[-- Type: text/x-patch, Size: 1972 bytes --]

From 4383a2b1209071b2394bbc51c2ca35b7d00afed4 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 21:58:00 +0000
Subject: [PATCH 20/21] Remove meaningless defconst ispell-version
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/textmodes/ispell.el (ispell-version): Since ispell.el is now
firmly part of Emacs, and the version hasn’t changed since 2003, and
isn’t used anywhere, remove it.  3rd-party code can better use the
Emacs version, or feature or function checks.
(ispell-check-version): No longer report ispell.el version.
---
 lisp/textmodes/ispell.el | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index c733332..9bd43cc 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -671,11 +671,6 @@ ispell-dicts-name2locale-equivs-alist
 ;;; The following are used by ispell, and should not be changed.
 ;;; **********************************************************************
 
-
-
-(defconst ispell-version "ispell.el 3.6 - 7-Jan-2003")
-
-
 (defun ispell-check-version (&optional interactivep)
   "Ensure that `ispell-program-name' is valid and has the correct version.
 Returns version number if called interactively.
@@ -710,13 +705,11 @@ ispell-check-version
 		      (if (string-match "\\`aspell" speller) "-v" "-vv"))))
       (goto-char (point-min))
       (if interactivep
-	  ;; Report version information of ispell and ispell.el
+	  ;; Report version information of ispell
 	  (progn
 	    (end-of-line)
-	    (setq result (concat (buffer-substring-no-properties (point-min)
-								 (point))
-				 ", "
-				 ispell-version))
+	    (setq result (buffer-substring-no-properties (point-min)
+                                                         (point)))
 	    (message "%s" result))
 	;; return LIBDIR or LIBRARYVAR (overrides LIBDIR) env.
 	(progn
-- 
2.7.4


[-- Attachment #21: 0021-Remove-XEmacs-specific-ispell-with-no-warnings.patch --]
[-- Type: text/x-patch, Size: 2382 bytes --]

From c4d53a843efb30862a48869ecc9f83e0d689266b Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 22:01:56 +0000
Subject: [PATCH 21/21] Remove XEmacs-specific ispell-with-no-warnings

* lisp/textmodes/ispell.el (ispell-with-no-warnings): Remove this
defmacro, needed only for XEmacs.
(ispell-command-loop, ispell-message): Use with-no-warnings directly.
---
 lisp/textmodes/ispell.el | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 9bd43cc..eb7f017 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -118,10 +118,6 @@
 ;;  Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r)
 ;;    can cause misalignment errors.
 
-;;; XEmacs21 does not have `with-no-warnings'. Taken from org mode.
-(defmacro ispell-with-no-warnings (&rest body)
-  (cons (if (fboundp 'with-no-warnings) 'with-no-warnings 'progn) body))
-
 ;;; Code:
 
 (eval-when-compile (require 'cl-lib))
@@ -2077,7 +2073,7 @@ ispell-command-loop
              "  --  dict: " (or ispell-current-dictionary "default")
              "  --  prog: " (file-name-nondirectory ispell-program-name)))
       ;; No need for horizontal scrollbar in choices window
-      (ispell-with-no-warnings
+      (with-no-warnings
        (setq horizontal-scroll-bar nil))
       (erase-buffer)
       (if guess
@@ -3847,18 +3843,18 @@ ispell-message
 	   (cite-regexp			;Prefix of quoted text
 	    (cond
 	     ((functionp 'sc-cite-regexp)	; supercite >= 3.0
-	      (ispell-with-no-warnings
+	      (with-no-warnings
 	       (concat "\\(" (sc-cite-regexp) "\\)" "\\|"
 		       (ispell-non-empty-string sc-reference-tag-string))))
 	     ((equal major-mode 'message-mode)  ; GNUS >= 5
 	      (concat "In article <" "\\|"
 		      "[^,;&+=\n]+ <[^,;&+=]+> writes:" "\\|"
-		      (ispell-with-no-warnings message-cite-prefix-regexp)
+		      (with-no-warnings message-cite-prefix-regexp)
 		      "\\|"
 		      default-prefix))
 	     ((equal major-mode 'mh-letter-mode) ; mh mail message
 	      (concat "[^,;&+=\n]+ writes:" "\\|"
-		      (ispell-with-no-warnings
+		      (with-no-warnings
 		       (ispell-non-empty-string mh-ins-buf-prefix))))
 	     ((not internal-messagep)	; Assume nn sent us this message.
 	      (concat "In [a-zA-Z.]+ you write:" "\\|"
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* bug#25107: Acknowledgement (Patches to clean up ispell.el)
  2016-12-04 22:11   ` bug#25107: Acknowledgement (Patches to clean up ispell.el) Reuben Thomas
@ 2016-12-05 21:38     ` Reuben Thomas
  2016-12-06 15:51       ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Reuben Thomas @ 2016-12-05 21:38 UTC (permalink / raw)
  To: 25107


[-- Attachment #1.1: Type: text/plain, Size: 159 bytes --]

​Attached, ​an updated patch set which fixes a couple of bugs I found, and
adds one more patch to remove an unused variable.

-- 
http://rrt.sc3d.org

[-- Attachment #1.2: Type: text/html, Size: 456 bytes --]

[-- Attachment #2: 0002-Remove-ispell.el-pre-GNU-Emacs-comments.patch --]
[-- Type: text/x-patch, Size: 5307 bytes --]

From b56abdb7d7ee1ada16194dc86bb0fd88f5712dd7 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 00:49:35 +0000
Subject: [PATCH 02/23] Remove ispell.el pre-GNU Emacs comments

* lisp/textmodes/ispell.el (Commentary): Remove original maintainer
  details, as Emacs version, bug report address and so forth should be
  used instead for this version.  Remove in-line change history; use
  git instead.
---
 lisp/textmodes/ispell.el | 77 ------------------------------------------------
 1 file changed, 77 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 5d5d422..25099e3 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -3,12 +3,7 @@
 ;; Copyright (C) 1994-1995, 1997-2016 Free Software Foundation, Inc.
 
 ;; Author:           Ken Stevens <k.stevens@ieee.org>
-;; Maintainer:       Ken Stevens <k.stevens@ieee.org>
-;; Stevens Mod Date: Mon Jan  7 12:32:44 PST 2003
-;; Stevens Revision: 3.6
 ;; Status          : Release with 3.1.12+ and 3.2.0+ ispell.
-;; Bug Reports     : ispell-el-bugs@itcorp.com
-;; Web Site        : http://kdstevens.com/~stevens/ispell-page.html
 ;; Keywords: unix wp
 
 ;; This file is part of GNU Emacs.
@@ -123,78 +118,6 @@
 ;;  Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r)
 ;;    can cause misalignment errors.
 
-;; HISTORY
-
-;; Modifications made in latest versions:
-
-;; Revision 3.6 2003/01/07 12:32:44	kss
-;; Removed extra -d LIB in dictionary defs. (Pavel Janik)
-;; Filtered process calls with duplicate dictionary entries.
-;; Fixed bug where message-text-end is inside a mime skipped region.
-;; Minor fixes to get ispell menus right in XEmacs
-;; Fixed skip regexp so it doesn't match stuff like `/.\w'.
-;; Detecting dictionary change not working.  Fixed.  kss
-;; function `ispell-change-dictionary' now only completes valid dicts.
-
-;; Revision 3.5 2001/7/11 18:43:57	kss
-;; Added fix for aspell to work in XEmacs (ispell-check-version).
-;; Added Portuguese dictionary definition.
-;; New feature: MIME mail message support, Fcc support.
-;; Bug fix: retain comment syntax on lines with region skipping. (TeX $ bug...)
-;; Improved allocation for graphic mode lines.  (Miles Bader)
-;; Support -v flag for old versions of aspell.  (Eli Zaretskii)
-;; Clear minibuffer on ^G from ispell-help (Tak Ota)
-
-;; Revision 3.4 2000/8/4 09:41:50	kss
-;; Support new color display functions.
-;; Fixed misalignment offset bug when replacing a string after a shift made.
-;; Set to standard Author/Maintainer heading,
-;; ensure localwords lists are separated from the text by newline. (Dave Love)
-;; Added dictionary definition for Italian (William Deakin)
-;; HTML region skipping greatly improved. (Chuck D. Phillips)
-;; improved menus.  Fixed regexp matching http/email addresses.
-;; one arg always for XEmacs sleep-for (gunnar Evermann)
-;; support for synchronous processes (Eli Zaretskii)
-
-;; Revision 3.3  1999/11/29 11:38:34     kss
-;; Only word replacements entered in from the keyboard are rechecked.
-;; This fixes a bug in tex parsing and misalignment.
-;; Exceptions exist for recursive edit and query-replace, with tex error
-;; condition tested.  Recursive editing improved.
-;; XEmacs repair for when `enable-multibyte-characters' defined - Didier Verna.
-;; ispell-help fixed for XEmacs.  Choices minibuffer now displayed in XEmacs.
-;; Only list valid dictionaries in Spell menu.  Russian dictionary doesn't allow
-;; run-together words, and uses koi8-r font.  Don't skip text in html <TT>
-;; fonts.
-
-;; Revision 3.2  1999/5/7 14:25:14	kss
-;; Accept ispell versions 3.X.Y where X>=1
-;; fine tuned latex region skipping.  Fixed bug in ispell-word that did not
-;; point in right place on words < 2 chars.  Simplified ispell-minor-mode.
-;; Fixed bug in TeX parsing when math commands are in the comments.
-;; Removed calls to `when' macro.
-
-;; Revision 3.1  1998/12/1 13:21:52	kss
-;; Improved and fixed customize support.
-;; Improved and fixed comments in variables and messages.
-;; A coding system is now required for all languages.
-;; casechars improved for castellano, castellano8, and norsk dictionaries.
-;; Dictionary norsk7-tex removed.  Dictionary polish added.
-;; Dictionaries redefined at load-time to support dictionary changes.
-;; Menu redefined at load time to support dictionary changes.
-;; ispell-check-version added as an alias for `check-ispell-version'.
-;; Spelling suggestions returned in order generated by ispell.
-;; Small bug fixed in matching ispell error messages.
-;; Robustness added to ensure `case-fold-search' doesn't get redefined.
-;; Fixed bug that didn't respect case of word in `ispell-complete-word'.
-;; Multibyte character coding support added for process interactions.
-;; Ensure ispell process has terminated before starting new process.
-;;  This can otherwise confuse process filters and hang ispell.
-;; Improved skipping support for SGML.
-;; Fixed bug using ^M rather than \r in `ispell-minor-check'.
-;; Improved message reference matching in `ispell-message'.
-;; Fixed bug in returning to nroff mode from tex mode.
-
 ;;; Compatibility code for XEmacs and (not too) older emacsen:
 (defalias 'ispell-check-minver
   (if (fboundp 'version<=) 'version<=
-- 
2.7.4


[-- Attachment #3: 0003-Assume-we-have-version-for-checking-ispell-version.patch --]
[-- Type: text/x-patch, Size: 3683 bytes --]

From 401e5f4227d37624abd17d04fd7ea70bf21ddcb3 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 00:54:04 +0000
Subject: [PATCH 03/23] Assume we have version<= for checking ispell version

* lisp/textmodes/ispell.el (ispell-check-minver): Remove.
(ispell-check-version): Use version<= directly.
---
 lisp/textmodes/ispell.el | 46 +++++-----------------------------------------
 1 file changed, 5 insertions(+), 41 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 25099e3..14a782d 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -118,42 +118,6 @@
 ;;  Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r)
 ;;    can cause misalignment errors.
 
-;;; Compatibility code for XEmacs and (not too) older emacsen:
-(defalias 'ispell-check-minver
-  (if (fboundp 'version<=) 'version<=
-    (lambda (minver version)
-      "Check if string VERSION is at least string MINVER.
-Both must be in [0-9]+.[0-9]+... format.  This is a fallback
-compatibility function in case `version<=' is not available."
-      (let ((pending t)
-            (return t)
-            start-ver start-mver)
-        ;; Loop until an absolute greater or smaller condition is reached
-        ;; or until no elements are left in any of version and minver. In
-        ;; this case version is exactly the minimal, so return OK.
-        (while pending
-          (let (ver mver)
-            (if (string-match "[0-9]+" version start-ver)
-                (setq start-ver (match-end 0)
-                      ver (string-to-number (match-string 0 version))))
-            (if (string-match "[0-9]+" minver start-mver)
-                (setq start-mver (match-end 0)
-                      mver (string-to-number (match-string 0 minver))))
-
-            (if (or ver mver)
-                (progn
-                  (or ver  (setq ver 0))
-                  (or mver (setq mver 0))
-                  ;; If none of below conditions match, this element is the
-                  ;; same. Go checking next element.
-                  (if (> ver mver)
-                      (setq pending nil)
-                    (if (< ver mver)
-                        (setq pending nil
-                              return nil))))
-              (setq pending nil))))
-        return))))
-
 ;; XEmacs does not have looking-back
 (defalias 'ispell-looking-back
   (if (fboundp 'looking-back) 'looking-back
@@ -829,8 +793,8 @@ ispell-check-version
 	    (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)
+	(if (version<= ispell0-minver ispell-program-version)
+	    (or (version<= ispell-minver ispell-program-version)
 		(setq ispell-offset 0))
 	  (error "%s release %s or greater is required"
 		 ispell-program-name
@@ -838,14 +802,14 @@ ispell-check-version
 
 	(cond
 	 (ispell-really-aspell
-	  (if (ispell-check-minver aspell-minver ispell-really-aspell)
-	      (if (ispell-check-minver aspell8-minver ispell-really-aspell)
+	  (if (version<= aspell-minver ispell-really-aspell)
+	      (if (version<= aspell8-minver ispell-really-aspell)
 		  (progn
 		    (setq ispell-aspell-supports-utf8 t)
 		    (setq ispell-encoding8-command "--encoding=")))
 	    (setq ispell-really-aspell nil)))
 	 (ispell-really-hunspell
-	  (if (ispell-check-minver hunspell8-minver ispell-really-hunspell)
+	  (if (version<= hunspell8-minver ispell-really-hunspell)
 	      (setq ispell-encoding8-command "-i")
 	    (setq ispell-really-hunspell nil))))))
     result))
-- 
2.7.4


[-- Attachment #4: 0004-Remove-unused-ispell-looking-back.patch --]
[-- Type: text/x-patch, Size: 1522 bytes --]

From 6a61779b947d3423cffdca5c47a895c68285d6f0 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 01:06:26 +0000
Subject: [PATCH 04/23] Remove unused ispell-looking-back

* lisp/textmodes/ispell.el (ispell-looking-back): Remove unused alias.
---
 lisp/textmodes/ispell.el | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 14a782d..554905c 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -118,21 +118,6 @@
 ;;  Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r)
 ;;    can cause misalignment errors.
 
-;; XEmacs does not have looking-back
-(defalias 'ispell-looking-back
-  (if (fboundp 'looking-back) 'looking-back
-    (lambda (regexp &optional limit &rest ignored)
-      "Return non-nil if text before point matches regular expression REGEXP.
-Like `looking-at' except matches before point, and is slower.
-LIMIT if non-nil speeds up the search by specifying a minimum
-starting position, to avoid checking matches that would start
-before LIMIT.
-
-This is a stripped down compatibility function for use when
-full featured `looking-back' function is missing."
-      (save-excursion
-        (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t)))))
-
 ;;; XEmacs21 does not have `with-no-warnings'. Taken from org mode.
 (defmacro ispell-with-no-warnings (&rest body)
   (cons (if (fboundp 'with-no-warnings) 'with-no-warnings 'progn) body))
-- 
2.7.4


[-- Attachment #5: 0005-Remove-tests-for-built-in-functions.patch --]
[-- Type: text/x-patch, Size: 3657 bytes --]

From 7ca421af7c7db1b2a2e371ced791f29dc575906e Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 13:52:04 +0000
Subject: [PATCH 05/23] Remove tests for built-in functions

* lisp/textmodes/ispell.el (buffer-substring-no-properties): Remove
back-up definition.
(ispell-add-per-file-word-list): Remove tests for comment-padright and
comment-normalize-vars.
---
 lisp/textmodes/ispell.el | 32 ++++++++++++--------------------
 1 file changed, 12 insertions(+), 20 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 554905c..462cb32 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -132,10 +132,6 @@ ispell
   "User variables for Emacs ispell interface."
   :group 'applications)
 
-(if (not (fboundp 'buffer-substring-no-properties))
-    (defun buffer-substring-no-properties (start end)
-      (buffer-substring start end)))
-
 (defalias 'check-ispell-version 'ispell-check-version)
 
 ;;; **********************************************************************
@@ -2300,15 +2296,15 @@ ispell-command-loop
 		   ((= char ?i)		; accept and insert word into pers dict
 		    (ispell-send-string (concat "*" word "\n"))
 		    (setq ispell-pdict-modified-p '(t)) ; dictionary modified!
-		    (and (fboundp 'flyspell-unhighlight-at)
-			 (flyspell-unhighlight-at start))
+		    (when (fboundp 'flyspell-unhighlight-at)
+                          (flyspell-unhighlight-at start))
 		    nil)
 		   ((or (= char ?a) (= char ?A)) ; accept word without insert
 		    (ispell-send-string (concat "@" word "\n"))
 		    (cl-pushnew word ispell-buffer-session-localwords
                                 :test #'equal)
-		    (and (fboundp 'flyspell-unhighlight-at)
-			 (flyspell-unhighlight-at start))
+		    (when (fboundp 'flyspell-unhighlight-at)
+                          (flyspell-unhighlight-at start))
 		    (or ispell-buffer-local-name ; session localwords might conflict
 			(setq ispell-buffer-local-name (buffer-name)))
 		    (if (null ispell-pdict-modified-p)
@@ -4259,8 +4255,8 @@ ispell-buffer-local-words
 
 ;; Returns optionally adjusted region-end-point.
 
-;; If comment-padright is defined, newcomment must be loaded.
-(declare-function comment-add "newcomment" (arg))
+;; If comment-normalize-vars is defined, newcomment must be loaded.
+(declare-function comment-normalize-vars "newcomment" (&optional noerror))
 
 (defun ispell-add-per-file-word-list (word)
   "Add WORD to the per-file word list."
@@ -4286,16 +4282,12 @@ ispell-add-per-file-word-list
 		    (unless found (newline))
 		    (insert (if comment-start
                                 (concat
-                                  (if (fboundp 'comment-padright)
-                                      ;; Try and use the proper comment marker,
-                                      ;; e.g. ";;" rather than ";".
-				      (progn
-					;; XEmacs: comment-normalize-vars
-					;; (newcomment.el) only in >= 21.5
-					(and (fboundp 'comment-normalize-vars)
-					     (comment-normalize-vars))
-					(comment-padright comment-start
-							  (comment-add nil)))
+                                  (progn
+                                   ;; Try and use the proper comment marker,
+                                   ;; e.g. ";;" rather than ";".
+                                    (comment-normalize-vars)
+                                    (comment-padright comment-start
+                                                      (comment-add nil))
                                     comment-start)
                                   " ")
                               "")
-- 
2.7.4


[-- Attachment #6: 0006-Generalise-over-specific-documentation.patch --]
[-- Type: text/x-patch, Size: 1493 bytes --]

From b2311cf687ec0af8da1c1c4df46255ebbd334e66 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 13:55:31 +0000
Subject: [PATCH 06/23] Generalise over-specific documentation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/textmodes/ispell.el (ispell-personal-dictionary): Rather than
document precise personal wordlist filenames for only two supported
spelling checkers, simply say that the default personal dictionary
depends on the chosen spelling checker.  The user can check the
spelling checker’s documentation if necessary.  This is simpler, and
works for other supported (and future, or unknown) spelling checkers.
---
 lisp/textmodes/ispell.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 462cb32..5ad7d05 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -349,9 +349,7 @@ ispell-use-framepop-p
 ;;;###autoload
 (defcustom ispell-personal-dictionary nil
   "File name of your personal spelling dictionary, or nil.
-If nil, the default personal dictionary, (\"~/.ispell_DICTNAME\" for ispell or
-\"~/.aspell.LANG.pws\" for Aspell) is used, where DICTNAME is the name of your
-default dictionary and LANG the two letter language code."
+If nil, the default personal dictionary for your spelling checker is used."
   :type '(choice file
 		 (const :tag "default" nil))
   :group 'ispell)
-- 
2.7.4


[-- Attachment #7: 0007-Remove-some-XEmacs-specific-code-from-ispell.el.patch --]
[-- Type: text/x-patch, Size: 4259 bytes --]

From afe3711c802950a6f1b3103e9e6963277a538784 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 13:59:59 +0000
Subject: [PATCH 07/23] Remove some XEmacs-specific code from ispell.el

* lisp/textmodes/ispell.el: Remove XEmacs menubar setup.
(ispell-int-char): Remove.
---
 lisp/textmodes/ispell.el | 69 +++++-------------------------------------------
 1 file changed, 6 insertions(+), 63 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 5ad7d05..5670bcd 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1466,62 +1466,6 @@ ispell-valid-dictionary-list
       ;;(put 'ispell-region 'menu-enable 'mark-active)
       (fset 'ispell-menu-map (symbol-value 'ispell-menu-map))))
 
-;;; XEmacs versions 19 & 20
-(if (and (featurep 'xemacs)
-	 (featurep 'menubar)
-	 ;;(null ispell-menu-xemacs)
-	 (not (and (boundp 'infodock-version) infodock-version)))
-    (let ((dicts (if (fboundp 'ispell-valid-dictionary-list)
-		     (reverse (ispell-valid-dictionary-list))))
-	  (current-menubar (or current-menubar default-menubar))
-	  (menu
-	   '(["Help"		(describe-function 'ispell-help) t]
-	     ;;["Help"		(popup-menu ispell-help-list)	t]
-	     ["Check Message"	ispell-message			t]
-	     ["Check Buffer"	ispell-buffer			t]
-	     ["Check Comments"	ispell-comments-and-strings	t]
-	     ["Check Word"	ispell-word			t]
-	     ["Check Region"	ispell-region  (or (not zmacs-regions) (mark))]
-	     ["Continue Check"	ispell-continue			t]
-	     ["Complete Word Frag"ispell-complete-word-interior-frag t]
-	     ["Complete Word"	ispell-complete-word		t]
-	     ["Kill Process"	(ispell-kill-ispell nil 'clear) t]
-	     ["Customize..."	(customize-group 'ispell)	t]
-	     ;; flyspell-mode may not be bound...
-	     ;;["flyspell"	flyspell-mode
-	     ;;			:style toggle :selected flyspell-mode ]
-	     "-"
-	     ["Save Personal Dict"(ispell-pdict-save t t)	t]
-	     ["Change Dictionary" ispell-change-dictionary	t])))
-      (if (null dicts)
-	  (setq dicts (cons "default" nil)))
-      (dolist (name dicts)
-	(setq menu (append menu
-			   (list
-			     (vector
-			      (concat "Select " (capitalize name))
-			      (list 'ispell-change-dictionary name)
-			      t)))))
-      (setq ispell-menu-xemacs menu)
-      (if current-menubar
-	  (progn
-	    (if (car (find-menu-item current-menubar '("Cmds")))
-		(progn
-		  ;; XEmacs 21.2
-		  (delete-menu-item '("Cmds" "Spell-Check"))
-		  (add-menu '("Cmds") "Spell-Check" ispell-menu-xemacs))
-	      ;; previous
-	      (delete-menu-item '("Edit" "Spell")) ; in case already defined
-	      (add-menu '("Edit") "Spell" ispell-menu-xemacs))))))
-
-(defalias 'ispell-int-char
-  ;; Allow incrementing characters as integers in XEmacs 20
-  (if (and (featurep 'xemacs)
-	   (fboundp 'int-char))
-      'int-char
-    ;; Emacs and XEmacs 19 or earlier
-    'identity))
-
 
 ;;; **********************************************************************
 
@@ -2230,12 +2174,12 @@ ispell-command-loop
 	;; not so good if there are over 20 or 30 options, but then, if
 	;; there are that many you don't want to scan them all anyway...
 	(while (memq count command-characters) ; skip command characters.
-	  (setq count (ispell-int-char (1+ count))
+	  (setq count (1+ count)
 		skipped (1+ skipped)))
 	(insert "(" count ") " (car choices) "  ")
 	(setq choices (cdr choices)
-	      count (ispell-int-char (1+ count))))
-      (setq count (ispell-int-char (- count ?0 skipped))))
+	      count (1+ count)))
+      (setq count (- count ?0 skipped)))
 
     (run-hooks 'ispell-update-post-hook)
 
@@ -2382,13 +2326,12 @@ ispell-command-loop
 					 (window-width))
 				  (insert "\n"))
 				(while (memq count command-characters)
-				  (setq count (ispell-int-char (1+ count))
+				  (setq count (1+ count)
 					skipped (1+ skipped)))
 				(insert "(" count ") " (car choices) "  ")
 				(setq choices (cdr choices)
-				      count (ispell-int-char (1+ count))))
-			      (setq count (ispell-int-char
-					   (- count ?0 skipped))))
+				      count (1+ count)))
+			      (setq count (- count ?0 skipped)))
 			    (setq textwin (selected-window))
 			    (ispell-show-choices)
 			    (select-window textwin))))
-- 
2.7.4


[-- Attachment #8: 0008-Assume-Emacs-supports-alpha-in-regexps.patch --]
[-- Type: text/x-patch, Size: 4626 bytes --]

From 6d1d1f73f90821f2bf45891bb305fc89897f0ef9 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:02:48 +0000
Subject: [PATCH 08/23] Assume Emacs supports [:alpha:] in regexps

* lisp/textmodes/ispell.el (ispell-emacs-alpha-regexp): Remove.
(ispell-set-spellchecker-params): Remove tests of
ispell-emacs-alpha-regexp.
---
 lisp/textmodes/ispell.el | 55 +++++++++++++++++++-----------------------------
 1 file changed, 22 insertions(+), 33 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 5670bcd..6246eb3 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -666,12 +666,6 @@ ispell-dicts-name2locale-equivs-alist
   "Alist with known matching locales for standard dict names in
   `ispell-dictionary-base-alist'.")
 
-(defvar ispell-emacs-alpha-regexp
-  (if (string-match "^[[:alpha:]]+$" "abcde")
-      "[[:alpha:]]"
-    nil)
-  "[[:alpha:]] if Emacs supports [:alpha:] regexp, nil
-otherwise (current XEmacs does not support it).")
 
 ;;; **********************************************************************
 ;;; The following are used by ispell, and should not be changed.
@@ -1244,11 +1238,9 @@ ispell-set-spellchecker-params
 		   (setq ispell-library-directory (ispell-check-version))
 		   t)
 	       (error nil))
-	     ispell-encoding8-command
-	     ispell-emacs-alpha-regexp)
+	     ispell-encoding8-command)
 	;; auto-detection will only be used if spellchecker is not
-	;; ispell, supports a way  to set communication to UTF-8 and
-	;; Emacs flavor supports [:alpha:]
+	;; ispell and supports a way to set communication to UTF-8.
 	(if ispell-really-aspell
 	    (or ispell-aspell-dictionary-alist
 		(ispell-find-aspell-dictionaries))
@@ -1262,9 +1254,8 @@ ispell-set-spellchecker-params
     ;; installed dictionaries and add to it elements of the original
     ;; list that are not present there. Allow distro info.
     (let ((found-dicts-alist
-	   (if (and ispell-encoding8-command
-		    ispell-emacs-alpha-regexp)
-	       (if ispell-really-aspell
+	   (if ispell-encoding8-command
+               (if ispell-really-aspell
 		   ispell-aspell-dictionary-alist
 		 (if ispell-really-hunspell
 		     ispell-hunspell-dictionary-alist))
@@ -1331,28 +1322,26 @@ ispell-set-spellchecker-params
 	  (push dict all-dicts-alist)))
       (setq ispell-dictionary-alist all-dicts-alist))
 
-    ;; If Emacs flavor supports [:alpha:] use it for global dicts.  If
-    ;; spellchecker also supports UTF-8 via command-line option use it
+    ;; If spellchecker supports UTF-8 via command-line option, use it
     ;; in communication.  This does not affect definitions in your
     ;; init file.
-    (if ispell-emacs-alpha-regexp
-     	(let (tmp-dicts-alist)
-    	  (dolist (adict ispell-dictionary-alist)
-	    (cl-pushnew (if (cadr adict) ;; Do not touch hunspell uninitialized entries
-                            (list
-                             (nth 0 adict)   ; dict name
-                             "[[:alpha:]]"   ; casechars
-                             "[^[:alpha:]]"  ; not-casechars
-                             (nth 3 adict)   ; otherchars
-                             (nth 4 adict)   ; many-otherchars-p
-                             (nth 5 adict)   ; ispell-args
-                             (nth 6 adict)   ; extended-character-mode
-                             (if ispell-encoding8-command
-                                 'utf-8
-                               (nth 7 adict)))
-                          adict)
-                        tmp-dicts-alist :test #'equal))
-	  (setq ispell-dictionary-alist tmp-dicts-alist)))))
+    (let (tmp-dicts-alist)
+      (dolist (adict ispell-dictionary-alist)
+        (cl-pushnew (if (cadr adict) ;; Do not touch hunspell uninitialized entries
+                        (list
+                         (nth 0 adict)   ; dict name
+                         "[[:alpha:]]"   ; casechars
+                         "[^[:alpha:]]"  ; not-casechars
+                         (nth 3 adict)   ; otherchars
+                         (nth 4 adict)   ; many-otherchars-p
+                         (nth 5 adict)   ; ispell-args
+                         (nth 6 adict)   ; extended-character-mode
+                         (if ispell-encoding8-command
+                             'utf-8
+                           (nth 7 adict)))
+                      adict)
+                    tmp-dicts-alist :test #'equal))
+      (setq ispell-dictionary-alist tmp-dicts-alist))))
 
 (defun ispell-valid-dictionary-list ()
   "Return a list of valid dictionaries.
-- 
2.7.4


[-- Attachment #9: 0009-Remove-XEmacs-and-old-Emacs-highlighting-code.patch --]
[-- Type: text/x-patch, Size: 2096 bytes --]

From a4ff7ad6cd6962d1a29a425b71a1e4943ac8ea7c Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:05:07 +0000
Subject: [PATCH 09/23] Remove XEmacs and old Emacs highlighting code

* lisp/textmodes/ispell.el
(ispell-highlight-spelling-error-xemacs): Remove.
(ispell-highlight-spelling-error): Assume display-color-p exists.
---
 lisp/textmodes/ispell.el | 22 +++-------------------
 1 file changed, 3 insertions(+), 19 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 6246eb3..95e87e4 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2633,17 +2633,6 @@ ispell-highlight-spelling-error-generic
 	  (if (eq 'block refresh) start (- start 2)) end t))))
 
 
-(defun ispell-highlight-spelling-error-xemacs (start end &optional highlight)
-  "Highlight the word from START to END using `isearch-highlight'.
-When the optional third arg HIGHLIGHT is set, the word is highlighted,
-otherwise it is displayed normally."
-  (if highlight
-      (isearch-highlight start end)
-    (isearch-dehighlight))
-  ;;(sit-for 0)
-  )
-
-
 (defun ispell-highlight-spelling-error-overlay (start end &optional highlight)
   "Highlight the word from START to END using overlays.
 When the optional third arg HIGHLIGHT is set, the word is highlighted
@@ -2679,14 +2668,9 @@ ispell-highlight-spelling-error-overlay
 
 
 (defun ispell-highlight-spelling-error (start end &optional highlight refresh)
-  (cond
-   ((featurep 'xemacs)
-    (ispell-highlight-spelling-error-xemacs start end highlight))
-   ((and (featurep 'faces)
-	 (or (and (fboundp 'display-color-p) (display-color-p))
-	     window-system))
-    (ispell-highlight-spelling-error-overlay start end highlight))
-   (t (ispell-highlight-spelling-error-generic start end highlight refresh))))
+  (if (display-color-p)
+      (ispell-highlight-spelling-error-overlay start end highlight)
+    (ispell-highlight-spelling-error-generic start end highlight refresh)))
 
 (defun ispell-display-buffer (buffer)
   "Show BUFFER in new window above selected one.
-- 
2.7.4


[-- Attachment #10: 0010-Remove-some-commented-out-code.patch --]
[-- Type: text/x-patch, Size: 1373 bytes --]

From 90f4ee9b8f8769272e68067b9ee68c9626e8110c Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:15:50 +0000
Subject: [PATCH 10/23] Remove some commented-out code

lisp/textmodes/ispell.el (ispell-process)
ispell-valid-dictionary-list): Remove commented-out code.
---
 lisp/textmodes/ispell.el | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 95e87e4..a6dd905 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -860,11 +860,7 @@ ispell-process
 
 (defvar ispell-async-processp (and (fboundp 'delete-process)
 				   (fboundp 'process-send-string)
-				   (fboundp 'accept-process-output)
-				   ;;(fboundp 'make-process)
-				   ;;(fboundp 'set-process-filter)
-				   ;;(fboundp 'process-kill-without-query)
-				   )
+				   (fboundp 'accept-process-output))
   "Non-nil means that the OS supports asynchronous processes.")
 
 ;; Make ispell.el work better with aspell.
@@ -1452,7 +1448,6 @@ ispell-valid-dictionary-list
       (define-key ispell-menu-map [ispell-buffer]
 	`(menu-item ,(purecopy "Spell-Check Buffer") ispell-buffer
 		    :help ,(purecopy "Check spelling of selected buffer")))
-      ;;(put 'ispell-region 'menu-enable 'mark-active)
       (fset 'ispell-menu-map (symbol-value 'ispell-menu-map))))
 
 
-- 
2.7.4


[-- Attachment #11: 0011-Remove-XEmacs-specific-code-from-ispell.el.patch --]
[-- Type: text/x-patch, Size: 5171 bytes --]

From a4c4ee19707abd7ede5eeeb32a77dbc4cd2bb73a Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:19:26 +0000
Subject: [PATCH 11/23] Remove XEmacs-specific code from ispell.el

* lisp/textmodes/ispell.el (ispell-menu-xemacs): Remove
(ispell-menu-map-needed): Remove XEmacs-specific check.
(ispell-word): Remove XEmacs-specific extent code.
(ispell-init-process): Remove XEmacs workaround for local add-hook.
Assume we have set-process-query-on-exit-flag.
(ispell-kill-ispell, ispell-change-dictionary): Remove XEmacs
workaround for called-interactively-p.
---
 lisp/textmodes/ispell.el | 55 +++++++++---------------------------------------
 1 file changed, 10 insertions(+), 45 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index a6dd905..6a28db6 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -833,22 +833,10 @@ ispell-menu-map
 ;; Redo menu when loading ispell to get dictionary modifications
 (setq ispell-menu-map nil)
 
-;;;###autoload
-(defvar ispell-menu-xemacs nil
-  "Spelling menu for XEmacs.
-If nil when package is loaded, a standard menu will be set,
-and added as a submenu of the \"Edit\" menu.")
-
-;; Break out XEmacs menu and split into several calls to avoid having
-;; long lines in loaddefs.el.  Detect need off following constant.
-
 ;;; Set up dictionary
 ;;;###autoload
 (defvar ispell-menu-map-needed
-  ;; only needed when not version 18 and not XEmacs.
-  (and (not ispell-menu-map)
-       (not (featurep 'xemacs))
-       'reload))
+  (unless ispell-menu-map 'reload))
 
 (defvar ispell-library-directory (condition-case ()
 				     (ispell-check-version)
@@ -1932,32 +1920,20 @@ ispell-word
       (cond ((eq poss t)
 	     (or quietly
 		 (message "%s is correct"
-			  (funcall ispell-format-word-function word)))
-	     (and (featurep 'xemacs)
-		  (extent-at start)
-		  (and (fboundp 'delete-extent)
-		       (delete-extent (extent-at start)))))
+			  (funcall ispell-format-word-function word))))
 	    ((stringp poss)
 	     (or quietly
 		 (message "%s is correct because of root %s"
 			  (funcall ispell-format-word-function word)
-			  (funcall ispell-format-word-function poss)))
-	     (and (featurep 'xemacs)
-		  (extent-at start)
-		  (and (fboundp 'delete-extent)
-		       (delete-extent (extent-at start)))))
+			  (funcall ispell-format-word-function poss))))
 	    ((null poss)
 	     (message "Error checking word %s using %s with %s dictionary"
 		      (funcall ispell-format-word-function word)
 		      (file-name-nondirectory ispell-program-name)
 		      (or ispell-current-dictionary "default")))
 	    (ispell-check-only	      ; called from ispell minor mode.
-	     (if (fboundp 'make-extent)
-		 (if (fboundp 'set-extent-property)
-		     (let ((ext (make-extent start end)))
-		       (set-extent-property ext 'face ispell-highlight-face)
-		       (set-extent-property ext 'priority 2000)))
-	       (beep)
+	     (progn
+               (beep)
 	       (message "%s is incorrect"
                         (funcall ispell-format-word-function word))))
 	    (t				; prompt for correct word.
@@ -2890,10 +2866,7 @@ ispell-init-process
 		;; to avoid over and over ispell kill.
 		(window-buffer (minibuffer-selected-window))
 	      (current-buffer))
-	  ;; 'local does not automatically make hook buffer-local in XEmacs.
-	  (if (featurep 'xemacs)
-	      (make-local-hook 'kill-buffer-hook))
-	  (add-hook 'kill-buffer-hook
+          (add-hook 'kill-buffer-hook
 		    (lambda () (ispell-kill-ispell t)) nil 'local)))
 
       (if ispell-async-processp
@@ -2938,12 +2911,8 @@ ispell-init-process
       (let ((extended-char-mode (ispell-get-extended-character-mode)))
 	(if extended-char-mode		; ~ extended character mode
 	    (ispell-send-string (concat extended-char-mode "\n"))))
-      (if ispell-async-processp
-	  (if (featurep 'emacs)
-	      (set-process-query-on-exit-flag ispell-process nil)
-	    (if (fboundp 'set-process-query-on-exit-flag)
-		(set-process-query-on-exit-flag ispell-process nil)
-	      (process-kill-without-query ispell-process)))))))
+      (when ispell-async-processp
+        (set-process-query-on-exit-flag ispell-process nil)))))
 
 ;;;###autoload
 (defun ispell-kill-ispell (&optional no-error clear)
@@ -2955,9 +2924,7 @@ ispell-kill-ispell
   ;; to optimize the common cases.
   (run-hooks 'ispell-kill-ispell-hook)
   (if (or clear
-	  (if (featurep 'xemacs)
-	      (interactive-p)
-	    (called-interactively-p 'interactive)))
+	  (called-interactively-p 'interactive))
       (setq ispell-buffer-session-localwords nil))
   (if (not (and ispell-process
 		(eq (ispell-process-status) 'run)))
@@ -3006,9 +2973,7 @@ ispell-change-dictionary
 	 ;; Specified dictionary is the default already. Could reload
 	 ;; the dictionaries if needed.
 	 (ispell-internal-change-dictionary)
-	 (and (if (featurep 'xemacs)
-		  (interactive-p)
-		(called-interactively-p 'interactive))
+	 (when (called-interactively-p 'interactive)
 	      (message "No change, using %s dictionary" dict)))
 	(t				; reset dictionary!
 	 (if (or (assoc dict ispell-local-dictionary-alist)
-- 
2.7.4


[-- Attachment #12: 0012-Remove-XEmacs-specific-code-dealing-with-enable-mult.patch --]
[-- Type: text/x-patch, Size: 2152 bytes --]

From bad41732fc5ddbb6dd22032247882de5a3ae6d0b Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:35:42 +0000
Subject: [PATCH 12/23] Remove XEmacs-specific code dealing with
 enable-multibyte-characters

* lisp/textmodes/ispell.el (ispell-decode-string):
(ispell-init-process):  Remove XEmacs-specific guard.
---
 lisp/textmodes/ispell.el | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 6a28db6..f0bb569 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1451,17 +1451,8 @@ ispell-current-personal-dictionary
 This is passed to the Ispell process using the `-p' switch.")
 
 (defun ispell-decode-string (str)
-  "Decodes multibyte character strings.
-Protects against bogus binding of `enable-multibyte-characters' in XEmacs."
-  ;; FIXME: enable-multibyte-characters is read-only, so bogus bindings are
-  ;; really nasty (they signal an error in Emacs): Who does that?  --Stef
-  (if (and (or (featurep 'xemacs)
-	       (and (boundp 'enable-multibyte-characters)
-		    enable-multibyte-characters))
-	   (fboundp 'decode-coding-string)
-	   (ispell-get-coding-system))
-      (decode-coding-string str (ispell-get-coding-system))
-    str))
+  "Decodes multibyte character strings."
+  (decode-coding-string str (ispell-get-coding-system)))
 
 ;; Return a string decoded from Nth element of the current dictionary.
 (defun ispell-get-decoded-string (n)
@@ -2871,11 +2862,7 @@ ispell-init-process
 
       (if ispell-async-processp
 	  (set-process-filter ispell-process 'ispell-filter))
-      ;; Protect against XEmacs bogus binding of `enable-multibyte-characters'.
-      (if (and (or (featurep 'xemacs)
-		   (and (boundp 'enable-multibyte-characters)
-			enable-multibyte-characters))
-	       (fboundp 'set-process-coding-system)
+      (if (and enable-multibyte-characters
                ;; Evidently, some people use the synchronous mode even
                ;; when async subprocesses are supported, in which case
                ;; set-process-coding-system is bound, but
-- 
2.7.4


[-- Attachment #13: 0013-Remove-XEmacs-specific-horizontal-scrollbar-handling.patch --]
[-- Type: text/x-patch, Size: 1357 bytes --]

From a6a471e4c095d5e3ed1388e19a1b3e18e87eda61 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:37:37 +0000
Subject: [PATCH 13/23] Remove XEmacs-specific horizontal scrollbar handling in
 ispell.el

* lisp/textmodes/ispell.el (ispell-command-loop): Remove
XEmacs-specific code.
---
 lisp/textmodes/ispell.el | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index f0bb569..8978d14 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2094,15 +2094,9 @@ ispell-command-loop
              "--  %b  --  word: " word
              "  --  dict: " (or ispell-current-dictionary "default")
              "  --  prog: " (file-name-nondirectory ispell-program-name)))
-      ;; XEmacs: no need for horizontal scrollbar in choices window
+      ;; No need for horizontal scrollbar in choices window
       (ispell-with-no-warnings
-       (and (fboundp 'set-specifier)
-	    (boundp 'horizontal-scrollbar-visible-p)
-	    (set-specifier horizontal-scrollbar-visible-p nil
-			   (cons (current-buffer) nil))))
-      (ispell-with-no-warnings
-       (and (boundp 'horizontal-scroll-bar)
-	    (setq horizontal-scroll-bar nil)))
+       (setq horizontal-scroll-bar nil))
       (erase-buffer)
       (if guess
 	  (progn
-- 
2.7.4


[-- Attachment #14: 0014-Remove-XEmacs-specific-minibuffer-handling-code-from.patch --]
[-- Type: text/x-patch, Size: 2216 bytes --]

From 28449dcb100bbd1a20560ddfa9175a876ef4aae1 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:38:51 +0000
Subject: [PATCH 14/23] Remove XEmacs-specific minibuffer handling code from
 ispell.el

* lisp/textmodes/ispell.el (ispell-init-process): Assume we are not in
XEmacs.
---
 lisp/textmodes/ispell.el | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 8978d14..c2d6d60 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2794,7 +2794,7 @@ ispell-init-process
 	 (current-ispell-directory default-directory) ;FIXME: Unused?
 	 ;; The default directory for the process.
 	 ;; Use "~/" as default-directory unless using Ispell with per-dir
-	 ;; personal dictionaries and not in a minibuffer under XEmacs
+	 ;; personal dictionaries
 	 (default-directory
 	   (if (or ispell-really-aspell
 		   ispell-really-hunspell
@@ -2807,9 +2807,8 @@ ispell-init-process
 						     ".ispell_"
 						     (or dict-bname
 							 "default")))))
-		   ;; Ispell, in a minibuffer, and XEmacs
-		   (and (window-minibuffer-p)
-			(not (fboundp 'minibuffer-selected-window))))
+		   ;; Ispell, in a minibuffer
+		   (window-minibuffer-p))
 	       (expand-file-name "~/")
 	     (expand-file-name default-directory))))
     ;; Check if process needs restart
@@ -2841,12 +2840,11 @@ ispell-init-process
 
       (unless (equal ispell-process-directory (expand-file-name "~/"))
 	;; At this point, `ispell-process-directory' will be "~/" unless using
-	;; Ispell with directory-specific dicts and not in XEmacs minibuffer.
+	;; Ispell with directory-specific dicts.
 	;; If not, kill ispell process when killing buffer.  It may be in a
 	;; removable device that would otherwise become un-mountable.
 	(with-current-buffer
-	    (if (and (window-minibuffer-p)                  ;; In minibuffer
-		     (fboundp 'minibuffer-selected-window)) ;; Not XEmacs.
+	    (if (window-minibuffer-p)                  ;; In minibuffer
 		;; In this case kill ispell only when parent buffer is killed
 		;; to avoid over and over ispell kill.
 		(window-buffer (minibuffer-selected-window))
-- 
2.7.4


[-- Attachment #15: 0015-Remove-remaining-mentions-of-XEmacs-from-ispell.el.patch --]
[-- Type: text/x-patch, Size: 1465 bytes --]

From 51d35de32adcf9fe080ed8361a2fae369194027b Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:39:42 +0000
Subject: [PATCH 15/23] Remove remaining mentions of XEmacs from ispell.el

* lisp/textmodes/ispell.el (ispell-valid-dictionary-list):
(ispell-add-per-file-word-list): Remove mentions of XEmacs from
comments.
---
 lisp/textmodes/ispell.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index c2d6d60..3abefdc 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1331,8 +1331,7 @@ ispell-valid-dictionary-list
   "Return a list of valid dictionaries.
 The variable `ispell-library-directory' defines their location."
   ;; Initialize variables and dictionaries alists for desired spellchecker.
-  ;; Make sure ispell.el is loaded to avoid some autoload loops in XEmacs
-  ;; (and may be others)
+  ;; Make sure ispell.el is loaded to avoid some autoload loops.
   (if (featurep 'ispell)
       (ispell-set-spellchecker-params))
 
@@ -4189,6 +4188,6 @@ ispell-add-per-file-word-list
 ; LocalWords:  minipage pers dict unhighlight buf grep sync prev inc
 ; LocalWords:  fn oldot NB AIX msg init read's bufs pt cmd Quinlan eg
 ; LocalWords:  uuencoded unidiff sc nn VM SGML eval IspellPersDict
-; LocalWords:  lns XEmacs HTML casechars Multibyte
+; LocalWords:  lns HTML casechars Multibyte
 
 ;;; ispell.el ends here
-- 
2.7.4


[-- Attachment #16: 0016-Remove-support-for-old-versions-of-supercite-and-GNU.patch --]
[-- Type: text/x-patch, Size: 1484 bytes --]

From 97098982546165681195117a1b7d7c5d736a2365 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 19:20:19 +0000
Subject: [PATCH 16/23] Remove support for old versions of supercite and GNUS
 from ispell.el

* lisp/textmodes/ispell.el (ispell-message): Require supercite >= 3.0
and GNUS >= 5.  Not exactly the bleeding edge!
---
 lisp/textmodes/ispell.el | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 3abefdc..2f91ec2 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -3866,16 +3866,11 @@ ispell-message
 	       "   \\|\t"))
 	   (cite-regexp			;Prefix of quoted text
 	    (cond
-	     ((functionp 'sc-cite-regexp)	; sc 3.0
+	     ((functionp 'sc-cite-regexp)	; supercite >= 3.0
 	      (ispell-with-no-warnings
 	       (concat "\\(" (sc-cite-regexp) "\\)" "\\|"
 		       (ispell-non-empty-string sc-reference-tag-string))))
-	     ((boundp 'sc-cite-regexp)		; sc 2.3
-	      (concat "\\(" sc-cite-regexp "\\)" "\\|"
-		      (ispell-with-no-warnings
-		       (ispell-non-empty-string sc-reference-tag-string))))
-	     ((or (equal major-mode 'news-reply-mode) ;GNUS 4 & below
-		  (equal major-mode 'message-mode))   ;GNUS 5
+	     ((equal major-mode 'message-mode)  ; GNUS >= 5
 	      (concat "In article <" "\\|"
 		      "[^,;&+=\n]+ <[^,;&+=]+> writes:" "\\|"
 		      (ispell-with-no-warnings message-cite-prefix-regexp)
-- 
2.7.4


[-- Attachment #17: 0017-Remove-unused-constant.patch --]
[-- Type: text/x-patch, Size: 924 bytes --]

From e7c5c5126e32d3424f40a4ee351c3ca9409dc3d9 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 21:47:02 +0000
Subject: [PATCH 17/23] Remove unused constant

* lisp/textmodes/ispell.el (ispell-required-version): Remove.
---
 lisp/textmodes/ispell.el | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 2f91ec2..b3fee99 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -673,10 +673,6 @@ ispell-dicts-name2locale-equivs-alist
 
 
 
-;; The version must be 3.1 or greater for this version of ispell.el
-;; There is an incompatibility between version 3.1.12 and lower versions.
-(defconst ispell-required-version '(3 1 12)
-  "Ispell versions with which this version of ispell.el is known to work.")
 (defvar ispell-offset -1
   "Offset that maps protocol differences between ispell 3.1 versions.")
 
-- 
2.7.4


[-- Attachment #18: 0018-Remove-support-for-ispell-3.1.12.patch --]
[-- Type: text/x-patch, Size: 1795 bytes --]

From 1c18017c290a80782b82b799efa5f36cd9fd0183 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 21:50:18 +0000
Subject: [PATCH 18/23] Remove support for ispell < 3.1.12

* lisp/textmodes/ispell.el (ispell-offset): Remove.
(ispell-check-version): Require ispell >= 3.1.12, released in 1994.
(ispell-process-line): No longer use ispell-offset.
---
 lisp/textmodes/ispell.el | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index b3fee99..412e838 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -673,9 +673,6 @@ ispell-dicts-name2locale-equivs-alist
 
 
 
-(defvar ispell-offset -1
-  "Offset that maps protocol differences between ispell 3.1 versions.")
-
 (defconst ispell-version "ispell.el 3.6 - 7-Jan-2003")
 
 
@@ -758,13 +755,10 @@ ispell-check-version
 
       (let ((aspell-minver    "0.50")
 	    (aspell8-minver   "0.60")
-	    (ispell0-minver   "3.1.0")
 	    (ispell-minver    "3.1.12")
 	    (hunspell8-minver "1.1.6"))
 
-	(if (version<= ispell0-minver ispell-program-version)
-	    (or (version<= ispell-minver ispell-program-version)
-		(setq ispell-offset 0))
+	(unless (version<= ispell-minver ispell-program-version)
 	  (error "%s release %s or greater is required"
 		 ispell-program-name
 		 ispell-minver))
@@ -3360,7 +3354,7 @@ ispell-process-line
 	  ;; Markers can move with highlighting!  This destroys
 	  ;; end of region markers line-end and ispell-region-end
 	  (let ((word-start
-		 (copy-marker (+ ispell-start ispell-offset (car (cdr poss)))))
+		 (copy-marker (+ ispell-start (car (cdr poss)))))
 		(word-len (length (car poss)))
 		(line-end (copy-marker ispell-end))
 		(line-start (copy-marker ispell-start))
-- 
2.7.4


[-- Attachment #19: 0019-Remove-boundp-test-for-always-bound-symbol.patch --]
[-- Type: text/x-patch, Size: 1134 bytes --]

From 03a5674536e97996b3589d842681f10e4b3e5ceb Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 21:55:19 +0000
Subject: [PATCH 19/23] Remove boundp test for always-bound symbol
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/textmodes/ispell.el (ispell-message): mail-yank-prefix is
defvar’d at the top of the file, so remove a test to see if it is
bound.
---
 lisp/textmodes/ispell.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 412e838..894e2ea 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -3851,8 +3851,7 @@ ispell-message
 		       (point-max)))
 		    (t (min (point-max) (funcall ispell-message-text-end))))))
 	   (default-prefix   ; Vanilla cite prefix (just used for cite-regexp)
-	     (if (and (boundp 'mail-yank-prefix) mail-yank-prefix)
-		 (ispell-non-empty-string mail-yank-prefix)
+	     (if (ispell-non-empty-string mail-yank-prefix)
 	       "   \\|\t"))
 	   (cite-regexp			;Prefix of quoted text
 	    (cond
-- 
2.7.4


[-- Attachment #20: 0020-Remove-meaningless-defconst-ispell-version.patch --]
[-- Type: text/x-patch, Size: 1972 bytes --]

From 01e9de80ebf42180a63f8021f754820334cc1fa1 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 21:58:00 +0000
Subject: [PATCH 20/23] Remove meaningless defconst ispell-version
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/textmodes/ispell.el (ispell-version): Since ispell.el is now
firmly part of Emacs, and the version hasn’t changed since 2003, and
isn’t used anywhere, remove it.  3rd-party code can better use the
Emacs version, or feature or function checks.
(ispell-check-version): No longer report ispell.el version.
---
 lisp/textmodes/ispell.el | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 894e2ea..398e83e 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -671,11 +671,6 @@ ispell-dicts-name2locale-equivs-alist
 ;;; The following are used by ispell, and should not be changed.
 ;;; **********************************************************************
 
-
-
-(defconst ispell-version "ispell.el 3.6 - 7-Jan-2003")
-
-
 (defun ispell-check-version (&optional interactivep)
   "Ensure that `ispell-program-name' is valid and has the correct version.
 Returns version number if called interactively.
@@ -710,13 +705,11 @@ ispell-check-version
 		      (if (string-match "\\`aspell" speller) "-v" "-vv"))))
       (goto-char (point-min))
       (if interactivep
-	  ;; Report version information of ispell and ispell.el
+	  ;; Report version information of ispell
 	  (progn
 	    (end-of-line)
-	    (setq result (concat (buffer-substring-no-properties (point-min)
-								 (point))
-				 ", "
-				 ispell-version))
+	    (setq result (buffer-substring-no-properties (point-min)
+                                                         (point)))
 	    (message "%s" result))
 	;; return LIBDIR or LIBRARYVAR (overrides LIBDIR) env.
 	(progn
-- 
2.7.4


[-- Attachment #21: 0021-Remove-XEmacs-specific-ispell-with-no-warnings.patch --]
[-- Type: text/x-patch, Size: 2382 bytes --]

From 377bc80dd6f66c7f644bbad7e408958548f0d6a5 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 22:01:56 +0000
Subject: [PATCH 21/23] Remove XEmacs-specific ispell-with-no-warnings

* lisp/textmodes/ispell.el (ispell-with-no-warnings): Remove this
defmacro, needed only for XEmacs.
(ispell-command-loop, ispell-message): Use with-no-warnings directly.
---
 lisp/textmodes/ispell.el | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 398e83e..c55d316 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -118,10 +118,6 @@
 ;;  Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r)
 ;;    can cause misalignment errors.
 
-;;; XEmacs21 does not have `with-no-warnings'. Taken from org mode.
-(defmacro ispell-with-no-warnings (&rest body)
-  (cons (if (fboundp 'with-no-warnings) 'with-no-warnings 'progn) body))
-
 ;;; Code:
 
 (eval-when-compile (require 'cl-lib))
@@ -2077,7 +2073,7 @@ ispell-command-loop
              "  --  dict: " (or ispell-current-dictionary "default")
              "  --  prog: " (file-name-nondirectory ispell-program-name)))
       ;; No need for horizontal scrollbar in choices window
-      (ispell-with-no-warnings
+      (with-no-warnings
        (setq horizontal-scroll-bar nil))
       (erase-buffer)
       (if guess
@@ -3849,18 +3845,18 @@ ispell-message
 	   (cite-regexp			;Prefix of quoted text
 	    (cond
 	     ((functionp 'sc-cite-regexp)	; supercite >= 3.0
-	      (ispell-with-no-warnings
+	      (with-no-warnings
 	       (concat "\\(" (sc-cite-regexp) "\\)" "\\|"
 		       (ispell-non-empty-string sc-reference-tag-string))))
 	     ((equal major-mode 'message-mode)  ; GNUS >= 5
 	      (concat "In article <" "\\|"
 		      "[^,;&+=\n]+ <[^,;&+=]+> writes:" "\\|"
-		      (ispell-with-no-warnings message-cite-prefix-regexp)
+		      (with-no-warnings message-cite-prefix-regexp)
 		      "\\|"
 		      default-prefix))
 	     ((equal major-mode 'mh-letter-mode) ; mh mail message
 	      (concat "[^,;&+=\n]+ writes:" "\\|"
-		      (ispell-with-no-warnings
+		      (with-no-warnings
 		       (ispell-non-empty-string mh-ins-buf-prefix))))
 	     ((not internal-messagep)	; Assume nn sent us this message.
 	      (concat "In [a-zA-Z.]+ you write:" "\\|"
-- 
2.7.4


[-- Attachment #22: 0022-Remove-unused-variable.patch --]
[-- Type: text/x-patch, Size: 951 bytes --]

From 9b202948a3801783c7f502145c97ba652fc405a4 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Mon, 5 Dec 2016 21:11:52 +0000
Subject: [PATCH 22/23] Remove unused variable

* lisp/textmodes/ispell.el (current-ispell-directory): Remove.
---
 lisp/textmodes/ispell.el | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index c55d316..6733c75 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2768,8 +2768,6 @@ ispell-init-process
   (let* (;; Basename of dictionary used by the spell-checker
 	 (dict-bname (or (car (cdr (member "-d" (ispell-get-ispell-args))))
 			 ispell-current-dictionary))
-	 ;; The directory where process was started.
-	 (current-ispell-directory default-directory) ;FIXME: Unused?
 	 ;; The default directory for the process.
 	 ;; Use "~/" as default-directory unless using Ispell with per-dir
 	 ;; personal dictionaries
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* bug#25107: Acknowledgement (Patches to clean up ispell.el)
  2016-12-05 21:38     ` Reuben Thomas
@ 2016-12-06 15:51       ` Eli Zaretskii
  2016-12-06 16:20         ` Reuben Thomas
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2016-12-06 15:51 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 25107

> From: Reuben Thomas <rrt@sc3d.org>
> Date: Mon, 5 Dec 2016 21:38:16 +0000
> 
> ​Attached, ​an updated patch set which fixes a couple of bugs I found, and adds one more patch to remove an
> unused variable.

Thanks, I have a few comments:

> From b2311cf687ec0af8da1c1c4df46255ebbd334e66 Mon Sep 17 00:00:00 2001
> From: Reuben Thomas <rrt@sc3d.org>
> Date: Sun, 4 Dec 2016 13:55:31 +0000
> Subject: [PATCH 06/23] Generalise over-specific documentation
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> 
> * lisp/textmodes/ispell.el (ispell-personal-dictionary): Rather than
> document precise personal wordlist filenames for only two supported
> spelling checkers, simply say that the default personal dictionary
> depends on the chosen spelling checker.  The user can check the
> spelling checker’s documentation if necessary.  This is simpler, and
> works for other supported (and future, or unknown) spelling checkers.

Why is it useful to remove this information?  The documentation of the
spell-checkers themselves leaves a lot to be desired, so asking the
users to go consult it might not be appreciated.  I'd rather add here
the missing info about the other spellers.

> From 01e9de80ebf42180a63f8021f754820334cc1fa1 Mon Sep 17 00:00:00 2001
> From: Reuben Thomas <rrt@sc3d.org>
> Date: Sun, 4 Dec 2016 21:58:00 +0000
> Subject: [PATCH 20/23] Remove meaningless defconst ispell-version
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> 
> * lisp/textmodes/ispell.el (ispell-version): Since ispell.el is now
> firmly part of Emacs, and the version hasn’t changed since 2003, and
> isn’t used anywhere, remove it.  3rd-party code can better use the
> Emacs version, or feature or function checks.

I agree, but instead of removing the information, how about replacing
it with the Emacs version?  Something like "ispell.el from Emacs %s".

The rest of the patch is fine with me.  Please wait for a few more
days before pushing, to give people time to comment.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#25107: Acknowledgement (Patches to clean up ispell.el)
  2016-12-06 15:51       ` Eli Zaretskii
@ 2016-12-06 16:20         ` Reuben Thomas
  2016-12-06 16:37           ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Reuben Thomas @ 2016-12-06 16:20 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25107

[-- Attachment #1: Type: text/plain, Size: 3355 bytes --]

On 6 December 2016 at 15:51, Eli Zaretskii <eliz@gnu.org> wrote:

>
> Why is it useful to remove this information?  The documentation of the
> spell-checkers themselves leaves a lot to be desired, so asking the
> users to go consult it might not be appreciated.  I'd rather add here
> the missing info about the other spellers.
>

​Emacs is enough for us to document without trying to document third-party
software. Since all the software involved is free, better to fix it
directly, and benefit all its users, rather than take on the burden of
documenting it in order only to benefit Emacs users.

If you can point out specific deficiencies in spellcheckers, I'm quite
happy to file suitable documentation patches with them.​ For example, the
man page for hunspell seems clear enough:

The default dictionary depends on the locale settings. The following
environment variables are searched: LC_ALL, LC_MESSAGES, and LANG. If none
are set then the default personal dictionary is $HOME/.hunspell_default.
Setting -d or  the DICTIONARY environmental variable, personal dictionary
will be $HOME/.hunspell_dicname

I find the documentation for GNU aspell a little less obvious, as it
requires the user to understand:

The personal dictionary generally has a filename of the form:

     .aspell.LANG.pws

and put this together with the "home-dir" setting to realise that the
default is "~/.aspell.LANG.pws".

The documentation for ispell is a bit clearer:

If neither the -p switch nor the WORDLIST environment variable is given,
ispell will search for a personal dictionary in both the current directory
and $HOME, creating one in $HOME if none is found. The preferred name is
constructed by appending ".ispell_" to the base name of the hash file.


In summary, it seems that a patch to the man page for aspell (as being the
first place users are likely to look) would be helpful. If you have other
suggestions, I can look into them.

> * lisp/textmodes/ispell.el (ispell-version): Since ispell.el is now
> > firmly part of Emacs, and the version hasn’t changed since 2003, and
> > isn’t used anywhere, remove it.  3rd-party code can better use the
> > Emacs version, or feature or function checks.
>
> I agree, but instead of removing the information, how about replacing
> it with the Emacs version?  Something like "ispell.el from Emacs %s".
>

The context is an interactive call to ispell-check-version, which reports
what version of the spell-checker is being used. If the user wishes to know
what version of Emacs they are running, they can check emacs-version. When
ispell.el was third-party code, knowing the version of ispell.el separately
made sense, e.g. for bug reports. Now, one would use report-emacs-bug,
which already includes the Emacs version; ispell-check-version, used
interactively, is now primarily useful for diagnosing problems with the
external spell-checker. (In general, having a diagnostic report the Emacs
version seems redundant unless there's a good reason: for example, if the
information is being transmitted outside Emacs, as is the case with
report-emacs-bug.)

​As you ask (and in light of the recent emacs-devel discussion you copied
to me), I'll give others the opportunity to respond before installing
anything.

-- 
http://rrt.sc3d.org

[-- Attachment #2: Type: text/html, Size: 5211 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#25107: Acknowledgement (Patches to clean up ispell.el)
  2016-12-06 16:20         ` Reuben Thomas
@ 2016-12-06 16:37           ` Eli Zaretskii
  2016-12-06 17:46             ` Reuben Thomas
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2016-12-06 16:37 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 25107

> From: Reuben Thomas <rrt@sc3d.org>
> Date: Tue, 6 Dec 2016 16:20:24 +0000
> Cc: 25107@debbugs.gnu.org
> 
>  Why is it useful to remove this information? The documentation of the
>  spell-checkers themselves leaves a lot to be desired, so asking the
>  users to go consult it might not be appreciated. I'd rather add here
>  the missing info about the other spellers.
> 
> ​Emacs is enough for us to document without trying to document third-party software. Since all the software
> involved is free, better to fix it directly, and benefit all its users, rather than take on the burden of documenting
> it in order only to benefit Emacs users.

I agree with the general point, but in this case we are talking about
mentioning a small number of file names in the doc string.  Doesn't
seem like a burden to me, and whoever put that information there
probably didn't see it as such, either.

>  > * lisp/textmodes/ispell.el (ispell-version): Since ispell.el is now
>  > firmly part of Emacs, and the version hasn’t changed since 2003, and
>  > isn’t used anywhere, remove it. 3rd-party code can better use the
>  > Emacs version, or feature or function checks.
> 
>  I agree, but instead of removing the information, how about replacing
>  it with the Emacs version? Something like "ispell.el from Emacs %s".
> 
> The context is an interactive call to ispell-check-version, which reports what version of the spell-checker is
> being used. If the user wishes to know what version of Emacs they are running, they can check
> emacs-version.

I was thinking about someone using the result to report the version
they have, e.g. as part of a bug report.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#25107: Acknowledgement (Patches to clean up ispell.el)
  2016-12-06 16:37           ` Eli Zaretskii
@ 2016-12-06 17:46             ` Reuben Thomas
  2016-12-06 18:01               ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Reuben Thomas @ 2016-12-06 17:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25107

[-- Attachment #1: Type: text/plain, Size: 1842 bytes --]

On 6 December 2016 at 16:37, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Reuben Thomas <rrt@sc3d.org>
> > Date: Tue, 6 Dec 2016 16:20:24 +0000
> > Cc: 25107@debbugs.gnu.org
> >
> >  Why is it useful to remove this information? The documentation of the
> >  spell-checkers themselves leaves a lot to be desired, so asking the
> >  users to go consult it might not be appreciated. I'd rather add here
> >  the missing info about the other spellers.
> >
> > ​Emacs is enough for us to document without trying to document
> third-party software. Since all the software
> > involved is free, better to fix it directly, and benefit all its users,
> rather than take on the burden of documenting
> > it in order only to benefit Emacs users.
>
> I agree with the general point, but in this case we are talking about
> mentioning a small number of file names in the doc string.  Doesn't
> seem like a burden to me, and whoever put that information there
> probably didn't see it as such, either.
>

​In that case I will add the information for Enchant. At least it is not
likely to change.​

I'm not saying it is much of a burden, but it is the sort of small burden
that can contribute to death-by-a-thousand-cuts. I guess we disagree over
what the threshold is; in this case I'm quite happy to cede that none of
the locations we mention is likely to change as all the spellcheckers
documented there are mature.

I was thinking about someone using the result to report the version
> they have, e.g. as part of a bug report.
>

​​Version of what? If of Emacs, then that version information is already
provided by report-emacs-bug. If of a spellchecker, then that information
is still provided by the revised message.

Sorry if I'm overlooking something obvious here!​

-- 
http://rrt.sc3d.org

[-- Attachment #2: Type: text/html, Size: 2980 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#25107: Acknowledgement (Patches to clean up ispell.el)
  2016-12-06 17:46             ` Reuben Thomas
@ 2016-12-06 18:01               ` Eli Zaretskii
  2016-12-06 18:11                 ` Reuben Thomas
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2016-12-06 18:01 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 25107

> From: Reuben Thomas <rrt@sc3d.org>
> Date: Tue, 6 Dec 2016 17:46:23 +0000
> Cc: 25107@debbugs.gnu.org
> 
>  I agree with the general point, but in this case we are talking about
>  mentioning a small number of file names in the doc string. Doesn't
>  seem like a burden to me, and whoever put that information there
>  probably didn't see it as such, either.
> 
> ​In that case I will add the information for Enchant. At least it is not likely to change.​

Sure, that's what I meant.

>  I was thinking about someone using the result to report the version
>  they have, e.g. as part of a bug report.
> 
> ​​Version of what? If of Emacs, then that version information is already provided by report-emacs-bug. If of a
> spellchecker, then that information is still provided by the revised message.

It's admittedly a minor issue, but just to make myself clear: I
thought about reporting the version not as part of report-emacs-bug.

Or let me ask this: why does ispell-version at all exist?  Perhaps I'm
confused about its purpose.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#25107: Acknowledgement (Patches to clean up ispell.el)
  2016-12-06 18:01               ` Eli Zaretskii
@ 2016-12-06 18:11                 ` Reuben Thomas
  2016-12-06 18:41                   ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Reuben Thomas @ 2016-12-06 18:11 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25107

[-- Attachment #1: Type: text/plain, Size: 2252 bytes --]

On 6 December 2016 at 18:01, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Reuben Thomas <rrt@sc3d.org>
> > Date: Tue, 6 Dec 2016 17:46:23 +0000
> > Cc: 25107@debbugs.gnu.org
> >
> >  I agree with the general point, but in this case we are talking about
> >  mentioning a small number of file names in the doc string. Doesn't
> >  seem like a burden to me, and whoever put that information there
> >  probably didn't see it as such, either.
> >
> > ​In that case I will add the information for Enchant. At least it is not
> likely to change.​
>
> Sure, that's what I meant.
>
> >  I was thinking about someone using the result to report the version
> >  they have, e.g. as part of a bug report.
> >
> > ​​Version of what? If of Emacs, then that version information is already
> provided by report-emacs-bug. If of a
> > spellchecker, then that information is still provided by the revised
> message.
>
> It's admittedly a minor issue, but just to make myself clear: I
> thought about reporting the version not as part of report-emacs-bug.
>
> Or let me ask this: why does ispell-version at all exist?  Perhaps I'm
> confused about its purpose.
>

​My understanding is that it exists for reporting bugs in the combination
of ispell.el and whatever spell checker you are using. When ispell.el was
distributed as third-party code, there were extra two useful pieces of
information: the version of the spell-checker program, and the version of
ispell.el.

Now, there is just one extra piece of information, the version of the
spell-checker program.

One would presumably also want the version of Emacs in a bug report, but we
don't print this out all over the place; we provide the convenience of
report-emacs-bug, and otherwise expect users to put it manually in the
report.

​So, emacs-version does not substitute for the old ispell.el version; the
old ispell.el version has simply become unnecessary, and I've removed it.
The Emacs version is still needed for a bug report, but there's no reason
that ispell.el (or any other core package) should show emacs-version
specially, when there are already user-friendly ways to automatically put
it in bug reports.​

-- 
http://rrt.sc3d.org

[-- Attachment #2: Type: text/html, Size: 3325 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#25107: Acknowledgement (Patches to clean up ispell.el)
  2016-12-06 18:11                 ` Reuben Thomas
@ 2016-12-06 18:41                   ` Eli Zaretskii
  2016-12-06 21:58                     ` Reuben Thomas
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2016-12-06 18:41 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 25107

> From: Reuben Thomas <rrt@sc3d.org>
> Date: Tue, 6 Dec 2016 18:11:16 +0000
> Cc: 25107@debbugs.gnu.org
> 
>  Or let me ask this: why does ispell-version at all exist? Perhaps I'm
>  confused about its purpose.
> 
> ​My understanding is that it exists for reporting bugs in the combination of ispell.el and whatever spell checker
> you are using. When ispell.el was distributed as third-party code, there were extra two useful pieces of
> information: the version of the spell-checker program, and the version of ispell.el.

Sorry, I goofed: I meant ispell-check-version, the command, when
invoked interactively -- what is its purpose?  It sounds like you are
saying it no longer has any purpose as a command, is that true?





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#25107: Acknowledgement (Patches to clean up ispell.el)
  2016-12-06 18:41                   ` Eli Zaretskii
@ 2016-12-06 21:58                     ` Reuben Thomas
  2016-12-13  0:55                       ` Reuben Thomas
  0 siblings, 1 reply; 17+ messages in thread
From: Reuben Thomas @ 2016-12-06 21:58 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25107

[-- Attachment #1: Type: text/plain, Size: 1138 bytes --]

On 6 December 2016 at 18:41, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Reuben Thomas <rrt@sc3d.org>
> > Date: Tue, 6 Dec 2016 18:11:16 +0000
> > Cc: 25107@debbugs.gnu.org
> >
> >  Or let me ask this: why does ispell-version at all exist? Perhaps I'm
> >  confused about its purpose.
> >
> > ​My understanding is that it exists for reporting bugs in the
> combination of ispell.el and whatever spell checker
> > you are using. When ispell.el was distributed as third-party code, there
> were extra two useful pieces of
> > information: the version of the spell-checker program, and the version
> of ispell.el.
>
> Sorry, I goofed: I meant ispell-check-version, the command, when
> invoked interactively -- what is its purpose?  It sounds like you are
> saying it no longer has any purpose as a command, is that true?
>

​I goofed in a complementary way: I gave an answer about
ispell-check-version, whose purpose is now (as far as I can see) to give
the version of ​the spell-checker program (i.e. aspell, hunspell etc.) for
use in bug reports, or other diagnostic purposes.

-- 
http://rrt.sc3d.org

[-- Attachment #2: Type: text/html, Size: 1820 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#25107: Acknowledgement (Patches to clean up ispell.el)
  2016-12-06 21:58                     ` Reuben Thomas
@ 2016-12-13  0:55                       ` Reuben Thomas
  2016-12-13 16:29                         ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Reuben Thomas @ 2016-12-13  0:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25107


[-- Attachment #1.1: Type: text/plain, Size: 136 bytes --]

One final update to this patch series: I added a patch to remove support
for aspell < 0.60 (released in 2004).

-- 
http://rrt.sc3d.org

[-- Attachment #1.2: Type: text/html, Size: 385 bytes --]

[-- Attachment #2: 0002-Remove-ispell.el-pre-GNU-Emacs-comments.patch --]
[-- Type: text/x-patch, Size: 5307 bytes --]

From de69e5faf89edc5b2bad555bad8e1440d1191260 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 00:49:35 +0000
Subject: [PATCH 02/25] Remove ispell.el pre-GNU Emacs comments

* lisp/textmodes/ispell.el (Commentary): Remove original maintainer
  details, as Emacs version, bug report address and so forth should be
  used instead for this version.  Remove in-line change history; use
  git instead.
---
 lisp/textmodes/ispell.el | 77 ------------------------------------------------
 1 file changed, 77 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 5d5d422..25099e3 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -3,12 +3,7 @@
 ;; Copyright (C) 1994-1995, 1997-2016 Free Software Foundation, Inc.
 
 ;; Author:           Ken Stevens <k.stevens@ieee.org>
-;; Maintainer:       Ken Stevens <k.stevens@ieee.org>
-;; Stevens Mod Date: Mon Jan  7 12:32:44 PST 2003
-;; Stevens Revision: 3.6
 ;; Status          : Release with 3.1.12+ and 3.2.0+ ispell.
-;; Bug Reports     : ispell-el-bugs@itcorp.com
-;; Web Site        : http://kdstevens.com/~stevens/ispell-page.html
 ;; Keywords: unix wp
 
 ;; This file is part of GNU Emacs.
@@ -123,78 +118,6 @@
 ;;  Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r)
 ;;    can cause misalignment errors.
 
-;; HISTORY
-
-;; Modifications made in latest versions:
-
-;; Revision 3.6 2003/01/07 12:32:44	kss
-;; Removed extra -d LIB in dictionary defs. (Pavel Janik)
-;; Filtered process calls with duplicate dictionary entries.
-;; Fixed bug where message-text-end is inside a mime skipped region.
-;; Minor fixes to get ispell menus right in XEmacs
-;; Fixed skip regexp so it doesn't match stuff like `/.\w'.
-;; Detecting dictionary change not working.  Fixed.  kss
-;; function `ispell-change-dictionary' now only completes valid dicts.
-
-;; Revision 3.5 2001/7/11 18:43:57	kss
-;; Added fix for aspell to work in XEmacs (ispell-check-version).
-;; Added Portuguese dictionary definition.
-;; New feature: MIME mail message support, Fcc support.
-;; Bug fix: retain comment syntax on lines with region skipping. (TeX $ bug...)
-;; Improved allocation for graphic mode lines.  (Miles Bader)
-;; Support -v flag for old versions of aspell.  (Eli Zaretskii)
-;; Clear minibuffer on ^G from ispell-help (Tak Ota)
-
-;; Revision 3.4 2000/8/4 09:41:50	kss
-;; Support new color display functions.
-;; Fixed misalignment offset bug when replacing a string after a shift made.
-;; Set to standard Author/Maintainer heading,
-;; ensure localwords lists are separated from the text by newline. (Dave Love)
-;; Added dictionary definition for Italian (William Deakin)
-;; HTML region skipping greatly improved. (Chuck D. Phillips)
-;; improved menus.  Fixed regexp matching http/email addresses.
-;; one arg always for XEmacs sleep-for (gunnar Evermann)
-;; support for synchronous processes (Eli Zaretskii)
-
-;; Revision 3.3  1999/11/29 11:38:34     kss
-;; Only word replacements entered in from the keyboard are rechecked.
-;; This fixes a bug in tex parsing and misalignment.
-;; Exceptions exist for recursive edit and query-replace, with tex error
-;; condition tested.  Recursive editing improved.
-;; XEmacs repair for when `enable-multibyte-characters' defined - Didier Verna.
-;; ispell-help fixed for XEmacs.  Choices minibuffer now displayed in XEmacs.
-;; Only list valid dictionaries in Spell menu.  Russian dictionary doesn't allow
-;; run-together words, and uses koi8-r font.  Don't skip text in html <TT>
-;; fonts.
-
-;; Revision 3.2  1999/5/7 14:25:14	kss
-;; Accept ispell versions 3.X.Y where X>=1
-;; fine tuned latex region skipping.  Fixed bug in ispell-word that did not
-;; point in right place on words < 2 chars.  Simplified ispell-minor-mode.
-;; Fixed bug in TeX parsing when math commands are in the comments.
-;; Removed calls to `when' macro.
-
-;; Revision 3.1  1998/12/1 13:21:52	kss
-;; Improved and fixed customize support.
-;; Improved and fixed comments in variables and messages.
-;; A coding system is now required for all languages.
-;; casechars improved for castellano, castellano8, and norsk dictionaries.
-;; Dictionary norsk7-tex removed.  Dictionary polish added.
-;; Dictionaries redefined at load-time to support dictionary changes.
-;; Menu redefined at load time to support dictionary changes.
-;; ispell-check-version added as an alias for `check-ispell-version'.
-;; Spelling suggestions returned in order generated by ispell.
-;; Small bug fixed in matching ispell error messages.
-;; Robustness added to ensure `case-fold-search' doesn't get redefined.
-;; Fixed bug that didn't respect case of word in `ispell-complete-word'.
-;; Multibyte character coding support added for process interactions.
-;; Ensure ispell process has terminated before starting new process.
-;;  This can otherwise confuse process filters and hang ispell.
-;; Improved skipping support for SGML.
-;; Fixed bug using ^M rather than \r in `ispell-minor-check'.
-;; Improved message reference matching in `ispell-message'.
-;; Fixed bug in returning to nroff mode from tex mode.
-
 ;;; Compatibility code for XEmacs and (not too) older emacsen:
 (defalias 'ispell-check-minver
   (if (fboundp 'version<=) 'version<=
-- 
2.7.4


[-- Attachment #3: 0003-Assume-we-have-version-for-checking-ispell-version.patch --]
[-- Type: text/x-patch, Size: 3683 bytes --]

From 34f1db6a92236f101db1de19e3797c02fc257187 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 00:54:04 +0000
Subject: [PATCH 03/25] Assume we have version<= for checking ispell version

* lisp/textmodes/ispell.el (ispell-check-minver): Remove.
(ispell-check-version): Use version<= directly.
---
 lisp/textmodes/ispell.el | 46 +++++-----------------------------------------
 1 file changed, 5 insertions(+), 41 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 25099e3..14a782d 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -118,42 +118,6 @@
 ;;  Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r)
 ;;    can cause misalignment errors.
 
-;;; Compatibility code for XEmacs and (not too) older emacsen:
-(defalias 'ispell-check-minver
-  (if (fboundp 'version<=) 'version<=
-    (lambda (minver version)
-      "Check if string VERSION is at least string MINVER.
-Both must be in [0-9]+.[0-9]+... format.  This is a fallback
-compatibility function in case `version<=' is not available."
-      (let ((pending t)
-            (return t)
-            start-ver start-mver)
-        ;; Loop until an absolute greater or smaller condition is reached
-        ;; or until no elements are left in any of version and minver. In
-        ;; this case version is exactly the minimal, so return OK.
-        (while pending
-          (let (ver mver)
-            (if (string-match "[0-9]+" version start-ver)
-                (setq start-ver (match-end 0)
-                      ver (string-to-number (match-string 0 version))))
-            (if (string-match "[0-9]+" minver start-mver)
-                (setq start-mver (match-end 0)
-                      mver (string-to-number (match-string 0 minver))))
-
-            (if (or ver mver)
-                (progn
-                  (or ver  (setq ver 0))
-                  (or mver (setq mver 0))
-                  ;; If none of below conditions match, this element is the
-                  ;; same. Go checking next element.
-                  (if (> ver mver)
-                      (setq pending nil)
-                    (if (< ver mver)
-                        (setq pending nil
-                              return nil))))
-              (setq pending nil))))
-        return))))
-
 ;; XEmacs does not have looking-back
 (defalias 'ispell-looking-back
   (if (fboundp 'looking-back) 'looking-back
@@ -829,8 +793,8 @@ ispell-check-version
 	    (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)
+	(if (version<= ispell0-minver ispell-program-version)
+	    (or (version<= ispell-minver ispell-program-version)
 		(setq ispell-offset 0))
 	  (error "%s release %s or greater is required"
 		 ispell-program-name
@@ -838,14 +802,14 @@ ispell-check-version
 
 	(cond
 	 (ispell-really-aspell
-	  (if (ispell-check-minver aspell-minver ispell-really-aspell)
-	      (if (ispell-check-minver aspell8-minver ispell-really-aspell)
+	  (if (version<= aspell-minver ispell-really-aspell)
+	      (if (version<= aspell8-minver ispell-really-aspell)
 		  (progn
 		    (setq ispell-aspell-supports-utf8 t)
 		    (setq ispell-encoding8-command "--encoding=")))
 	    (setq ispell-really-aspell nil)))
 	 (ispell-really-hunspell
-	  (if (ispell-check-minver hunspell8-minver ispell-really-hunspell)
+	  (if (version<= hunspell8-minver ispell-really-hunspell)
 	      (setq ispell-encoding8-command "-i")
 	    (setq ispell-really-hunspell nil))))))
     result))
-- 
2.7.4


[-- Attachment #4: 0004-Remove-unused-ispell-looking-back.patch --]
[-- Type: text/x-patch, Size: 1522 bytes --]

From e761f78db277dba3768607542fcfbc2ee1b23ea4 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 01:06:26 +0000
Subject: [PATCH 04/25] Remove unused ispell-looking-back

* lisp/textmodes/ispell.el (ispell-looking-back): Remove unused alias.
---
 lisp/textmodes/ispell.el | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 14a782d..554905c 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -118,21 +118,6 @@
 ;;  Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r)
 ;;    can cause misalignment errors.
 
-;; XEmacs does not have looking-back
-(defalias 'ispell-looking-back
-  (if (fboundp 'looking-back) 'looking-back
-    (lambda (regexp &optional limit &rest ignored)
-      "Return non-nil if text before point matches regular expression REGEXP.
-Like `looking-at' except matches before point, and is slower.
-LIMIT if non-nil speeds up the search by specifying a minimum
-starting position, to avoid checking matches that would start
-before LIMIT.
-
-This is a stripped down compatibility function for use when
-full featured `looking-back' function is missing."
-      (save-excursion
-        (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t)))))
-
 ;;; XEmacs21 does not have `with-no-warnings'. Taken from org mode.
 (defmacro ispell-with-no-warnings (&rest body)
   (cons (if (fboundp 'with-no-warnings) 'with-no-warnings 'progn) body))
-- 
2.7.4


[-- Attachment #5: 0005-Remove-tests-for-built-in-functions.patch --]
[-- Type: text/x-patch, Size: 3657 bytes --]

From 4625ac98f34afdc9733e8b8e623fc05a771feae9 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 13:52:04 +0000
Subject: [PATCH 05/25] Remove tests for built-in functions

* lisp/textmodes/ispell.el (buffer-substring-no-properties): Remove
back-up definition.
(ispell-add-per-file-word-list): Remove tests for comment-padright and
comment-normalize-vars.
---
 lisp/textmodes/ispell.el | 32 ++++++++++++--------------------
 1 file changed, 12 insertions(+), 20 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 554905c..462cb32 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -132,10 +132,6 @@ ispell
   "User variables for Emacs ispell interface."
   :group 'applications)
 
-(if (not (fboundp 'buffer-substring-no-properties))
-    (defun buffer-substring-no-properties (start end)
-      (buffer-substring start end)))
-
 (defalias 'check-ispell-version 'ispell-check-version)
 
 ;;; **********************************************************************
@@ -2300,15 +2296,15 @@ ispell-command-loop
 		   ((= char ?i)		; accept and insert word into pers dict
 		    (ispell-send-string (concat "*" word "\n"))
 		    (setq ispell-pdict-modified-p '(t)) ; dictionary modified!
-		    (and (fboundp 'flyspell-unhighlight-at)
-			 (flyspell-unhighlight-at start))
+		    (when (fboundp 'flyspell-unhighlight-at)
+                          (flyspell-unhighlight-at start))
 		    nil)
 		   ((or (= char ?a) (= char ?A)) ; accept word without insert
 		    (ispell-send-string (concat "@" word "\n"))
 		    (cl-pushnew word ispell-buffer-session-localwords
                                 :test #'equal)
-		    (and (fboundp 'flyspell-unhighlight-at)
-			 (flyspell-unhighlight-at start))
+		    (when (fboundp 'flyspell-unhighlight-at)
+                          (flyspell-unhighlight-at start))
 		    (or ispell-buffer-local-name ; session localwords might conflict
 			(setq ispell-buffer-local-name (buffer-name)))
 		    (if (null ispell-pdict-modified-p)
@@ -4259,8 +4255,8 @@ ispell-buffer-local-words
 
 ;; Returns optionally adjusted region-end-point.
 
-;; If comment-padright is defined, newcomment must be loaded.
-(declare-function comment-add "newcomment" (arg))
+;; If comment-normalize-vars is defined, newcomment must be loaded.
+(declare-function comment-normalize-vars "newcomment" (&optional noerror))
 
 (defun ispell-add-per-file-word-list (word)
   "Add WORD to the per-file word list."
@@ -4286,16 +4282,12 @@ ispell-add-per-file-word-list
 		    (unless found (newline))
 		    (insert (if comment-start
                                 (concat
-                                  (if (fboundp 'comment-padright)
-                                      ;; Try and use the proper comment marker,
-                                      ;; e.g. ";;" rather than ";".
-				      (progn
-					;; XEmacs: comment-normalize-vars
-					;; (newcomment.el) only in >= 21.5
-					(and (fboundp 'comment-normalize-vars)
-					     (comment-normalize-vars))
-					(comment-padright comment-start
-							  (comment-add nil)))
+                                  (progn
+                                   ;; Try and use the proper comment marker,
+                                   ;; e.g. ";;" rather than ";".
+                                    (comment-normalize-vars)
+                                    (comment-padright comment-start
+                                                      (comment-add nil))
                                     comment-start)
                                   " ")
                               "")
-- 
2.7.4


[-- Attachment #6: 0006-Generalise-over-specific-documentation.patch --]
[-- Type: text/x-patch, Size: 1493 bytes --]

From 9a0f547dc8dd03525431bf284f3a63325410bbc3 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 13:55:31 +0000
Subject: [PATCH 06/25] Generalise over-specific documentation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/textmodes/ispell.el (ispell-personal-dictionary): Rather than
document precise personal wordlist filenames for only two supported
spelling checkers, simply say that the default personal dictionary
depends on the chosen spelling checker.  The user can check the
spelling checker’s documentation if necessary.  This is simpler, and
works for other supported (and future, or unknown) spelling checkers.
---
 lisp/textmodes/ispell.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 462cb32..5ad7d05 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -349,9 +349,7 @@ ispell-use-framepop-p
 ;;;###autoload
 (defcustom ispell-personal-dictionary nil
   "File name of your personal spelling dictionary, or nil.
-If nil, the default personal dictionary, (\"~/.ispell_DICTNAME\" for ispell or
-\"~/.aspell.LANG.pws\" for Aspell) is used, where DICTNAME is the name of your
-default dictionary and LANG the two letter language code."
+If nil, the default personal dictionary for your spelling checker is used."
   :type '(choice file
 		 (const :tag "default" nil))
   :group 'ispell)
-- 
2.7.4


[-- Attachment #7: 0007-Remove-some-XEmacs-specific-code-from-ispell.el.patch --]
[-- Type: text/x-patch, Size: 4259 bytes --]

From 135bb390886d05b884a3e736aebec4b47c450617 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 13:59:59 +0000
Subject: [PATCH 07/25] Remove some XEmacs-specific code from ispell.el

* lisp/textmodes/ispell.el: Remove XEmacs menubar setup.
(ispell-int-char): Remove.
---
 lisp/textmodes/ispell.el | 69 +++++-------------------------------------------
 1 file changed, 6 insertions(+), 63 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 5ad7d05..5670bcd 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1466,62 +1466,6 @@ ispell-valid-dictionary-list
       ;;(put 'ispell-region 'menu-enable 'mark-active)
       (fset 'ispell-menu-map (symbol-value 'ispell-menu-map))))
 
-;;; XEmacs versions 19 & 20
-(if (and (featurep 'xemacs)
-	 (featurep 'menubar)
-	 ;;(null ispell-menu-xemacs)
-	 (not (and (boundp 'infodock-version) infodock-version)))
-    (let ((dicts (if (fboundp 'ispell-valid-dictionary-list)
-		     (reverse (ispell-valid-dictionary-list))))
-	  (current-menubar (or current-menubar default-menubar))
-	  (menu
-	   '(["Help"		(describe-function 'ispell-help) t]
-	     ;;["Help"		(popup-menu ispell-help-list)	t]
-	     ["Check Message"	ispell-message			t]
-	     ["Check Buffer"	ispell-buffer			t]
-	     ["Check Comments"	ispell-comments-and-strings	t]
-	     ["Check Word"	ispell-word			t]
-	     ["Check Region"	ispell-region  (or (not zmacs-regions) (mark))]
-	     ["Continue Check"	ispell-continue			t]
-	     ["Complete Word Frag"ispell-complete-word-interior-frag t]
-	     ["Complete Word"	ispell-complete-word		t]
-	     ["Kill Process"	(ispell-kill-ispell nil 'clear) t]
-	     ["Customize..."	(customize-group 'ispell)	t]
-	     ;; flyspell-mode may not be bound...
-	     ;;["flyspell"	flyspell-mode
-	     ;;			:style toggle :selected flyspell-mode ]
-	     "-"
-	     ["Save Personal Dict"(ispell-pdict-save t t)	t]
-	     ["Change Dictionary" ispell-change-dictionary	t])))
-      (if (null dicts)
-	  (setq dicts (cons "default" nil)))
-      (dolist (name dicts)
-	(setq menu (append menu
-			   (list
-			     (vector
-			      (concat "Select " (capitalize name))
-			      (list 'ispell-change-dictionary name)
-			      t)))))
-      (setq ispell-menu-xemacs menu)
-      (if current-menubar
-	  (progn
-	    (if (car (find-menu-item current-menubar '("Cmds")))
-		(progn
-		  ;; XEmacs 21.2
-		  (delete-menu-item '("Cmds" "Spell-Check"))
-		  (add-menu '("Cmds") "Spell-Check" ispell-menu-xemacs))
-	      ;; previous
-	      (delete-menu-item '("Edit" "Spell")) ; in case already defined
-	      (add-menu '("Edit") "Spell" ispell-menu-xemacs))))))
-
-(defalias 'ispell-int-char
-  ;; Allow incrementing characters as integers in XEmacs 20
-  (if (and (featurep 'xemacs)
-	   (fboundp 'int-char))
-      'int-char
-    ;; Emacs and XEmacs 19 or earlier
-    'identity))
-
 
 ;;; **********************************************************************
 
@@ -2230,12 +2174,12 @@ ispell-command-loop
 	;; not so good if there are over 20 or 30 options, but then, if
 	;; there are that many you don't want to scan them all anyway...
 	(while (memq count command-characters) ; skip command characters.
-	  (setq count (ispell-int-char (1+ count))
+	  (setq count (1+ count)
 		skipped (1+ skipped)))
 	(insert "(" count ") " (car choices) "  ")
 	(setq choices (cdr choices)
-	      count (ispell-int-char (1+ count))))
-      (setq count (ispell-int-char (- count ?0 skipped))))
+	      count (1+ count)))
+      (setq count (- count ?0 skipped)))
 
     (run-hooks 'ispell-update-post-hook)
 
@@ -2382,13 +2326,12 @@ ispell-command-loop
 					 (window-width))
 				  (insert "\n"))
 				(while (memq count command-characters)
-				  (setq count (ispell-int-char (1+ count))
+				  (setq count (1+ count)
 					skipped (1+ skipped)))
 				(insert "(" count ") " (car choices) "  ")
 				(setq choices (cdr choices)
-				      count (ispell-int-char (1+ count))))
-			      (setq count (ispell-int-char
-					   (- count ?0 skipped))))
+				      count (1+ count)))
+			      (setq count (- count ?0 skipped)))
 			    (setq textwin (selected-window))
 			    (ispell-show-choices)
 			    (select-window textwin))))
-- 
2.7.4


[-- Attachment #8: 0008-Assume-Emacs-supports-alpha-in-regexps.patch --]
[-- Type: text/x-patch, Size: 4626 bytes --]

From ccdfc3bc1a9aadb06878b0218c06dbba32885985 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:02:48 +0000
Subject: [PATCH 08/25] Assume Emacs supports [:alpha:] in regexps

* lisp/textmodes/ispell.el (ispell-emacs-alpha-regexp): Remove.
(ispell-set-spellchecker-params): Remove tests of
ispell-emacs-alpha-regexp.
---
 lisp/textmodes/ispell.el | 55 +++++++++++++++++++-----------------------------
 1 file changed, 22 insertions(+), 33 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 5670bcd..6246eb3 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -666,12 +666,6 @@ ispell-dicts-name2locale-equivs-alist
   "Alist with known matching locales for standard dict names in
   `ispell-dictionary-base-alist'.")
 
-(defvar ispell-emacs-alpha-regexp
-  (if (string-match "^[[:alpha:]]+$" "abcde")
-      "[[:alpha:]]"
-    nil)
-  "[[:alpha:]] if Emacs supports [:alpha:] regexp, nil
-otherwise (current XEmacs does not support it).")
 
 ;;; **********************************************************************
 ;;; The following are used by ispell, and should not be changed.
@@ -1244,11 +1238,9 @@ ispell-set-spellchecker-params
 		   (setq ispell-library-directory (ispell-check-version))
 		   t)
 	       (error nil))
-	     ispell-encoding8-command
-	     ispell-emacs-alpha-regexp)
+	     ispell-encoding8-command)
 	;; auto-detection will only be used if spellchecker is not
-	;; ispell, supports a way  to set communication to UTF-8 and
-	;; Emacs flavor supports [:alpha:]
+	;; ispell and supports a way to set communication to UTF-8.
 	(if ispell-really-aspell
 	    (or ispell-aspell-dictionary-alist
 		(ispell-find-aspell-dictionaries))
@@ -1262,9 +1254,8 @@ ispell-set-spellchecker-params
     ;; installed dictionaries and add to it elements of the original
     ;; list that are not present there. Allow distro info.
     (let ((found-dicts-alist
-	   (if (and ispell-encoding8-command
-		    ispell-emacs-alpha-regexp)
-	       (if ispell-really-aspell
+	   (if ispell-encoding8-command
+               (if ispell-really-aspell
 		   ispell-aspell-dictionary-alist
 		 (if ispell-really-hunspell
 		     ispell-hunspell-dictionary-alist))
@@ -1331,28 +1322,26 @@ ispell-set-spellchecker-params
 	  (push dict all-dicts-alist)))
       (setq ispell-dictionary-alist all-dicts-alist))
 
-    ;; If Emacs flavor supports [:alpha:] use it for global dicts.  If
-    ;; spellchecker also supports UTF-8 via command-line option use it
+    ;; If spellchecker supports UTF-8 via command-line option, use it
     ;; in communication.  This does not affect definitions in your
     ;; init file.
-    (if ispell-emacs-alpha-regexp
-     	(let (tmp-dicts-alist)
-    	  (dolist (adict ispell-dictionary-alist)
-	    (cl-pushnew (if (cadr adict) ;; Do not touch hunspell uninitialized entries
-                            (list
-                             (nth 0 adict)   ; dict name
-                             "[[:alpha:]]"   ; casechars
-                             "[^[:alpha:]]"  ; not-casechars
-                             (nth 3 adict)   ; otherchars
-                             (nth 4 adict)   ; many-otherchars-p
-                             (nth 5 adict)   ; ispell-args
-                             (nth 6 adict)   ; extended-character-mode
-                             (if ispell-encoding8-command
-                                 'utf-8
-                               (nth 7 adict)))
-                          adict)
-                        tmp-dicts-alist :test #'equal))
-	  (setq ispell-dictionary-alist tmp-dicts-alist)))))
+    (let (tmp-dicts-alist)
+      (dolist (adict ispell-dictionary-alist)
+        (cl-pushnew (if (cadr adict) ;; Do not touch hunspell uninitialized entries
+                        (list
+                         (nth 0 adict)   ; dict name
+                         "[[:alpha:]]"   ; casechars
+                         "[^[:alpha:]]"  ; not-casechars
+                         (nth 3 adict)   ; otherchars
+                         (nth 4 adict)   ; many-otherchars-p
+                         (nth 5 adict)   ; ispell-args
+                         (nth 6 adict)   ; extended-character-mode
+                         (if ispell-encoding8-command
+                             'utf-8
+                           (nth 7 adict)))
+                      adict)
+                    tmp-dicts-alist :test #'equal))
+      (setq ispell-dictionary-alist tmp-dicts-alist))))
 
 (defun ispell-valid-dictionary-list ()
   "Return a list of valid dictionaries.
-- 
2.7.4


[-- Attachment #9: 0009-Remove-XEmacs-and-old-Emacs-highlighting-code.patch --]
[-- Type: text/x-patch, Size: 2096 bytes --]

From 3e3b46debf35624ecbb48bd88be11312790592c7 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:05:07 +0000
Subject: [PATCH 09/25] Remove XEmacs and old Emacs highlighting code

* lisp/textmodes/ispell.el
(ispell-highlight-spelling-error-xemacs): Remove.
(ispell-highlight-spelling-error): Assume display-color-p exists.
---
 lisp/textmodes/ispell.el | 22 +++-------------------
 1 file changed, 3 insertions(+), 19 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 6246eb3..95e87e4 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2633,17 +2633,6 @@ ispell-highlight-spelling-error-generic
 	  (if (eq 'block refresh) start (- start 2)) end t))))
 
 
-(defun ispell-highlight-spelling-error-xemacs (start end &optional highlight)
-  "Highlight the word from START to END using `isearch-highlight'.
-When the optional third arg HIGHLIGHT is set, the word is highlighted,
-otherwise it is displayed normally."
-  (if highlight
-      (isearch-highlight start end)
-    (isearch-dehighlight))
-  ;;(sit-for 0)
-  )
-
-
 (defun ispell-highlight-spelling-error-overlay (start end &optional highlight)
   "Highlight the word from START to END using overlays.
 When the optional third arg HIGHLIGHT is set, the word is highlighted
@@ -2679,14 +2668,9 @@ ispell-highlight-spelling-error-overlay
 
 
 (defun ispell-highlight-spelling-error (start end &optional highlight refresh)
-  (cond
-   ((featurep 'xemacs)
-    (ispell-highlight-spelling-error-xemacs start end highlight))
-   ((and (featurep 'faces)
-	 (or (and (fboundp 'display-color-p) (display-color-p))
-	     window-system))
-    (ispell-highlight-spelling-error-overlay start end highlight))
-   (t (ispell-highlight-spelling-error-generic start end highlight refresh))))
+  (if (display-color-p)
+      (ispell-highlight-spelling-error-overlay start end highlight)
+    (ispell-highlight-spelling-error-generic start end highlight refresh)))
 
 (defun ispell-display-buffer (buffer)
   "Show BUFFER in new window above selected one.
-- 
2.7.4


[-- Attachment #10: 0010-Remove-some-commented-out-code.patch --]
[-- Type: text/x-patch, Size: 1373 bytes --]

From b0f33c83e498723b24e2b3de66f471f5d189ea5c Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:15:50 +0000
Subject: [PATCH 10/25] Remove some commented-out code

lisp/textmodes/ispell.el (ispell-process)
ispell-valid-dictionary-list): Remove commented-out code.
---
 lisp/textmodes/ispell.el | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 95e87e4..a6dd905 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -860,11 +860,7 @@ ispell-process
 
 (defvar ispell-async-processp (and (fboundp 'delete-process)
 				   (fboundp 'process-send-string)
-				   (fboundp 'accept-process-output)
-				   ;;(fboundp 'make-process)
-				   ;;(fboundp 'set-process-filter)
-				   ;;(fboundp 'process-kill-without-query)
-				   )
+				   (fboundp 'accept-process-output))
   "Non-nil means that the OS supports asynchronous processes.")
 
 ;; Make ispell.el work better with aspell.
@@ -1452,7 +1448,6 @@ ispell-valid-dictionary-list
       (define-key ispell-menu-map [ispell-buffer]
 	`(menu-item ,(purecopy "Spell-Check Buffer") ispell-buffer
 		    :help ,(purecopy "Check spelling of selected buffer")))
-      ;;(put 'ispell-region 'menu-enable 'mark-active)
       (fset 'ispell-menu-map (symbol-value 'ispell-menu-map))))
 
 
-- 
2.7.4


[-- Attachment #11: 0011-Remove-XEmacs-specific-code-from-ispell.el.patch --]
[-- Type: text/x-patch, Size: 5171 bytes --]

From a3c98562d654b7584a124e61cde4bc7204568389 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:19:26 +0000
Subject: [PATCH 11/25] Remove XEmacs-specific code from ispell.el

* lisp/textmodes/ispell.el (ispell-menu-xemacs): Remove
(ispell-menu-map-needed): Remove XEmacs-specific check.
(ispell-word): Remove XEmacs-specific extent code.
(ispell-init-process): Remove XEmacs workaround for local add-hook.
Assume we have set-process-query-on-exit-flag.
(ispell-kill-ispell, ispell-change-dictionary): Remove XEmacs
workaround for called-interactively-p.
---
 lisp/textmodes/ispell.el | 55 +++++++++---------------------------------------
 1 file changed, 10 insertions(+), 45 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index a6dd905..6a28db6 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -833,22 +833,10 @@ ispell-menu-map
 ;; Redo menu when loading ispell to get dictionary modifications
 (setq ispell-menu-map nil)
 
-;;;###autoload
-(defvar ispell-menu-xemacs nil
-  "Spelling menu for XEmacs.
-If nil when package is loaded, a standard menu will be set,
-and added as a submenu of the \"Edit\" menu.")
-
-;; Break out XEmacs menu and split into several calls to avoid having
-;; long lines in loaddefs.el.  Detect need off following constant.
-
 ;;; Set up dictionary
 ;;;###autoload
 (defvar ispell-menu-map-needed
-  ;; only needed when not version 18 and not XEmacs.
-  (and (not ispell-menu-map)
-       (not (featurep 'xemacs))
-       'reload))
+  (unless ispell-menu-map 'reload))
 
 (defvar ispell-library-directory (condition-case ()
 				     (ispell-check-version)
@@ -1932,32 +1920,20 @@ ispell-word
       (cond ((eq poss t)
 	     (or quietly
 		 (message "%s is correct"
-			  (funcall ispell-format-word-function word)))
-	     (and (featurep 'xemacs)
-		  (extent-at start)
-		  (and (fboundp 'delete-extent)
-		       (delete-extent (extent-at start)))))
+			  (funcall ispell-format-word-function word))))
 	    ((stringp poss)
 	     (or quietly
 		 (message "%s is correct because of root %s"
 			  (funcall ispell-format-word-function word)
-			  (funcall ispell-format-word-function poss)))
-	     (and (featurep 'xemacs)
-		  (extent-at start)
-		  (and (fboundp 'delete-extent)
-		       (delete-extent (extent-at start)))))
+			  (funcall ispell-format-word-function poss))))
 	    ((null poss)
 	     (message "Error checking word %s using %s with %s dictionary"
 		      (funcall ispell-format-word-function word)
 		      (file-name-nondirectory ispell-program-name)
 		      (or ispell-current-dictionary "default")))
 	    (ispell-check-only	      ; called from ispell minor mode.
-	     (if (fboundp 'make-extent)
-		 (if (fboundp 'set-extent-property)
-		     (let ((ext (make-extent start end)))
-		       (set-extent-property ext 'face ispell-highlight-face)
-		       (set-extent-property ext 'priority 2000)))
-	       (beep)
+	     (progn
+               (beep)
 	       (message "%s is incorrect"
                         (funcall ispell-format-word-function word))))
 	    (t				; prompt for correct word.
@@ -2890,10 +2866,7 @@ ispell-init-process
 		;; to avoid over and over ispell kill.
 		(window-buffer (minibuffer-selected-window))
 	      (current-buffer))
-	  ;; 'local does not automatically make hook buffer-local in XEmacs.
-	  (if (featurep 'xemacs)
-	      (make-local-hook 'kill-buffer-hook))
-	  (add-hook 'kill-buffer-hook
+          (add-hook 'kill-buffer-hook
 		    (lambda () (ispell-kill-ispell t)) nil 'local)))
 
       (if ispell-async-processp
@@ -2938,12 +2911,8 @@ ispell-init-process
       (let ((extended-char-mode (ispell-get-extended-character-mode)))
 	(if extended-char-mode		; ~ extended character mode
 	    (ispell-send-string (concat extended-char-mode "\n"))))
-      (if ispell-async-processp
-	  (if (featurep 'emacs)
-	      (set-process-query-on-exit-flag ispell-process nil)
-	    (if (fboundp 'set-process-query-on-exit-flag)
-		(set-process-query-on-exit-flag ispell-process nil)
-	      (process-kill-without-query ispell-process)))))))
+      (when ispell-async-processp
+        (set-process-query-on-exit-flag ispell-process nil)))))
 
 ;;;###autoload
 (defun ispell-kill-ispell (&optional no-error clear)
@@ -2955,9 +2924,7 @@ ispell-kill-ispell
   ;; to optimize the common cases.
   (run-hooks 'ispell-kill-ispell-hook)
   (if (or clear
-	  (if (featurep 'xemacs)
-	      (interactive-p)
-	    (called-interactively-p 'interactive)))
+	  (called-interactively-p 'interactive))
       (setq ispell-buffer-session-localwords nil))
   (if (not (and ispell-process
 		(eq (ispell-process-status) 'run)))
@@ -3006,9 +2973,7 @@ ispell-change-dictionary
 	 ;; Specified dictionary is the default already. Could reload
 	 ;; the dictionaries if needed.
 	 (ispell-internal-change-dictionary)
-	 (and (if (featurep 'xemacs)
-		  (interactive-p)
-		(called-interactively-p 'interactive))
+	 (when (called-interactively-p 'interactive)
 	      (message "No change, using %s dictionary" dict)))
 	(t				; reset dictionary!
 	 (if (or (assoc dict ispell-local-dictionary-alist)
-- 
2.7.4


[-- Attachment #12: 0012-Remove-XEmacs-specific-code-dealing-with-enable-mult.patch --]
[-- Type: text/x-patch, Size: 2152 bytes --]

From 09af64343512dfba91b132d783f0026c5ef54795 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:35:42 +0000
Subject: [PATCH 12/25] Remove XEmacs-specific code dealing with
 enable-multibyte-characters

* lisp/textmodes/ispell.el (ispell-decode-string):
(ispell-init-process):  Remove XEmacs-specific guard.
---
 lisp/textmodes/ispell.el | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 6a28db6..f0bb569 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1451,17 +1451,8 @@ ispell-current-personal-dictionary
 This is passed to the Ispell process using the `-p' switch.")
 
 (defun ispell-decode-string (str)
-  "Decodes multibyte character strings.
-Protects against bogus binding of `enable-multibyte-characters' in XEmacs."
-  ;; FIXME: enable-multibyte-characters is read-only, so bogus bindings are
-  ;; really nasty (they signal an error in Emacs): Who does that?  --Stef
-  (if (and (or (featurep 'xemacs)
-	       (and (boundp 'enable-multibyte-characters)
-		    enable-multibyte-characters))
-	   (fboundp 'decode-coding-string)
-	   (ispell-get-coding-system))
-      (decode-coding-string str (ispell-get-coding-system))
-    str))
+  "Decodes multibyte character strings."
+  (decode-coding-string str (ispell-get-coding-system)))
 
 ;; Return a string decoded from Nth element of the current dictionary.
 (defun ispell-get-decoded-string (n)
@@ -2871,11 +2862,7 @@ ispell-init-process
 
       (if ispell-async-processp
 	  (set-process-filter ispell-process 'ispell-filter))
-      ;; Protect against XEmacs bogus binding of `enable-multibyte-characters'.
-      (if (and (or (featurep 'xemacs)
-		   (and (boundp 'enable-multibyte-characters)
-			enable-multibyte-characters))
-	       (fboundp 'set-process-coding-system)
+      (if (and enable-multibyte-characters
                ;; Evidently, some people use the synchronous mode even
                ;; when async subprocesses are supported, in which case
                ;; set-process-coding-system is bound, but
-- 
2.7.4


[-- Attachment #13: 0013-Remove-XEmacs-specific-horizontal-scrollbar-handling.patch --]
[-- Type: text/x-patch, Size: 1357 bytes --]

From b2b75d836e7c70376561fafe64636d54f5b8b8c5 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:37:37 +0000
Subject: [PATCH 13/25] Remove XEmacs-specific horizontal scrollbar handling in
 ispell.el

* lisp/textmodes/ispell.el (ispell-command-loop): Remove
XEmacs-specific code.
---
 lisp/textmodes/ispell.el | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index f0bb569..8978d14 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2094,15 +2094,9 @@ ispell-command-loop
              "--  %b  --  word: " word
              "  --  dict: " (or ispell-current-dictionary "default")
              "  --  prog: " (file-name-nondirectory ispell-program-name)))
-      ;; XEmacs: no need for horizontal scrollbar in choices window
+      ;; No need for horizontal scrollbar in choices window
       (ispell-with-no-warnings
-       (and (fboundp 'set-specifier)
-	    (boundp 'horizontal-scrollbar-visible-p)
-	    (set-specifier horizontal-scrollbar-visible-p nil
-			   (cons (current-buffer) nil))))
-      (ispell-with-no-warnings
-       (and (boundp 'horizontal-scroll-bar)
-	    (setq horizontal-scroll-bar nil)))
+       (setq horizontal-scroll-bar nil))
       (erase-buffer)
       (if guess
 	  (progn
-- 
2.7.4


[-- Attachment #14: 0014-Remove-XEmacs-specific-minibuffer-handling-code-from.patch --]
[-- Type: text/x-patch, Size: 2216 bytes --]

From 3f552c07b5da309061f5e1cc3c51061aa767cd18 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:38:51 +0000
Subject: [PATCH 14/25] Remove XEmacs-specific minibuffer handling code from
 ispell.el

* lisp/textmodes/ispell.el (ispell-init-process): Assume we are not in
XEmacs.
---
 lisp/textmodes/ispell.el | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 8978d14..c2d6d60 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2794,7 +2794,7 @@ ispell-init-process
 	 (current-ispell-directory default-directory) ;FIXME: Unused?
 	 ;; The default directory for the process.
 	 ;; Use "~/" as default-directory unless using Ispell with per-dir
-	 ;; personal dictionaries and not in a minibuffer under XEmacs
+	 ;; personal dictionaries
 	 (default-directory
 	   (if (or ispell-really-aspell
 		   ispell-really-hunspell
@@ -2807,9 +2807,8 @@ ispell-init-process
 						     ".ispell_"
 						     (or dict-bname
 							 "default")))))
-		   ;; Ispell, in a minibuffer, and XEmacs
-		   (and (window-minibuffer-p)
-			(not (fboundp 'minibuffer-selected-window))))
+		   ;; Ispell, in a minibuffer
+		   (window-minibuffer-p))
 	       (expand-file-name "~/")
 	     (expand-file-name default-directory))))
     ;; Check if process needs restart
@@ -2841,12 +2840,11 @@ ispell-init-process
 
       (unless (equal ispell-process-directory (expand-file-name "~/"))
 	;; At this point, `ispell-process-directory' will be "~/" unless using
-	;; Ispell with directory-specific dicts and not in XEmacs minibuffer.
+	;; Ispell with directory-specific dicts.
 	;; If not, kill ispell process when killing buffer.  It may be in a
 	;; removable device that would otherwise become un-mountable.
 	(with-current-buffer
-	    (if (and (window-minibuffer-p)                  ;; In minibuffer
-		     (fboundp 'minibuffer-selected-window)) ;; Not XEmacs.
+	    (if (window-minibuffer-p)                  ;; In minibuffer
 		;; In this case kill ispell only when parent buffer is killed
 		;; to avoid over and over ispell kill.
 		(window-buffer (minibuffer-selected-window))
-- 
2.7.4


[-- Attachment #15: 0015-Remove-remaining-mentions-of-XEmacs-from-ispell.el.patch --]
[-- Type: text/x-patch, Size: 1465 bytes --]

From b31fbdc083786a24a1d27a0b43345e3b39586d33 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 14:39:42 +0000
Subject: [PATCH 15/25] Remove remaining mentions of XEmacs from ispell.el

* lisp/textmodes/ispell.el (ispell-valid-dictionary-list):
(ispell-add-per-file-word-list): Remove mentions of XEmacs from
comments.
---
 lisp/textmodes/ispell.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index c2d6d60..3abefdc 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1331,8 +1331,7 @@ ispell-valid-dictionary-list
   "Return a list of valid dictionaries.
 The variable `ispell-library-directory' defines their location."
   ;; Initialize variables and dictionaries alists for desired spellchecker.
-  ;; Make sure ispell.el is loaded to avoid some autoload loops in XEmacs
-  ;; (and may be others)
+  ;; Make sure ispell.el is loaded to avoid some autoload loops.
   (if (featurep 'ispell)
       (ispell-set-spellchecker-params))
 
@@ -4189,6 +4188,6 @@ ispell-add-per-file-word-list
 ; LocalWords:  minipage pers dict unhighlight buf grep sync prev inc
 ; LocalWords:  fn oldot NB AIX msg init read's bufs pt cmd Quinlan eg
 ; LocalWords:  uuencoded unidiff sc nn VM SGML eval IspellPersDict
-; LocalWords:  lns XEmacs HTML casechars Multibyte
+; LocalWords:  lns HTML casechars Multibyte
 
 ;;; ispell.el ends here
-- 
2.7.4


[-- Attachment #16: 0016-Remove-support-for-old-versions-of-supercite-and-GNU.patch --]
[-- Type: text/x-patch, Size: 1484 bytes --]

From d55218f14ff514d770def03be1f3a8553419a869 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 19:20:19 +0000
Subject: [PATCH 16/25] Remove support for old versions of supercite and GNUS
 from ispell.el

* lisp/textmodes/ispell.el (ispell-message): Require supercite >= 3.0
and GNUS >= 5.  Not exactly the bleeding edge!
---
 lisp/textmodes/ispell.el | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 3abefdc..2f91ec2 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -3866,16 +3866,11 @@ ispell-message
 	       "   \\|\t"))
 	   (cite-regexp			;Prefix of quoted text
 	    (cond
-	     ((functionp 'sc-cite-regexp)	; sc 3.0
+	     ((functionp 'sc-cite-regexp)	; supercite >= 3.0
 	      (ispell-with-no-warnings
 	       (concat "\\(" (sc-cite-regexp) "\\)" "\\|"
 		       (ispell-non-empty-string sc-reference-tag-string))))
-	     ((boundp 'sc-cite-regexp)		; sc 2.3
-	      (concat "\\(" sc-cite-regexp "\\)" "\\|"
-		      (ispell-with-no-warnings
-		       (ispell-non-empty-string sc-reference-tag-string))))
-	     ((or (equal major-mode 'news-reply-mode) ;GNUS 4 & below
-		  (equal major-mode 'message-mode))   ;GNUS 5
+	     ((equal major-mode 'message-mode)  ; GNUS >= 5
 	      (concat "In article <" "\\|"
 		      "[^,;&+=\n]+ <[^,;&+=]+> writes:" "\\|"
 		      (ispell-with-no-warnings message-cite-prefix-regexp)
-- 
2.7.4


[-- Attachment #17: 0017-Remove-unused-constant.patch --]
[-- Type: text/x-patch, Size: 924 bytes --]

From 54a2a7c445c8a2086a53331f348410b31c63d3a0 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 21:47:02 +0000
Subject: [PATCH 17/25] Remove unused constant

* lisp/textmodes/ispell.el (ispell-required-version): Remove.
---
 lisp/textmodes/ispell.el | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 2f91ec2..b3fee99 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -673,10 +673,6 @@ ispell-dicts-name2locale-equivs-alist
 
 
 
-;; The version must be 3.1 or greater for this version of ispell.el
-;; There is an incompatibility between version 3.1.12 and lower versions.
-(defconst ispell-required-version '(3 1 12)
-  "Ispell versions with which this version of ispell.el is known to work.")
 (defvar ispell-offset -1
   "Offset that maps protocol differences between ispell 3.1 versions.")
 
-- 
2.7.4


[-- Attachment #18: 0018-Remove-support-for-ispell-3.1.12.patch --]
[-- Type: text/x-patch, Size: 1795 bytes --]

From 47fd7e922a8640d1bb3139f64f30049b4778fbcc Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 21:50:18 +0000
Subject: [PATCH 18/25] Remove support for ispell < 3.1.12

* lisp/textmodes/ispell.el (ispell-offset): Remove.
(ispell-check-version): Require ispell >= 3.1.12, released in 1994.
(ispell-process-line): No longer use ispell-offset.
---
 lisp/textmodes/ispell.el | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index b3fee99..412e838 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -673,9 +673,6 @@ ispell-dicts-name2locale-equivs-alist
 
 
 
-(defvar ispell-offset -1
-  "Offset that maps protocol differences between ispell 3.1 versions.")
-
 (defconst ispell-version "ispell.el 3.6 - 7-Jan-2003")
 
 
@@ -758,13 +755,10 @@ ispell-check-version
 
       (let ((aspell-minver    "0.50")
 	    (aspell8-minver   "0.60")
-	    (ispell0-minver   "3.1.0")
 	    (ispell-minver    "3.1.12")
 	    (hunspell8-minver "1.1.6"))
 
-	(if (version<= ispell0-minver ispell-program-version)
-	    (or (version<= ispell-minver ispell-program-version)
-		(setq ispell-offset 0))
+	(unless (version<= ispell-minver ispell-program-version)
 	  (error "%s release %s or greater is required"
 		 ispell-program-name
 		 ispell-minver))
@@ -3360,7 +3354,7 @@ ispell-process-line
 	  ;; Markers can move with highlighting!  This destroys
 	  ;; end of region markers line-end and ispell-region-end
 	  (let ((word-start
-		 (copy-marker (+ ispell-start ispell-offset (car (cdr poss)))))
+		 (copy-marker (+ ispell-start (car (cdr poss)))))
 		(word-len (length (car poss)))
 		(line-end (copy-marker ispell-end))
 		(line-start (copy-marker ispell-start))
-- 
2.7.4


[-- Attachment #19: 0019-Remove-boundp-test-for-always-bound-symbol.patch --]
[-- Type: text/x-patch, Size: 1134 bytes --]

From 7fafe3684f9ce4301596b846347e916cc0ced1cb Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 21:55:19 +0000
Subject: [PATCH 19/25] Remove boundp test for always-bound symbol
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/textmodes/ispell.el (ispell-message): mail-yank-prefix is
defvar’d at the top of the file, so remove a test to see if it is
bound.
---
 lisp/textmodes/ispell.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 412e838..894e2ea 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -3851,8 +3851,7 @@ ispell-message
 		       (point-max)))
 		    (t (min (point-max) (funcall ispell-message-text-end))))))
 	   (default-prefix   ; Vanilla cite prefix (just used for cite-regexp)
-	     (if (and (boundp 'mail-yank-prefix) mail-yank-prefix)
-		 (ispell-non-empty-string mail-yank-prefix)
+	     (if (ispell-non-empty-string mail-yank-prefix)
 	       "   \\|\t"))
 	   (cite-regexp			;Prefix of quoted text
 	    (cond
-- 
2.7.4


[-- Attachment #20: 0020-Remove-meaningless-defconst-ispell-version.patch --]
[-- Type: text/x-patch, Size: 1972 bytes --]

From 2e015c185d648242e18330d667a92773b9f3b40a Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 21:58:00 +0000
Subject: [PATCH 20/25] Remove meaningless defconst ispell-version
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/textmodes/ispell.el (ispell-version): Since ispell.el is now
firmly part of Emacs, and the version hasn’t changed since 2003, and
isn’t used anywhere, remove it.  3rd-party code can better use the
Emacs version, or feature or function checks.
(ispell-check-version): No longer report ispell.el version.
---
 lisp/textmodes/ispell.el | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 894e2ea..398e83e 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -671,11 +671,6 @@ ispell-dicts-name2locale-equivs-alist
 ;;; The following are used by ispell, and should not be changed.
 ;;; **********************************************************************
 
-
-
-(defconst ispell-version "ispell.el 3.6 - 7-Jan-2003")
-
-
 (defun ispell-check-version (&optional interactivep)
   "Ensure that `ispell-program-name' is valid and has the correct version.
 Returns version number if called interactively.
@@ -710,13 +705,11 @@ ispell-check-version
 		      (if (string-match "\\`aspell" speller) "-v" "-vv"))))
       (goto-char (point-min))
       (if interactivep
-	  ;; Report version information of ispell and ispell.el
+	  ;; Report version information of ispell
 	  (progn
 	    (end-of-line)
-	    (setq result (concat (buffer-substring-no-properties (point-min)
-								 (point))
-				 ", "
-				 ispell-version))
+	    (setq result (buffer-substring-no-properties (point-min)
+                                                         (point)))
 	    (message "%s" result))
 	;; return LIBDIR or LIBRARYVAR (overrides LIBDIR) env.
 	(progn
-- 
2.7.4


[-- Attachment #21: 0021-Remove-XEmacs-specific-ispell-with-no-warnings.patch --]
[-- Type: text/x-patch, Size: 2382 bytes --]

From 43e42968990a2071262448201f455650dddb43a4 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Sun, 4 Dec 2016 22:01:56 +0000
Subject: [PATCH 21/25] Remove XEmacs-specific ispell-with-no-warnings

* lisp/textmodes/ispell.el (ispell-with-no-warnings): Remove this
defmacro, needed only for XEmacs.
(ispell-command-loop, ispell-message): Use with-no-warnings directly.
---
 lisp/textmodes/ispell.el | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 398e83e..c55d316 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -118,10 +118,6 @@
 ;;  Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r)
 ;;    can cause misalignment errors.
 
-;;; XEmacs21 does not have `with-no-warnings'. Taken from org mode.
-(defmacro ispell-with-no-warnings (&rest body)
-  (cons (if (fboundp 'with-no-warnings) 'with-no-warnings 'progn) body))
-
 ;;; Code:
 
 (eval-when-compile (require 'cl-lib))
@@ -2077,7 +2073,7 @@ ispell-command-loop
              "  --  dict: " (or ispell-current-dictionary "default")
              "  --  prog: " (file-name-nondirectory ispell-program-name)))
       ;; No need for horizontal scrollbar in choices window
-      (ispell-with-no-warnings
+      (with-no-warnings
        (setq horizontal-scroll-bar nil))
       (erase-buffer)
       (if guess
@@ -3849,18 +3845,18 @@ ispell-message
 	   (cite-regexp			;Prefix of quoted text
 	    (cond
 	     ((functionp 'sc-cite-regexp)	; supercite >= 3.0
-	      (ispell-with-no-warnings
+	      (with-no-warnings
 	       (concat "\\(" (sc-cite-regexp) "\\)" "\\|"
 		       (ispell-non-empty-string sc-reference-tag-string))))
 	     ((equal major-mode 'message-mode)  ; GNUS >= 5
 	      (concat "In article <" "\\|"
 		      "[^,;&+=\n]+ <[^,;&+=]+> writes:" "\\|"
-		      (ispell-with-no-warnings message-cite-prefix-regexp)
+		      (with-no-warnings message-cite-prefix-regexp)
 		      "\\|"
 		      default-prefix))
 	     ((equal major-mode 'mh-letter-mode) ; mh mail message
 	      (concat "[^,;&+=\n]+ writes:" "\\|"
-		      (ispell-with-no-warnings
+		      (with-no-warnings
 		       (ispell-non-empty-string mh-ins-buf-prefix))))
 	     ((not internal-messagep)	; Assume nn sent us this message.
 	      (concat "In [a-zA-Z.]+ you write:" "\\|"
-- 
2.7.4


[-- Attachment #22: 0022-Remove-unused-variable.patch --]
[-- Type: text/x-patch, Size: 951 bytes --]

From 803a92d85111bc450ca21f6d599de2563c422226 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Mon, 5 Dec 2016 21:11:52 +0000
Subject: [PATCH 22/25] Remove unused variable

* lisp/textmodes/ispell.el (current-ispell-directory): Remove.
---
 lisp/textmodes/ispell.el | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index c55d316..6733c75 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2768,8 +2768,6 @@ ispell-init-process
   (let* (;; Basename of dictionary used by the spell-checker
 	 (dict-bname (or (car (cdr (member "-d" (ispell-get-ispell-args))))
 			 ispell-current-dictionary))
-	 ;; The directory where process was started.
-	 (current-ispell-directory default-directory) ;FIXME: Unused?
 	 ;; The default directory for the process.
 	 ;; Use "~/" as default-directory unless using Ispell with per-dir
 	 ;; personal dictionaries
-- 
2.7.4


[-- Attachment #23: 0023-Minor-docstring-and-comment-fixes-to-ispell.el.patch --]
[-- Type: text/x-patch, Size: 1502 bytes --]

From 5af3d9d654661cac17ba45e110392be2b7f76272 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Tue, 13 Dec 2016 00:30:51 +0000
Subject: [PATCH 23/25] Minor docstring and comment fixes to ispell.el

lisp/textmodes/ispell.el (ispell-aspell-dictionary-alist): Mention
ispell-aspell-dictionary-alist, not ispell-dictionary-alist.
(ispell-set-spellchecker-params): Change double-single quotes to
single single quotes in comment.
---
 lisp/textmodes/ispell.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 6733c75..c45b620 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -837,7 +837,7 @@ ispell-aspell-dictionary-alist
 Internal use.")
 
 (defun ispell-find-aspell-dictionaries ()
-  "Find Aspell's dictionaries, and record in `ispell-dictionary-alist'."
+  "Find Aspell's dictionaries, and record in `ispell-aspell-dictionary-alist'."
   (unless (and ispell-really-aspell ispell-encoding8-command)
     (error "This function only works with Aspell >= 0.60"))
   (let* ((dictionaries
@@ -1277,7 +1277,7 @@ ispell-set-spellchecker-params
 
       (run-hooks 'ispell-initialize-spellchecker-hook)
 
-      ;; Add dicts to ``ispell-dictionary-alist'' unless already present.
+      ;; Add dicts to `ispell-dictionary-alist' unless already present.
       (dolist (dict (append found-dicts-alist
 			    ispell-base-dicts-override-alist
 			    ispell-dictionary-base-alist))
-- 
2.7.4


[-- Attachment #24: 0024-Remove-support-for-aspell-0.60-from-2004.patch --]
[-- Type: text/x-patch, Size: 2820 bytes --]

From 8c70e8715505f9f4e6ad99d48a931986b1d13853 Mon Sep 17 00:00:00 2001
From: Reuben Thomas <rrt@sc3d.org>
Date: Tue, 13 Dec 2016 00:43:21 +0000
Subject: [PATCH 24/25] Remove support for aspell < 0.60 (from 2004)

lisp/textmodes/ispell.el (ispell-check-version): Require Aspell 0.60.
(ispell-aspell-dictionary-alist): Remove check that we have Aspell 0.60.
---
 lisp/textmodes/ispell.el | 35 ++++++++++++++++-------------------
 1 file changed, 16 insertions(+), 19 deletions(-)

diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index c45b620..37a6ffc 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -727,8 +727,7 @@ ispell-check-version
 
 	;; Make sure these variables are (re-)initialized to the default value
 	(setq ispell-really-aspell nil
-	      ispell-aspell-supports-utf8 nil
-	      ispell-really-hunspell nil
+              ispell-really-hunspell nil
 	      ispell-encoding8-command nil)
 
 	(goto-char (point-min))
@@ -742,24 +741,24 @@ ispell-check-version
                         nil t)
 		       (match-string 1)))))
 
-      (let ((aspell-minver    "0.50")
-	    (aspell8-minver   "0.60")
-	    (ispell-minver    "3.1.12")
-	    (hunspell8-minver "1.1.6"))
-
-	(unless (version<= ispell-minver ispell-program-version)
-	  (error "%s release %s or greater is required"
-		 ispell-program-name
-		 ispell-minver))
+      (let* ((aspell8-minver   "0.60")
+             (ispell-minver    "3.1.12")
+             (hunspell8-minver "1.1.6")
+             (minver (cond
+                      ((not (version<= ispell-minver ispell-program-version))
+                       ispell-minver)
+                      ((and ispell-really-aspell
+                            (not (version<= aspell8-minver ispell-really-aspell)))
+                       aspell8-minver))))
+
+        (if minver
+	    (error "%s release %s or greater is required"
+                   ispell-program-name
+                   minver))
 
 	(cond
 	 (ispell-really-aspell
-	  (if (version<= aspell-minver ispell-really-aspell)
-	      (if (version<= aspell8-minver ispell-really-aspell)
-		  (progn
-		    (setq ispell-aspell-supports-utf8 t)
-		    (setq ispell-encoding8-command "--encoding=")))
-	    (setq ispell-really-aspell nil)))
+	  (setq ispell-encoding8-command "--encoding="))
 	 (ispell-really-hunspell
 	  (if (version<= hunspell8-minver ispell-really-hunspell)
 	      (setq ispell-encoding8-command "-i")
@@ -838,8 +837,6 @@ ispell-aspell-dictionary-alist
 
 (defun ispell-find-aspell-dictionaries ()
   "Find Aspell's dictionaries, and record in `ispell-aspell-dictionary-alist'."
-  (unless (and ispell-really-aspell ispell-encoding8-command)
-    (error "This function only works with Aspell >= 0.60"))
   (let* ((dictionaries
 	  (split-string
 	   (with-temp-buffer
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* bug#25107: Acknowledgement (Patches to clean up ispell.el)
  2016-12-13  0:55                       ` Reuben Thomas
@ 2016-12-13 16:29                         ` Eli Zaretskii
  2016-12-13 19:07                           ` Reuben Thomas
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2016-12-13 16:29 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 25107

> From: Reuben Thomas <rrt@sc3d.org>
> Date: Tue, 13 Dec 2016 00:55:55 +0000
> Cc: 25107@debbugs.gnu.org
> 
> One final update to this patch series: I added a patch to remove support for aspell < 0.60 (released in 2004).

Any difference from the last time that would justify reading these
again?

Thanks.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#25107: Acknowledgement (Patches to clean up ispell.el)
  2016-12-13 16:29                         ` Eli Zaretskii
@ 2016-12-13 19:07                           ` Reuben Thomas
  2016-12-13 19:29                             ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Reuben Thomas @ 2016-12-13 19:07 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25107

[-- Attachment #1: Type: text/plain, Size: 476 bytes --]

On 13 December 2016 at 16:29, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Reuben Thomas <rrt@sc3d.org>
> > Date: Tue, 13 Dec 2016 00:55:55 +0000
> > Cc: 25107@debbugs.gnu.org
> >
> > One final update to this patch series: I added a patch to remove support
> for aspell < 0.60 (released in 2004).
>
> Any difference from the last time that would justify reading these
> again?
>

​Only the one new patch (the last in the series).

-- 
http://rrt.sc3d.org

[-- Attachment #2: Type: text/html, Size: 1165 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#25107: Acknowledgement (Patches to clean up ispell.el)
  2016-12-13 19:07                           ` Reuben Thomas
@ 2016-12-13 19:29                             ` Eli Zaretskii
  2016-12-13 19:45                               ` Reuben Thomas
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2016-12-13 19:29 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 25107

> From: Reuben Thomas <rrt@sc3d.org>
> Date: Tue, 13 Dec 2016 19:07:40 +0000
> Cc: 25107@debbugs.gnu.org
> 
>  > One final update to this patch series: I added a patch to remove support for aspell < 0.60 (released in
>  2004).
> 
>  Any difference from the last time that would justify reading these
>  again?
> 
> ​Only the one new patch (the last in the series).

That one is fine with me, thanks.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#25107: Acknowledgement (Patches to clean up ispell.el)
  2016-12-13 19:29                             ` Eli Zaretskii
@ 2016-12-13 19:45                               ` Reuben Thomas
  0 siblings, 0 replies; 17+ messages in thread
From: Reuben Thomas @ 2016-12-13 19:45 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25107

[-- Attachment #1: Type: text/plain, Size: 588 bytes --]

On 13 December 2016 at 19:29, Eli Zaretskii <eliz@gnu.org> wrote:

> > From: Reuben Thomas <rrt@sc3d.org>
> > Date: Tue, 13 Dec 2016 19:07:40 +0000
> > Cc: 25107@debbugs.gnu.org
> >
> >  > One final update to this patch series: I added a patch to remove
> support for aspell < 0.60 (released in
> >  2004).
> >
> >  Any difference from the last time that would justify reading these
> >  again?
> >
> > ​Only the one new patch (the last in the series).
>
> That one is fine with me, thanks.
>

​Great! I have pushed the patch series.​

-- 
http://rrt.sc3d.org

[-- Attachment #2: Type: text/html, Size: 1283 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#25107:
  2016-12-04 17:10 bug#25107: Patches to clean up ispell.el Reuben Thomas
       [not found] ` <handler.25107.B.148087148014808.ack@debbugs.gnu.org>
@ 2016-12-13 19:45 ` Reuben Thomas
  1 sibling, 0 replies; 17+ messages in thread
From: Reuben Thomas @ 2016-12-13 19:45 UTC (permalink / raw)
  To: 25107-done

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: Type: text/html, Size: 22 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-12-13 19:45 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-04 17:10 bug#25107: Patches to clean up ispell.el Reuben Thomas
     [not found] ` <handler.25107.B.148087148014808.ack@debbugs.gnu.org>
2016-12-04 22:11   ` bug#25107: Acknowledgement (Patches to clean up ispell.el) Reuben Thomas
2016-12-05 21:38     ` Reuben Thomas
2016-12-06 15:51       ` Eli Zaretskii
2016-12-06 16:20         ` Reuben Thomas
2016-12-06 16:37           ` Eli Zaretskii
2016-12-06 17:46             ` Reuben Thomas
2016-12-06 18:01               ` Eli Zaretskii
2016-12-06 18:11                 ` Reuben Thomas
2016-12-06 18:41                   ` Eli Zaretskii
2016-12-06 21:58                     ` Reuben Thomas
2016-12-13  0:55                       ` Reuben Thomas
2016-12-13 16:29                         ` Eli Zaretskii
2016-12-13 19:07                           ` Reuben Thomas
2016-12-13 19:29                             ` Eli Zaretskii
2016-12-13 19:45                               ` Reuben Thomas
2016-12-13 19:45 ` bug#25107: Reuben Thomas

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).