Anonymous committed 9f100c0

version 3.0

Comments (0)

Files changed (3)

+1998-03-21  SL Baur  <>
+	* ispell.el-3.0
+1998-03-09  Carsten Leonhardt  <>
+	* ispell.el: don't try to set up menus in XEmacs if they are not
+ 	supported
 1998-02-25  SL Baur  <>
 	* ispell.texi: add direntry section.
 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 # Boston, MA 02111-1307, USA.
-VERSION = 1.06
+VERSION = 1.07
 MAINTAINER = XEmacs Development Team <>
 PACKAGE = ispell
 PKG_TYPE = regular
 ;;; Authors         : Ken Stevens <>
-;;; Last Modified On: Wed Nov 12 03:08:53 1997
-;;; Update Revision : 3.0 beta
+;;; Last Modified On: Fri Mar 20 13:25:59 PST 1998
+;;; Update Revision : 3.0
 ;;; Syntax          : emacs-lisp
 ;;; Status          : Release with 3.1.12+ ispell.
 ;;; Version         : International Ispell Version 3.1 by Geoff Kuenning.
 ;;;   ispell-region
 ;;;   ispell-buffer
 ;;;   ispell-message
+;;;   ispell-comments-and-strings
 ;;;   ispell-continue
 ;;;   ispell-complete-word
 ;;;   ispell-complete-word-interior-frag
-;;; Revision 3.0  1997/11/12 03:08:53	stevens
+;;; I pruned this changelog before 1995 to only include major milestones.  kss
+;;; Revision 3.0  1998/3/20 13:25:59	stevens
 ;;; Recursive editing now supported.  Castellano dictionary entry added.
 ;;; Cleanup documentation, ispell-word, ispell-minor-mode,
 ;;; and buffer-local definition searches. Added electric-help.
 ;;; uses framepop.  ispell-skip-sgml locally set by buffer-mode.
 ;;; replaced \b with \< and \> for bug on some machines.
 ;;; restored emacs-18 support, buffer-local-words more robust.
-;;; check-ispell-version prints loaded versions, xemacs modeline hiding
+;;; check-ispell-version prints loaded versions, XEmacs modeline hiding
 ;;; American dictionary added, added error interaction in process.
 ;;; fixed skipping error in ispell-message, improved sgml skipping (Dave Love)
 ;;; Message dictionary selection (Christoph Wedler)
 ;;; fixed alignment error in ispell-process-line (error as 1st word, menu)
 ;;; support unsplitable frames, skip everything but comments
 ;;; ispell message body now checked as one region (Ethan Bradford)
-;;; added customize support
+;;; added customize support.  Windowing fixed for long lines (Dirk Froembgen)
+;;; loop problem with ispell-word fixed. Cleaned up tex reg. skipping (Wedler)
+;;; New fn ispell-comments-and-strings (Gerd Moellmann)
 ;;; Revision 2.37  1995/6/13 12:05:28	stevens
 ;;; Removed autoload from ispell-dictionary-alist. *choices* mode-line shows
 ;;; misspelled word.  Block skip for pgp & forwarded messages added.
 ;;; Skips SGML tags, ispell-change-dictionary fix for add-hook, assure personal
 ;;; dictionary is saved when called from the menu
-;;; Revision 2.34  1994/12/08 13:17:41  stevens
-;;; Interaction corrected to function with all 3.1 ispell versions.
-;;; Revision 2.33  1994/11/24 02:31:20  stevens
-;;; Repaired bug introduced in 2.32 that corrupts buffers when correcting.
-;;; Improved buffer scrolling. Non-destructive buffer selections allowed.
-;;; Revision 2.32  1994/10/31 21:10:08  geoff
-;;; Many revisions accepted from RMS/FSF.  I think (though I don't know) that
-;;; this represents an 'official' version.
-;;; Revision 2.31  1994/5/31 10:18:17  stevens
-;;; Repaired comments.  buffer-local commands executed in `ispell-word' now.
-;;; German dictionary described for extended character mode.  Dict messages.
-;;; Revision 2.30  1994/5/20 22:18:36  stevens
-;;; Continue ispell from ispell-word, C-z functionality fixed.
-;;; Revision 2.29  1994/5/12 09:44:33  stevens
-;;; Restored ispell-use-ptys-p, ispell-message aborts sends with interrupt.
-;;; defined function ispell
-;;; Revision 2.28  1994/4/28 16:24:40  stevens
-;;; Window checking when ispell-message put on gnus-inews-article-hook jwz.
-;;; prefixed ispell- to highlight functions and horiz-scroll function.
-;;; Try and respect case of word in ispell-complete-word.
-;;; Ignore non-char events.  Ispell-use-ptys-p commented out. Lucid menu.
-;;; Better interrupt handling.  ispell-message improvements from Ethan.
-;;; Revision 2.27
-;;; version 18 explicit C-g handling disabled as it didn't work. Added
-;;; ispell-extra-args for ispell customization (jwz)
 ;;; Revision 2.26  1994/2/15 16:11:14  stevens
-;;; name changes for copyright assignment.  Added word-frags in complete-word.
-;;; Horizontal scroll (John Conover). Query-replace matches words now.  bugs.
-;;; Revision 2.25
-;;; minor mods, upgraded ispell-message
-;;; Revision 2.24
-;;; query-replace more robust, messages, defaults, ispell-change-dict.
-;;; Revision 2.23  1993/11/22 23:47:03  stevens
-;;; ispell-message, Fixed highlighting, added menu-bar, fixed ispell-help, ...
-;;; Revision 2.22
-;;; Added 'u' command.  Fixed default in ispell-local-dictionary.
-;;; fixed affix rules display.  Tib skipping more robust.  Contributions by
-;;; Per Abraham (parser selection), Denis Howe, and Eberhard Mattes.
-;;; Revision 2.21  1993/06/30 14:09:04  stevens
-;;; minor bugs. (nroff word skipping fixed)
+;;; ispell.el rights assigned to copyleft.
 ;;; Revision 2.20  1993/06/30 14:09:04  stevens
+;;; Major update including many tweaks.
-;;; Debugging and contributions by: Boris Aronov, Rik Faith, Chris Moore,
-;;;  Kevin Rodgers, Malcolm Davis.
-;;; Particular thanks to Michael Lipp, Jamie Zawinski, Phil Queinnec
-;;;  and John Heidemann for suggestions and code.
-;;; Major update including many tweaks.
-;;; Many changes were integrations of suggestions.
-;;; lookup-words rehacked to use call-process (Jamie).
-;;; ispell-complete-word rehacked to be compatible with the rest of the
-;;; system for word searching and to include multiple wildcards,
-;;; and its own dictionary.
-;;; query-replace capability added.  New options 'X', 'R', and 'A'.
-;;; buffer-local modes for dictionary, word-spelling, and formatter-parsing.
-;;; Many random bugs, like commented comments being skipped, fix to
-;;; keep-choices-win, fix for math mode, added pipe mode choice,
-;;; fixed 'q' command, ispell-word checks previous word and leave cursor
-;;; in same location.  Fixed tib code which could drop spelling regions.
-;;; Cleaned up setq calls for efficiency. Gave more context on window overlays.
-;;; Assure context on ispell-command-loop.  Window lossage in look cmd fixed.
-;;; Due to pervasive opinion, common-lisp package syntax removed. Display
-;;; problem when not highlighting. skip special keywords when checking comments
+;;; Tue Jan  3 16:59:07 PST 1989  Ken Stevens
+;;; version 2.1.
-;;; Revision 2.19  1992/01/10  10:54:08  geoff
-;;; Make another attempt at fixing the "Bogus, dude" problem.  This one is
-;;; less elegant, but has the advantage of working.
-;;; Revision 2.18  1992/01/07  10:04:52  geoff
-;;; Fix the "Bogus, Dude" problem in ispell-word.
-;;; Revision 2.17  1991/09/12  00:01:42  geoff
-;;; Add some changes to make ispell-complete-word work better, though
-;;; still not perfectly.
-;;; Revision 2.16  91/09/04  18:00:52  geoff
-;;; More updates from Sebastian, to make the multiple-dictionary support
-;;; more flexible.
-;;; Revision 2.15  91/09/04  17:30:02  geoff
-;;; tib support (Sebastian Kremer)
-;;; Revision 2.14  91/09/04  16:19:37  geoff
-;;; Don't do set-window-start if the move-to-window-line moved us
-;;; downward, rather than upward.  This prevents getting the buffer all
-;;; confused.  Also, don't use the "not-modified" function to clear the
-;;; modification flag;  instead use set-buffer-modified-p.  This prevents
-;;; extra messages from flashing.
-;;; Revision 2.13  91/09/04  14:35:41  geoff
-;;; Fix a spelling error in a comment.  Add code to handshake with the
-;;; ispell process before sending anything to it.
-;;; Revision 2.12  91/09/03  20:14:21  geoff
-;;; Add multiple-language support (Sebastian Kremer)
-;;; Original ispell.el by Walt Buehring
+;;; Sun May 10 11:45:04 NZST 1987
+;;; extensively modified by Mark Davies and Andrew Vignaux
 ;;; Tue Jan 13 20:18:02 CST 1987 (Perry Smith)
 ;;; ispell-region 
-;;; Sun May 10 11:45:04 NZST 1987
-;;; extensively modified by Mark Davies and Andrew Vignaux
-;;; Tue Jan  3 16:59:07 PST 1989  Ken Stevens
-;;; This file has received a major overhaul to be compatible with ispell
-;;; version 2.1.  Most of the functions have been totally rewritten, and
-;;; many user-accessible variables have been added.  The syntax table has
-;;; been removed since it didn't work properly anyway, and a filter is
-;;; used rather than a buffer.  Regular expressions are used based on
-;;; ispell's internal definition of characters (see ispell(4)).
-;;; Some new updates:
-;;; - Updated to version 3.0 to include terse processing.
-;;; - Added a variable for the look command.
-;;; - Fixed a bug in ispell-word when cursor is far away from the word
-;;;   that is to be checked.
-;;; - Ispell places the incorrect word or guess in the minibuffer now.
-;;; - fixed a bug with 'l' option when multiple windows are on the screen.
-;;; - lookup-words just didn't work with the process filter.  Fixed.
-;;; - Rewrote the process filter to make it cleaner and more robust
-;;;   in the event of a continued line not being completed.
-;;; - Made ispell-init-process more robust in handling errors.
-;;; - Fixed bug in continuation location after a region has been modified by
-;;;   correcting a misspelling.
-;;; Wed Aug  7 14:02:17 MET DST 1991 Sebastian Kremer
-;;; - Ported ispell-complete-word from Ispell 2 to Ispell 3.
-;;; - Added ispell-kill-ispell command.
-;;; - Added ispell-dictionary and ispell-dictionary-alist variables to
-;;;   support other than default language.  See their docstrings and
-;;;   command ispell-change-dictionary.
-;;; - Added ispell-skip-tib variable to support the tib bibliography
-;;;   program.
+;;; Original ispell.el by Walt Buehring
   :type 'function
   :group 'ispell)
-(defcustom ispell-use-framepop-p (and window-system
-				   (condition-case () (require 'framepop)
-				     (error nil)))
-  "When non-nil ispell uses framepop to display choices in a dedicated frame."
+(defcustom ispell-use-framepop-p nil
+  "When non-nil ispell uses framepop to display choices in a dedicated frame.
+You can set this variable to dynamically use framepop if you are in a
+window system by evaluating the following on startup to set this variable:
+  (and window-system (condition-case () (require 'framepop) (error nil)))"
   :type 'boolean
   :group 'ispell)
 ;;; because otherwise this file gets autoloaded every time Emacs starts
 ;;; so that it can set up the menus and determine keyboard equivalents.
+;;; split dictionary so line length is smaller in loaddefs.el
-(defcustom ispell-dictionary-alist
+(defvar ispell-dictionary-alist-1
   '((nil				; default (English.aff)
      "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil nil)
     ("american"				; make English explicitly selectable
     ("castellano"                      ; Spanish mode
-     "[---]" nil ("-B" "-dcastellano") "~tex" iso-latin-1)
+     "[---]" nil ("-B" "-d" "castellano") "~tex" iso-latin-1)
     ("castellano8"                      ; 8 bit Spanish mode
-     "[---]" nil ("-B" "-dcastellano") "~latin1" iso-latin-1)
+     "[---]" nil ("-B" "-d" "castellano") "~latin1" iso-latin-1)
+    ("czech" 
+     "[A-Za-z\301\311\314\315\323\332\331\335\256\251\310\330\317\253\322\341\351\354\355\363\372\371\375\276\271\350\370\357\273\362]"
+     "[^A-Za-z\301\311\314\315\323\332\331\335\256\251\310\330\317\253\322\341\351\354\355\363\372\371\375\276\271\350\370\357\273\362]"
+     "" nil ("-B" "-d" "czech") nil iso-latin-2)
     ("dansk"				; Dansk.aff
      "[A-Z\306\330\305a-z\346\370\345]" "[^A-Z\306\330\305a-z\346\370\345]"
      "[']" nil ("-C") nil iso-latin-1)
      "[']" t ("-C" "-d" "deutsch") "~latin1" iso-latin-1)
     ("english"				; make English explicitly selectable
-     "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil nil)
-    ("esperanto"
+     "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil nil))
+  "First half of dictionary, shorteded for loaddefs.el")
+(defvar ispell-dictionary-alist-2
+  '(("esperanto"
      "[-']" t ("-C") "~latin3" nil)
      "[']" nil ("-C" "-d" "norsk") "~list" nil)
+    ("russian"				; russian.aff (KOI8-R charset)
+     "[\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321]"
+     "[^\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321]"
+     "[']" t ("-C" "-d" "russian") "~latin1" iso-latin-1)
     ("svenska"				;7 bit Swedish mode
      "[A-Za-z}{|\\133\\135\\\\]" "[^A-Za-z}{|\\133\\135\\\\]"
      "[']" nil ("-C") nil nil)
      "[A-Za-z\345\344\366\305\304\366]"  "[^A-Za-z\345\344\366\305\304\366]"
      "[']" nil ("-C" "-d" "svenska") "~list" ; Add `"-T" "list"' instead?
+  "Second half of dictionary, shorteded for loaddefs.el")
+;;; The preparation of the menu bar menu must be autoloaded
+;;; because otherwise this file gets autoloaded every time Emacs starts
+;;; so that it can set up the menus and determine keyboard equivalents.
+(defcustom ispell-dictionary-alist
+  (append ispell-dictionary-alist-1 ispell-dictionary-alist-2)
   "An alist of dictionaries and their associated parameters.
 Each element of this list is also a list:
-DICTIONARY-NAME is a possible value of variable `ispell-dictionary', nil
-means the default dictionary.
+DICTIONARY-NAME is a possible string value of variable `ispell-dictionary',
+nil means the default dictionary.
 CASECHARS is a regular expression of valid characters that comprise a
 NOT-CASECHARS is the opposite regexp of CASECHARS.
-OTHERCHARS are characters in the NOT-CASECHARS set but which can be used to
-construct words in some special way.  If OTHERCHARS characters follow and
-precede characters from CASECHARS, they are parsed as part of a word,
+OTHERCHARS is a regexp of characters in the NOT-CASECHARS set but which can be
+used to construct words in some special way.  If OTHERCHARS characters follow
+and precede characters from CASECHARS, they are parsed as part of a word,
 otherwise they become word-breaks.  As an example in English, assume the
-set ['] (as a regular expression) for OTHERCHARS.  Then \"they're\" and
+regular expression \"[']\" for OTHERCHARS.  Then \"they're\" and
 \"Steven's\" are parsed as single words including the \"'\" character, but
 \"Stevens'\" does not include the quote character as part of the word.
-If you want OTHERCHARS to be empty, use nil.
+If you want OTHERCHARS to be empty, use the empty string.
 Hint: regexp syntax requires the hyphen to be declared first here.
 MANY-OTHERCHARS-P is non-nil when multiple OTHERCHARS are allowed in a word.
 Note that the CASECHARS and OTHERCHARS slots of the alist should
 contain the same character set as casechars and otherchars in the
 language.aff file \(e.g., english.aff\)."
-  :type '(repeat (list (choice (string :tag "dictionary name")
+  :type '(repeat (list (choice :tag "Dictionary"
+			       (string :tag "Dictionary name")
 			       (const :tag "default" nil))
-		       (regexp :tag "case characters")
+		       (regexp :tag "Case characters")
 		       (regexp :tag "Non case characters")
-		       (regexp :tag "other characters")
-		       (boolean :tag "many other characters")
-		       (repeat (string :tag "ispell command line arguments"))
-		       (choice (const "~tex") (const "~list") (const "~nroff")
+		       (regexp :tag "Other characters")
+		       (boolean :tag "Many other characters")
+		       (repeat :tag "Ispell command line args"
+			       (string :tag "Arg"))
+		       (choice :tag "Extended character mode"
+			       (const "~tex") (const "~list") (const "~nroff")
 			       (const "~latin3") (const "~latin1")
-			       (const nil))
-		       (choice (const iso-latin-1)
-			       (const nil :tag "default"))))
+			       (const :tag "default" nil))
+		       (choice :tag "Character set"
+			       (const iso-latin-1)
+			       (const iso-latin-2)
+			       (const :tag "default" nil))))
   :group 'ispell)
 (defvar ispell-menu-map nil "Key map for ispell menu")
-(defvar ispell-menu-lucid nil
-  "Spelling menu for Lucid Emacs.
+(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 lucid menu and split into several calls to avoid having
+;;; 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
-(defconst ispell-menu-map-needed	; make sure this is not Lucid Emacs
+(defconst ispell-menu-map-needed
+  ;; only needed when not version 18 and not XEmacs.
   (and (not ispell-menu-map)
-       (string-lessp "19" emacs-version)
-       ;; make sure this isn't Lucid Emacs
-       (not (string-match "Lucid" emacs-version))))
+       (not (string-match "18\\.[0-9]+\\.[0-9]+" emacs-version))
+       (not (string-match "Lucid\\|XEmacs" emacs-version))))
 (if ispell-menu-map-needed
 	'("Continue Check" . ispell-continue))
       (define-key ispell-menu-map [ispell-word]
 	'("Check Word" . ispell-word))
+      (define-key ispell-menu-map [ispell-comments-and-strings]
+	'("Check Comments" . ispell-comments-and-strings))
       (define-key ispell-menu-map [ispell-region]
 	'("Check Region" . ispell-region))
       (define-key ispell-menu-map [ispell-buffer]
       (put 'ispell-region 'menu-enable 'mark-active)
       (fset 'ispell-menu-map (symbol-value 'ispell-menu-map))))
-;;; XEmacs version 19
-(if (and ;; (string-lessp "19" emacs-version) ;; This is always true
-	 (string-match "XEmacs" emacs-version)
-	 (null ispell-menu-lucid)
+;;; XEmacs version 19 & 20
+(if (and (not (string-match "18\\.[0-9]+\\.[0-9]+" emacs-version))
+	 (string-match "Lucid\\|XEmacs" emacs-version)
+	 (null ispell-menu-xemacs)
 	 (not (and (boundp 'infodock-version) infodock-version)))
     (let ((dicts (cons (cons "default" nil) ispell-dictionary-alist))
 	  (current-menubar (or current-menubar default-menubar))
 	     ;;["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]
 				 (vector (concat "Select " (capitalize name))
 					 (list 'ispell-change-dictionary name)
-      (setq ispell-menu-lucid menu)
+      (setq ispell-menu-xemacs menu)
       (if current-menubar
 	    (delete-menu-item '("Edit" "Spell")) ; in case already defined
-	    (add-menu '("Edit") "Spell" ispell-menu-lucid)))))
+	    (add-menu '("Edit") "Spell" ispell-menu-xemacs)))))
-;;; Fixup mixing characters and integers
+;;; Allow incrementing characters as integers in XEmacs 20
 (if (and (string-match "XEmacs" emacs-version)
 	 (fboundp 'int-char))
     (fset 'ispell-int-char 'int-char)
-  ;; Emacs and XEmacs 19
+  ;; Emacs and XEmacs 19 or earlier
   (fset 'ispell-int-char 'identity))
 ;;; **********************************************************************
 ;;; The following are used by ispell, and should not be changed.
 ;;; **********************************************************************
     (ispell-parsing-keyword	   forward-line)
     ("^---*BEGIN PGP [A-Z ]*--*" . "^---*END PGP [A-Z ]*--*")
     ("^---* \\(Start of \\)?[Ff]orwarded [Mm]essage"   . "^---* End of [Ff]orwarded [Mm]essage")
-    ("\\(\\w\\|-\\)*\\([.:/@]+\\(\\w\\|-\\)+\\)+")
-    ;; some valid text will be skipped, e.g. "his/herr".  This could be
-    ;; fixed up (at the expense of a more complicated regular expression)
+    ;; matches e-mail addresses, file names, http addresses, etc.
+    ("\\(/\\|\\(\\(\\w\\|-\\)+[.:@]\\)\\)\\(\\w\\|-\\)*\\([.:/@]+\\(\\w\\|-\\|~\\)+\\)+")
+    ;; This is a pretty complex regexp.  It can be simplified to the following:
+    ;; "\\(\\w\\|-\\)*\\([.:/@]+\\(\\w\\|-\\|~\\)+\\)+"
+    ;; but some valid text will be skipped, e.g. "his/herr".  This could be
+    ;; fixed up (at the expense of a moderately more complex regexp)
     ;; by not allowing "/" to be the character which triggers the
     ;; identification of the computer name, e.g.:
-    ;; "\\(\\w\\|-\\)+[.:@]\\(\\w\\|-\\)*\\([.:/@]+\\(\\w\\|-\\)+\\)+"
-    ;; or to keep recognizing strings with an initial "/":
-    ;; "\\(/\\|\\(\\(\\w\\|-\\)+[.:@]\\)\\)\\(\\w\\|-\\)*\\([.:/@]+\\(\\w\\|-\\)+\\)+"
+    ;; "\\(\\w\\|-\\)+[.:@]\\(\\w\\|-\\)*\\([.:/@]+\\(\\w\\|-\\|~\\)+\\)+"
   "A-list expressing begining and end of regions not to spell check.
 The alist key must be a regular expression.
 (defvar ispell-tex-skip-alists
   '((("%\\[" . "%\\]")
-     ("\\\\bibliographystyle"	ispell-tex-arg-end)
-     ("\\\\epsfig"		ispell-tex-arg-end)
-     ("\\\\author"		ispell-tex-arg-end)
-     ("\\\\documentclass" .	"\\\\begin[ \t\n]*{[ \t\n]*document[ \t\n]*}")
-     ("\\\\documentstyle" .	"\\\\begin[ \t\n]*{[ \t\n]*document[ \t\n]*}"))
-    ( ;; delimited with \begin
-     ("program"    .	"\\\\end[ \t\n]*{[ \t\n]*program[ \t\n]*}")
-     ("figure"		ispell-tex-arg-end 0)
-     ("table"		ispell-tex-arg-end 0)
-     ("tabular"		ispell-tex-arg-end)))
+     ;; All the standard LaTeX keywords from L. Lamport's guide:
+     ;; \cite, \hspace, \hspace*, \hyphenation, \include, \includeonly, \input,
+     ;; \label, \nocite, \rule (in ispell - rest included here)
+     ("\\\\addcontentsline"              ispell-tex-arg-end 2)
+     ("\\\\add\\(tocontents\\|vspace\\)" ispell-tex-arg-end)
+     ("\\\\\\([aA]lph\\|arabic\\)"	 ispell-tex-arg-end)
+     ("\\\\author"			 ispell-tex-arg-end)
+     ("\\\\bibliographystyle"		 ispell-tex-arg-end)
+     ("\\\\makebox"			 ispell-tex-arg-end 0)
+     ;;("\\\\epsfig"		ispell-tex-arg-end)
+     ("\\\\document\\(class\\|style\\)" .
+      "\\\\begin[ \t\n]*{[ \t\n]*document[ \t\n]*}"))
+    (;; delimited with \begin.  In ispell: displaymath, eqnarray, eqnarray*,
+     ;; equation, minipage, picture, tabular, tabular* (ispell)
+     ("\\(figure\\|table\\)\\*?"  ispell-tex-arg-end 0)
+     ("list"			  ispell-tex-arg-end 2)
+     ("program"		. "\\\\end[ \t\n]*{[ \t\n]*program[ \t\n]*}")
+     ("verbatim\\*?"	. "\\\\end[ \t\n]*{[ \t\n]*verbatim\\*?[ \t\n]*}")))
   "*Lists of regions to be skipped in TeX mode.
 First list is used raw.
-Second list has key placed inside \begin{}.
+Second list has key placed inside \\begin{}.
 Delete or add any regions you want to be automatically selected
 for skipping in latex mode.")
 ;;; **********************************************************************
-(and (string-lessp "19" emacs-version)
+(and (not (string-match "18\\.[0-9]+\\.[0-9]+" emacs-version))
      (not (boundp 'epoch::version))
      (defalias 'ispell 'ispell-buffer))
 	 (ispell-many-otherchars-p (ispell-get-many-otherchars-p))
 	 (word-regexp (concat ispell-casechars
-			      ispell-otherchars
-			      "?"
+			      (if (not (string= "" ispell-otherchars))
+				  (concat ispell-otherchars "?"))
 			      (if extra-otherchars
 				  (concat extra-otherchars "?"))
 			      (if (or ispell-many-otherchars-p
 				  "*" "?")))
-	 did-it-once
+	 did-it-once prevpt
 	 start end word)
     ;; find the word
     (if (not (looking-at ispell-casechars))
 	  (re-search-backward ispell-casechars (point-min) t)))
     ;; move to front of word
     (re-search-backward ispell-not-casechars (point-min) 'start)
-    (while (and (or (looking-at ispell-otherchars)
+    (while (and (or (and (not (string= "" ispell-otherchars))
+			 (looking-at ispell-otherchars))
 		    (and extra-otherchars (looking-at extra-otherchars)))
 		(not (bobp))
 		(or (not did-it-once)
-		    ispell-many-otherchars-p))
+		    ispell-many-otherchars-p)
+		(not (eq prevpt (point))))
       (if (and extra-otherchars (looking-at extra-otherchars))
 	    (backward-char 1)
 	    (if (looking-at ispell-casechars)
 		(re-search-backward ispell-not-casechars (point-min) 'move)))
-	(setq did-it-once t)
+	(setq did-it-once t
+	      prevpt (point))
 	(backward-char 1)
 	(if (looking-at ispell-casechars)
 	    (re-search-backward ispell-not-casechars (point-min) 'move)
 				(while (memq count command-characters)
-				  (setq count (1+ count)
+				  (setq count (ispell-int-char (1+ count))
 					skipped (1+ skipped)))
 				(insert "(" count ") " (car choices) "  ")
 				(setq choices (cdr choices)
-				      count (1+ count)))
-			      (setq count (- count ?0 skipped)))
+				      count (ispell-int-char (1+ count))))
+			      (setq count (ispell-int-char
+					   (- count ?0 skipped))))
 			    (select-window (previous-window))
 			    (if (and (/= new-line line)
 				     (> (max line new-line)
 	    ;; *Choices* window changed size.  Adjust the choices window
 	    ;; without scrolling the spelled window when possible
 	    (let ((window-line (- line (window-height choices-window)))
-		  (visible (progn (forward-line -1) (point))))
+		  (visible (progn (vertical-motion -1) (point))))
 	      (if (< line ispell-choices-win-default-height)
 		  (setq window-line (+ window-line
 				       (- ispell-choices-win-default-height
 	      (move-to-window-line 0)
-	      (forward-line window-line)
+	      (vertical-motion window-line)
 	      (set-window-start (selected-window)
 				(if (> (point) visible) visible (point)))
 	      (goto-char end)
 	  (select-window (minibuffer-window))
 	  ;;(enlarge-window 2)
-	  (cond ((string-match "Lucid" emacs-version)
+	  (cond ((string-match "Lucid\\|XEmacs" emacs-version)
 		 (message help-3)
 		 (enlarge-window 1)
 		 (message help-2)
 		 (message help-1)
 		 (goto-char (point-min)))
-		 (if (string-lessp "19" emacs-version)
+		 (if (not (string-match "18\\.[0-9]+\\.[0-9]+" emacs-version))
 		     (message nil))
 		 ;;(set-minibuffer-window (selected-window))
 		 (enlarge-window 2)
 ;;;   multiple lines.
 ;;; "ispell-filter-continue" is true when we have received only part of a
 ;;;   line as output from a generating function ("output" did not end with \n)
 ;;;   This is the case when a process dies or fails. The default behavior
 ;;;   in this case treats the next input received as fresh input.
 	  (if (eq 'block refresh) start (- start 2)) end t))))
-(defun ispell-highlight-spelling-error-lucid (start end &optional highlight)
+(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."
 (defun ispell-highlight-spelling-error (start end &optional highlight refresh)
-   ((string-match "Lucid" emacs-version)
-    (ispell-highlight-spelling-error-lucid start end highlight))
-   ((and (string-lessp "19" emacs-version)
+   ((string-match "Lucid\\XEmacs" emacs-version)
+    (ispell-highlight-spelling-error-xemacs start end highlight))
+   ((and (not (string-match "18\\.[0-9]+\\.[0-9]+" emacs-version))
 	 (featurep 'faces) window-system)
     (ispell-highlight-spelling-error-overlay start end highlight))
    (t (ispell-highlight-spelling-error-generic start end highlight refresh))))
       ;; hidden by new window, scroll it to just below new win
       ;; otherwise set top line of other win so it doesn't scroll.
       (if (< oldot top) (setq top oldot))
-      ;; NB: xemacs 19.9 bug: If a window of size N (N includes the mode
+      ;; NB: XEmacs 19.9 bug: If a window of size N (N includes the mode
       ;; line) is demanded, the last line is not visible.
-      ;; At least this happens on AIX 3.2, xemacs w/ Motif, font 9x15.
+      ;; At least this happens on AIX 3.2, XEmacs w/ Motif, font 9x15.
       ;; So we increment the height for this case.
-      (if (string-match "19\.9.*Lucid" (emacs-version))
+      (if (and (string-match "Lucid\\|XEmacs" emacs-version)
+	       (string-match "19\\.9\\.[0-9]+" emacs-version))
 	  (setq height (1+ height)))
       ;; if frame is unsplitable, temporarily disable that...
       (if (cdr (assq 'unsplittable (frame-parameters (selected-frame))))
     (set-process-filter ispell-process 'ispell-filter)
     (if (and (boundp 'enable-multibyte-characters)
 	     (fboundp 'set-process-coding-system)
-	     enable-multibyte-characters
-	     (ispell-get-coding-system))
+	     enable-multibyte-characters)
 	(set-process-coding-system ispell-process (ispell-get-coding-system)))
-    (if (string-lessp "19" emacs-version) ; Get version ID line
+    ;; Get version ID line
+    (if (not (string-match "18\\.[0-9]+\\.[0-9]+" emacs-version))
 	(accept-process-output ispell-process 5)
       (accept-process-output ispell-process))
     ;; get more output if filter empty?
 	    (stringp (car ispell-filter))
 	    (if (string-match "warning: " (car ispell-filter))
-		  (if (string-lessp "19" emacs-version)
+		  (if (not (string-match "18\\.[0-9]+\\.[0-9]+" emacs-version))
 		      (accept-process-output ispell-process 5) ; was warn msg.
 		    (accept-process-output ispell-process))
 		  (stringp (car ispell-filter)))
 	  (goto-char reg-start)
 	  (let ((transient-mark-mode nil)
+		(case-fold-search case-fold-search)
 		(skip-region-start (make-marker))
 		(skip-regexp (ispell-begin-skip-region-regexp))
 		(skip-alist ispell-skip-region-alist)
 	    (if (eq ispell-parser 'tex)
-		(setq skip-alist
+		(setq case-fold-search nil
+		      skip-alist
 		      (append (car ispell-tex-skip-alists)
 			      (car (cdr ispell-tex-skip-alists))
      ((looking-at "[---#@*+!%~^]")	; SKIP SPECIAL ISPELL CHARACTERS
       (forward-char 1))
      ((or (re-search-forward ispell-casechars end t) ; TEXT EXISTS
-	  (re-search-forward "[][()$]" end t)) ; or MATH COMMANDS
+	  (re-search-forward "[][()${}]" end t)) ; or MATH COMMANDS
       (setq string (concat "^" (buffer-substring-no-properties start end)
       (goto-char end))
       (setq ispell-filter (cdr ispell-filter)))))
+(defun ispell-comments-and-strings ()
+  "Check comments and strings in the current buffer for spelling errors."
+  (interactive)
+  (goto-char (point-min))
+  (let (state done)
+    (while (not done)
+      (setq done t)
+      (setq state (parse-partial-sexp (point) (point-max)
+				      nil nil state 'syntax-table))
+      (when (or (nth 3 state) (nth 4 state))
+	(let ((start (point)))
+	  (setq state (parse-partial-sexp start (point-max)
+					  nil nil state 'syntax-table))
+	  (when (or (nth 3 state) (nth 4 state))
+	    (error "Unterminated string or comment."))
+	  (save-excursion
+	    (setq done (not (ispell-region start (point))))))))))
 (defun ispell-buffer ()
 	      (insert (concat " " word))))))))
-(defconst ispell-version "ispell.el 3.0 -- Wed Nov 12 03:08:53 1997")
+(defconst ispell-version "ispell.el 3.0 -- Fri Mar 20 13:25:59 PST 1998")
 (provide 'ispell)
 ;;; Change IspellPersDict to IspellPersDict: to enable the following line.
 ;;; Local IspellPersDict ~/.ispell_lisp
 ;;; The following were automatically generated by ispell using the 'A' command:
-; LocalWords:  popup nonmenu herr XEmacs SPC num pers reg unhighlight Axel uit
-; LocalWords:  ccept buf DOESNT sync prev inc fn olddot NB AIX ersion msg op eg
-; LocalWords:  read's bufs kss regxp multibyte Quinlan uuencoded esp unidiff sc
-; LocalWords:  VM lns HTML eval IspellDict IspellPersDict settable init inews
-; LocalWords:  autoload mh frag pdict alist Wildcards iconify arg tex alists pt
-; LocalWords:  minibuffer Autoloading setq Castellano framepop sgml xemacs pgp
-; LocalWords:  modeline Wedler geoff FSF Dict ptys jwz horiz args frags Conover
-; LocalWords:  dict Tib Denis Eberhard Mattes Aronov Rik Lipp Jamie Zawinski
-; LocalWords:  Queinnec Heidemann rehacked wildcards tib cmd Kremer NZST DST
-; LocalWords:  Vignaux docstrings autoloaded aff Francais Nederlands loaddefs
-; LocalWords:  subvariables grep regexp hilight
+; LocalWords:  Moellmann copyleft Dansk russian KOI charset minipage hspace mh
+; LocalWords:  unsplitable includeonly nocite epsfig displaymath eqnarray init
+; LocalWords:  settable autoload inews frag pdict alist Wildcards iconify arg
+; LocalWords:  tex alists minibuffer Autoloading setq changelog kss stevens reg
+; LocalWords:  Castellano framepop sgml modeline Wedler Dirk Froembgen fn Gerd
+; LocalWords:  pgp NZST Vignaux autoloaded loaddefs aff Francais Nederlands SPC
+; LocalWords:  popup nonmenu regexp herr num pers dict unhighlight ccept uit NB
+; LocalWords:  buf grep sync prev inc hilight olddot AIX ersion msg read's op
+; LocalWords:  bufs pt regxp multibyte cmd Quinlan uuencoded esp unidiff eg sc
+; LocalWords:  VM lns HTML eval american IspellPersDict
 ;; ispell.el ends here