aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-12-01 07:23:27 +0000
committerRichard M. Stallman1998-12-01 07:23:27 +0000
commitb9431ae03745a92b456b0eef9651ff810dd3b3ce (patch)
treebc9475e89a87e305ac48c749a6ef742f20312a84
parent9160906f27f60f33916004ea241d84cd3fb178d0 (diff)
downloademacs-b9431ae03745a92b456b0eef9651ff810dd3b3ce.tar.gz
emacs-b9431ae03745a92b456b0eef9651ff810dd3b3ce.zip
Improved and fixed customize for variables:
ispell-highlight-p, ispell-check-comments, ispell-help-in-bufferp, ispell-dictionary-alist, ispell-skip-sgml. Improved and fixed comments in variables and messages for functions: ispell-help-in-bufferp, ispell-local-dictionary, ispell-menu-map, ispell-checking-message, ispell-parser, ispell-word, lookup-words, ispell-change-dictionary, ispell-region, ispell-begin-tex-skip-regexp, ispell-begin-skip-region, ispell-comments-and-strings, ispell-continue, ispell-complete-word, ispell-message-text-end, ispell-add-per-file-word-list. (ispell-dictionary-alist-1): (ispell-dictionary-alist2): A coding system is now required for all languages. Casechars improved for castellano, castellano8, and norsk dictionaries. Dictionary norsk7-tex removed. Dictionary polish added. (ispell-dictionary-alist): Redefined at load-time to support dictionary changes. (ispell-menu-map): Redefined at load-time to support menu changes. (ispell-check-version): New alias for `check-ispell-version'. (ispell-parse-output): Fixed matching for ispell error messages. Correctly returns spelling suggestions in order generated by ispell process. (check-ispell-version): Ensure `case-fold-search' doesn't get redefined. (ispell-complete-word): Ensure `case-fold-search' doesn't get redefined. Fix bug that didn't respect case of word being completed. (ispell-init-process): Set process coding system to be compatible with emacs processes and the ispell process. (ispell-kill-ispell): Ensures ispell process has terminated before starting new process. This can otherwise confuse process filters and hang the ispell process. (ispell-begin-skip-region-regexp): (ispell-skip-region): Improved skipping support for sgml. (ispell-minor-check): Support sgml labels. Fix mapping ^M to \r which could cause `ispell-complete-word' to hang. (ispell-message): Improved message reference matching. Ensure `case-fold-search' doesn't get redefined. (ispell-buffer-local-parsing): Ensure `case-fold-search' doesn't get redefined. Fixed bug in returning to nroff mode from tex mode. (ispell-add-per-file-word-list): Ensure `case-fold-search' doesn't get redefined.
-rw-r--r--lisp/textmodes/ispell.el403
1 files changed, 232 insertions, 171 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index a23985623e3..6e6ae5943a9 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -3,8 +3,8 @@
3;; Copyright (C) 1994, 1995, 1997, 1998 Free Software Foundation, Inc. 3;; Copyright (C) 1994, 1995, 1997, 1998 Free Software Foundation, Inc.
4 4
5;; Authors : Ken Stevens <k.stevens@ieee.org> 5;; Authors : Ken Stevens <k.stevens@ieee.org>
6;; Stevens Mod Date: Tue Apr 28 14:40:01 PDT 1998 6;; Stevens Mod Date: Mon Nov 30 20:32:48 PST 1998
7;; Stevens Revision: 3.0 7;; Stevens Revision: 3.1
8;; Status : Release with 3.1.12+ ispell. 8;; Status : Release with 3.1.12+ ispell.
9;; Bug Reports : ispell-el-bugs@itcorp.com 9;; Bug Reports : ispell-el-bugs@itcorp.com
10;; Web Site : http://kdstevens.com/~stevens/ispell-page.html 10;; Web Site : http://kdstevens.com/~stevens/ispell-page.html
@@ -112,6 +112,7 @@
112;; `ispell-message' contains some custom skipping code for e-mail messages. 112;; `ispell-message' contains some custom skipping code for e-mail messages.
113 113
114;; BUGS: 114;; BUGS:
115;; Accepting definitions in latex mode can mess up math mode skipping...
115;; Highlighting in version 19 still doesn't work on tty's. 116;; Highlighting in version 19 still doesn't work on tty's.
116;; On some versions of emacs, growing the minibuffer fails. 117;; On some versions of emacs, growing the minibuffer fails.
117;; Autoloading ispell can result in problems if you need to use a local or 118;; Autoloading ispell can result in problems if you need to use a local or
@@ -122,6 +123,7 @@
122;; (setq ispell-menu-map nil) 123;; (setq ispell-menu-map nil)
123;; (load-library "ispell") 124;; (load-library "ispell")
124 125
126
125;;; Code: 127;;; Code:
126 128
127;;; Custom.el macros require recompiling this when they are not present. 129;;; Custom.el macros require recompiling this when they are not present.
@@ -151,7 +153,7 @@
151(defcustom ispell-highlight-p 'block 153(defcustom ispell-highlight-p 'block
152 "*Highlight spelling errors when non-nil. 154 "*Highlight spelling errors when non-nil.
153When set to `block', assumes a block cursor with TTY displays." 155When set to `block', assumes a block cursor with TTY displays."
154 :type '(choice (const block) (const nil) (other :tag "on" t)) 156 :type '(choice (const block) (const :tag "off" nil) (const :tag "on" t))
155 :group 'ispell) 157 :group 'ispell)
156 158
157(defcustom ispell-highlight-face 'highlight 159(defcustom ispell-highlight-face 'highlight
@@ -169,7 +171,7 @@ slightly different."
169When set to `exclusive', ONLY comments are checked. (For code comments). 171When set to `exclusive', ONLY comments are checked. (For code comments).
170Warning! Not checking comments, when a comment start is embedded in strings, 172Warning! Not checking comments, when a comment start is embedded in strings,
171may produce undesired results." 173may produce undesired results."
172 :type '(choice (const exclusive) (const nil) (other :tag "on" t)) 174 :type '(choice (const exclusive) (const :tag "off" nil) (const :tag "on" t))
173 :group 'ispell) 175 :group 'ispell)
174 176
175(defcustom ispell-query-replace-choices nil 177(defcustom ispell-query-replace-choices nil
@@ -293,15 +295,14 @@ Otherwise `ispell-word' checks the preceding word."
293 295
294(defcustom ispell-help-in-bufferp nil 296(defcustom ispell-help-in-bufferp nil
295 "*Non-nil means display interactive keymap help in a buffer. 297 "*Non-nil means display interactive keymap help in a buffer.
296The following valued are supported: 298The following values are supported:
297 nil Expand the minibuffer and display a short help message 299 nil Expand the minibuffer and display a short help message
298 there for a couple of seconds. 300 there for a couple of seconds.
299 t Pop up a new buffer and display a short help message there 301 t Pop up a new buffer and display a short help message there
300 for a couple of seconds. 302 for a couple of seconds.
301 electric Pop up a new buffer and display a long help message there. 303 electric Pop up a new buffer and display a long help message there.
302 User can browse and then exit the help mode." 304 User can browse and then exit the help mode."
303 :type '(choice (const electric) (const nil) (other :tag "t" t)) 305 :type '(choice (const electric) (const :tag "off" nil) (const :tag "on" t))
304
305 :group 'ispell) 306 :group 'ispell)
306 307
307(defcustom ispell-quietly nil 308(defcustom ispell-quietly nil
@@ -344,13 +345,13 @@ where DICTNAME is the name of your default dictionary."
344The value must be a string dictionary name in `ispell-dictionary-alist'. 345The value must be a string dictionary name in `ispell-dictionary-alist'.
345This variable becomes buffer-local when set in any fashion. 346This variable becomes buffer-local when set in any fashion.
346 347
347Setting ispell-local-dictionary to a value has the same effect as 348Setting `ispell-local-dictionary' to a value has the same effect as
348calling \\[ispell-change-dictionary] with that value. This variable 349calling \\[ispell-change-dictionary] with that value. This variable
349is automatically set when defined in the file with either 350is automatically set when defined in the file with either
350`ispell-dictionary-keyword' or the Local Variable syntax. 351`ispell-dictionary-keyword' or the Local Variable syntax.
351 352
352To create a non-standard default dictionary (not from ispell-dictionary-alist) 353To create a non-standard default dictionary (not from `ispell-dictionary-alist')
353call function set-default with the new dictionary name." 354call function `set-default' with the new dictionary name."
354 :type '(choice string 355 :type '(choice string
355 (const :tag "default" nil)) 356 (const :tag "default" nil))
356 :group 'ispell) 357 :group 'ispell)
@@ -369,89 +370,93 @@ for language-specific arguments."
369 :type '(repeat string) 370 :type '(repeat string)
370 :group 'ispell) 371 :group 'ispell)
371 372
372;;; The preparation of the menu bar menu must be autoloaded
373;;; because otherwise this file gets autoloaded every time Emacs starts
374;;; so that it can set up the menus and determine keyboard equivalents.
375
376;;; split dictionary so line length is smaller in loaddefs.el 373;;; split dictionary so line length is smaller in loaddefs.el
377 374
375;;; First half of dictionary, shortened for loaddefs.el
378;;;###autoload 376;;;###autoload
379(defvar ispell-dictionary-alist-1 377(setq
380 '((nil ; default (English.aff) 378 ispell-dictionary-alist-1
381 "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil nil) 379 '((nil ; default (English.aff)
382 ("american" ; make English explicitly selectable 380 "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
383 "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil nil) 381 ("american" ; yankee English
384 ("british" ; British version 382 "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)
385 "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B" "-d" "british") nil nil) 383 ("british" ; British version
386 ("castellano" ; Spanish mode 384 "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B" "-d" "british") nil iso-8859-1)
387 "[A-Z\301\311\315\323\332\334\321a-z\341\351\355\363\372\374\361]" 385 ("castellano" ; Spanish mode
388 "[^A-Z\301\311\315\323\332\334\321a-z\341\351\355\363\372\374\361]" 386 "[A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]"
389 "[---]" nil ("-B" "-d" "castellano") "~tex" iso-latin-1) 387 "[^A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]"
390 ("castellano8" ; 8 bit Spanish mode 388 "[---]" nil ("-B" "-d" "castellano") "~tex" iso-8859-1)
391 "[A-Z\301\311\315\323\332\334\321a-z\341\351\355\363\372\374\361]" 389 ("castellano8" ; 8 bit Spanish mode
392 "[^A-Z\301\311\315\323\332\334\321a-z\341\351\355\363\372\374\361]" 390 "[A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]"
393 "[---]" nil ("-B" "-d" "castellano") "~latin1" iso-latin-1) 391 "[^A-Z\301\311\315\321\323\332\334a-z\341\351\355\361\363\372\374]"
394 ("czech" 392 "[---]" nil ("-B" "-d" "castellano") "~latin1" iso-8859-1)
395 "[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]" 393 ("czech"
396 "[^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]" 394 "[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]"
397 "" nil ("-B" "-d" "czech") nil iso-latin-2) 395 "[^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]"
398 ("dansk" ; Dansk.aff 396 "" nil ("-B" "-d" "czech") nil iso-8859-2)
399 "[A-Z\306\330\305a-z\346\370\345]" "[^A-Z\306\330\305a-z\346\370\345]" 397 ("dansk" ; Dansk.aff
400 "[']" nil ("-C") nil iso-latin-1) 398 "[A-Z\306\330\305a-z\346\370\345]" "[^A-Z\306\330\305a-z\346\370\345]"
401 ("deutsch" ; Deutsch.aff 399 "[']" nil ("-C") nil iso-8859-1)
402 "[a-zA-Z\"]" "[^a-zA-Z\"]" "[']" t ("-C") "~tex" nil) 400 ("deutsch" ; Deutsch.aff
403 ("deutsch8" 401 "[a-zA-Z\"]" "[^a-zA-Z\"]" "[']" t ("-C") "~tex" iso-8859-1)
404 "[a-zA-Z\304\326\334\344\366\337\374]" 402 ("deutsch8"
405 "[^a-zA-Z\304\326\334\344\366\337\374]" 403 "[a-zA-Z\304\326\334\344\366\337\374]"
406 "[']" t ("-C" "-d" "deutsch") "~latin1" iso-latin-1) 404 "[^a-zA-Z\304\326\334\344\366\337\374]"
407 ("english" ; make English explicitly selectable 405 "[']" t ("-C" "-d" "deutsch") "~latin1" iso-8859-1)
408 "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil nil)) 406 ("english" ; make English explicitly selectable
409 "First half of dictionary, shortened for loaddefs.el") 407 "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil iso-8859-1)))
410 408
409
410;;; Second half of dictionary, shortened for loaddefs.el
411;;;###autoload 411;;;###autoload
412(defvar ispell-dictionary-alist-2 412(setq
413 '(("esperanto" 413 ispell-dictionary-alist-2
414 "[A-Za-z\246\254\266\274\306\330\335\336\346\370\375\376]" 414 '(("esperanto"
415 "[^A-Za-z\246\254\266\274\306\330\335\336\346\370\375\376]" 415 "[A-Za-z\246\254\266\274\306\330\335\336\346\370\375\376]"
416 "[-']" t ("-C") "~latin3" nil) 416 "[^A-Za-z\246\254\266\274\306\330\335\336\346\370\375\376]"
417 ("esperanto-tex" 417 "[-']" t ("-C") "~latin3" iso-8859-1)
418 "[A-Za-z^\\]" "[^A-Za-z^\\]" "[-'`\"]" t ("-C" "-d" "esperanto") "~tex" 418 ("esperanto-tex"
419 nil) 419 "[A-Za-z^\\]" "[^A-Za-z^\\]"
420 ("francais7" 420 "[-'`\"]" t ("-C" "-d" "esperanto") "~tex" iso-8859-1)
421 "[A-Za-z]" "[^A-Za-z]" "[`'^---]" t nil nil nil) 421 ("francais7"
422 ("francais" ; Francais.aff 422 "[A-Za-z]" "[^A-Za-z]" "[`'^---]" t nil nil iso-8859-1)
423 "[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374]" 423 ("francais" ; Francais.aff
424 "[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374]" 424 "[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374]"
425 "[---']" t nil "~list" iso-latin-1) 425 "[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374]"
426 ("francais-tex" ; Francais.aff 426 "[---']" t nil "~list" iso-8859-1)
427 "[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]" 427 ("francais-tex" ; Francais.aff
428 "[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]" 428 "[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]"
429 "[---'^`\"]" t nil "~tex" iso-latin-1) 429 "[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]"
430 ("nederlands" ; Nederlands.aff 430 "[---'^`\"]" t nil "~tex" iso-8859-1)
431 "[A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]" 431 ("nederlands" ; Nederlands.aff
432 "[^A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]" 432 "[A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]"
433 "[']" t ("-C") nil iso-latin-1) 433 "[^A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]"
434 ("nederlands8" ; Dutch8.aff 434 "[']" t ("-C") nil iso-8859-1)
435 "[A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]" 435 ("nederlands8" ; Dutch8.aff
436 "[^A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]" 436 "[A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]"
437 "[']" t ("-C") nil iso-latin-1) 437 "[^A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]"
438 ("norsk" ;8 bit Norwegian mode 438 "[']" t ("-C") nil iso-8859-1)
439 "[A-Za-z\351\346\370\345\350\364\362\311\306\330\305\310\324\322]" 439 ("norsk" ; 8 bit Norwegian mode
440 "[^A-Za-z\351\346\370\345\350\364\362\311\306\330\305\310\324\322]" 440 "[A-Za-z\305\306\307\310\311\322\324\330\345\346\347\350\351\362\364\370]"
441 "[']" nil ("-C" "-d" "norsk") "~list" nil) 441 "[^A-Za-z\305\306\307\310\311\322\324\330\345\346\347\350\351\362\364\370]"
442 ("russian" ; russian.aff (KOI8-R charset) 442 "[\"]" nil ("-d" "norsk") "~list" iso-8859-1)
443 "[\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]" 443 ("norsk7-tex" ; 7 bit Norwegian TeX mode
444 "[^\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]" 444 "[A-Za-z{}\\'^`]" "[^A-Za-z{}\\'^`]"
445 "[']" t ("-C" "-d" "russian") "~latin1" iso-latin-1) 445 "[\"]" nil ("-d" "norsk") "~plaintex" iso-8859-1)
446 ("svenska" 446 ("polish" ; polish mode
447 "[A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]" "[^A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]" 447 "[A-Za-z\241\243\246\254\257\261\263\266\274\277\306\312\321\323\346\352\361\363]"
448 "[']" nil ("-C") "~list" ; Add `"-T" "list"' instead? 448 "[^A-Za-z\241\243\246\254\257\261\263\266\274\277\306\312\321\323\346\352\361\363]"
449 iso-latin-1)) 449 "" nil ( "-d" "polish") nil iso-8859-2)
450 "Second half of dictionary, shortened for loaddefs.el") 450 ("russian" ; russian.aff (KOI8-R charset)
451 "[\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]"
452 "[^\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]"
453 "[']" t ("-C" "-d" "russian") "~latin1" iso-8859-1)
454 ("svenska" ; Swedish mode
455 "[A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]"
456 "[^A-Za-z\345\344\366\351\340\374\350\346\370\347\305\304\326\311\300\334\310\306\330\307]"
457 "[']" nil ("-C") "~list" iso-8859-1)))
458
451 459
452;;; The preparation of the menu bar menu must be autoloaded
453;;; because otherwise this file gets autoloaded every time Emacs starts
454;;; so that it can set up the menus and determine keyboard equivalents.
455 460
456;;;###autoload 461;;;###autoload
457(defcustom ispell-dictionary-alist 462(defcustom ispell-dictionary-alist
@@ -512,18 +517,30 @@ LANGUAGE.aff file \(e.g., english.aff\)."
512 (repeat :tag "Ispell command line args" 517 (repeat :tag "Ispell command line args"
513 (string :tag "Arg")) 518 (string :tag "Arg"))
514 (choice :tag "Extended character mode" 519 (choice :tag "Extended character mode"
515 (const "~tex") (const "~list") (const "~nroff") 520 (const "~tex") (const "~plaintex")
516 (const "~latin3") (const "~latin1") 521 (const "~nroff") (const "~list")
517 (const :tag "default" nil)) 522 (const "~latin1") (const "~latin3")
523 (const :tag "default" nil))
518 (choice :tag "Character set" 524 (choice :tag "Character set"
519 (const iso-latin-1) 525 (const iso-8859-1)
520 (const iso-latin-2) 526 (const iso-8859-2))))
521 (const :tag "default" nil))))
522 :group 'ispell) 527 :group 'ispell)
523 528
529;;; update the dictionaries at load time
530(eval-when (load)
531 (setq ispell-dictionary-alist
532 (append ispell-dictionary-alist-1 ispell-dictionary-alist-2)))
533
534
535
536;;; The preparation of the menu bar menu must be autoloaded
537;;; because otherwise this file gets autoloaded every time Emacs starts
538;;; so that it can set up the menus and determine keyboard equivalents.
524 539
525;;;###autoload 540;;;###autoload
526(defvar ispell-menu-map nil "Key map for ispell menu") 541(defvar ispell-menu-map nil "Key map for ispell menu.")
542;;; redo menu when loading ispell to get dictionary modifications
543(eval-when (load) (setq ispell-menu-map nil))
527 544
528;;;###autoload 545;;;###autoload
529(defvar ispell-menu-xemacs nil 546(defvar ispell-menu-xemacs nil
@@ -691,11 +708,7 @@ used as key in `ispell-dictionary-alist' (which see).")
691(defun ispell-get-extended-character-mode () 708(defun ispell-get-extended-character-mode ()
692 (nth 6 (assoc ispell-dictionary ispell-dictionary-alist))) 709 (nth 6 (assoc ispell-dictionary ispell-dictionary-alist)))
693(defun ispell-get-coding-system () 710(defun ispell-get-coding-system ()
694 (or (nth 7 (assoc ispell-dictionary ispell-dictionary-alist)) 711 (nth 7 (assoc ispell-dictionary ispell-dictionary-alist)))
695 ;; We default to Latin-1 because otherwise multibyte
696 ;; characters cause synchronization confusion
697 ;; with the Ispell process.
698 'iso-latin-1))
699 712
700(defvar ispell-process nil 713(defvar ispell-process nil
701 "The process object for Ispell.") 714 "The process object for Ispell.")
@@ -724,7 +737,7 @@ used as key in `ispell-dictionary-alist' (which see).")
724 "Marker for return point from recursive edit.") 737 "Marker for return point from recursive edit.")
725 738
726(defvar ispell-checking-message nil 739(defvar ispell-checking-message nil
727 "Non-nil when we're checking a mail message") 740 "Non-nil when we're checking a mail message.")
728 741
729(defconst ispell-choices-buffer "*Choices*") 742(defconst ispell-choices-buffer "*Choices*")
730 743
@@ -819,8 +832,8 @@ for skipping in latex mode.")
819If t, always skip SGML markup; if nil, never skip; if non-t and non-nil, 832If t, always skip SGML markup; if nil, never skip; if non-t and non-nil,
820guess whether SGML markup should be skipped according to the name of the 833guess whether SGML markup should be skipped according to the name of the
821buffer's major mode." 834buffer's major mode."
822 :type '(choice (const t) (const nil) 835 :type '(choice (const :tag "always" t) (const :tag "never" nil)
823 (other :tag "use-mode-name" use-mode-name)) 836 (const :tag "use-mode-name" use-mode-name))
824 :group 'ispell) 837 :group 'ispell)
825 838
826(defvar ispell-local-pdict ispell-personal-dictionary 839(defvar ispell-local-pdict ispell-personal-dictionary
@@ -841,7 +854,7 @@ Ispell is then restarted because the local words could conflict.")
841 854
842(defvar ispell-parser 'use-mode-name 855(defvar ispell-parser 'use-mode-name
843 "*Indicates whether ispell should parse the current buffer as TeX Code. 856 "*Indicates whether ispell should parse the current buffer as TeX Code.
844Special value `use-mode-name' tries to guess using the name of major-mode. 857Special value `use-mode-name' tries to guess using the name of `major-mode'.
845Default parser is `nroff'. 858Default parser is `nroff'.
846Currently the only other valid parser is `tex'. 859Currently the only other valid parser is `tex'.
847 860
@@ -863,7 +876,9 @@ You can set this variable in hooks in your init file -- eg:
863 876
864(and (not (string-match "18\\.[0-9]+\\.[0-9]+" emacs-version)) 877(and (not (string-match "18\\.[0-9]+\\.[0-9]+" emacs-version))
865 (not (boundp 'epoch::version)) 878 (not (boundp 'epoch::version))
866 (defalias 'ispell 'ispell-buffer)) 879 (defalias 'ispell 'ispell-buffer)
880 (defalias 'ispell-check-version 'check-ispell-version))
881
867 882
868(if (not (fboundp 'buffer-substring-no-properties)) 883(if (not (fboundp 'buffer-substring-no-properties))
869 (defun buffer-substring-no-properties (start end) 884 (defun buffer-substring-no-properties (start end)
@@ -878,15 +893,15 @@ You can set this variable in hooks in your init file -- eg:
878If the word is not found in dictionary, display possible corrections 893If the word is not found in dictionary, display possible corrections
879in a window allowing you to choose one. 894in a window allowing you to choose one.
880 895
881With a prefix argument (or if CONTINUE is non-nil),
882resume interrupted spell-checking of a buffer or region.
883
884If optional argument FOLLOWING is non-nil or if `ispell-following-word' 896If optional argument FOLLOWING is non-nil or if `ispell-following-word'
885is non-nil when called interactively, then the following word 897is non-nil when called interactively, then the following word
886\(rather than preceding\) is checked when the cursor is not over a word. 898\(rather than preceding\) is checked when the cursor is not over a word.
887When the optional argument QUIETLY is non-nil or `ispell-quietly' is non-nil 899When the optional argument QUIETLY is non-nil or `ispell-quietly' is non-nil
888when called interactively, non-corrective messages are suppressed. 900when called interactively, non-corrective messages are suppressed.
889 901
902With a prefix argument (or if CONTINUE is non-nil),
903resume interrupted spell-checking of a buffer or region.
904
890Word syntax described by `ispell-dictionary-alist' (which see). 905Word syntax described by `ispell-dictionary-alist' (which see).
891 906
892This will check or reload the dictionary. Use \\[ispell-change-dictionary] 907This will check or reload the dictionary. Use \\[ispell-change-dictionary]
@@ -1458,7 +1473,7 @@ SPC: Accept word this time.
1458 1473
1459 1474
1460(defun lookup-words (word &optional lookup-dict) 1475(defun lookup-words (word &optional lookup-dict)
1461 "Look up word in word-list dictionary. 1476 "Look up WORD in optional word-list dictionary LOOKUP-DICT.
1462A `*' serves as a wild card. If no wild cards, `look' is used if it exists. 1477A `*' serves as a wild card. If no wild cards, `look' is used if it exists.
1463Otherwise the variable `ispell-grep-command' contains the command used to 1478Otherwise the variable `ispell-grep-command' contains the command used to
1464search for the words (usually egrep). 1479search for the words (usually egrep).
@@ -1670,7 +1685,7 @@ scrolling the current window. Leave the new window selected."
1670 ((string= output "-") t) ; compound word match 1685 ((string= output "-") t) ; compound word match
1671 ((string= (substring output 0 1) "+") ; found because of root word 1686 ((string= (substring output 0 1) "+") ; found because of root word
1672 (substring output 2)) ; return root word 1687 (substring output 2)) ; return root word
1673 ((equal 0 (string-match "[\ a-zA-Z]" output)) 1688 ((equal 0 (string-match "[\ra-zA-Z]" output))
1674 (ding) ; error message from ispell! 1689 (ding) ; error message from ispell!
1675 (message (concat "Ispell error: " output)) 1690 (message (concat "Ispell error: " output))
1676 (sit-for 5) 1691 (sit-for 5)
@@ -1698,7 +1713,7 @@ scrolling the current window. Leave the new window selected."
1698 (if (match-end 1) ; True only when at end of line. 1713 (if (match-end 1) ; True only when at end of line.
1699 (setq output nil) ; no more misses or guesses 1714 (setq output nil) ; no more misses or guesses
1700 (setq output (substring output (+ end 2)))))) 1715 (setq output (substring output (+ end 2))))))
1701 (list original-word offset miss-list guess-list))))) 1716 (list original-word offset (nreverse miss-list)(nreverse guess-list))))))
1702 1717
1703 1718
1704(defun check-ispell-version (&optional interactivep) 1719(defun check-ispell-version (&optional interactivep)
@@ -1711,10 +1726,12 @@ scrolling the current window. Leave the new window selected."
1711 ;; themselves on startup. 1726 ;; themselves on startup.
1712 (interactive "p") 1727 (interactive "p")
1713 (let ((result t) 1728 (let ((result t)
1714 case-fold-search status) 1729 (case-fold-search-val case-fold-search)
1730 ;; avoid bugs when syntax of `.' changes in various default modes
1731 (default-major-mode 'fundamental-mode)
1732 status)
1715 (save-excursion 1733 (save-excursion
1716 (set-buffer (get-buffer-create " *ispell-tmp*")) 1734 (set-buffer (get-buffer-create " *ispell-tmp*"))
1717 (setq case-fold-search t)
1718 (erase-buffer) 1735 (erase-buffer)
1719 (setq status (call-process ispell-program-name nil t nil "-v")) 1736 (setq status (call-process ispell-program-name nil t nil "-v"))
1720 (goto-char (point-min)) 1737 (goto-char (point-min))
@@ -1730,11 +1747,14 @@ scrolling the current window. Leave the new window selected."
1730 (if (not (memq status '(0 nil))) 1747 (if (not (memq status '(0 nil)))
1731 (error "%s exited with %s %s" ispell-program-name 1748 (error "%s exited with %s %s" ispell-program-name
1732 (if (stringp status) "signal" "code") status)) 1749 (if (stringp status) "signal" "code") status))
1733 (if (not (re-search-forward 1750 (setq case-fold-search t
1734 (concat "\\<\\(" 1751 status (re-search-forward
1735 (regexp-quote (car ispell-required-version)) 1752 (concat "\\<\\("
1736 "\\)\\([0-9]*\\)\\>") 1753 (regexp-quote (car ispell-required-version))
1737 nil t)) 1754 "\\)\\([0-9]*\\)\\>")
1755 nil t)
1756 case-fold-search case-fold-search-val)
1757 (if (not status)
1738 (error "%s version 3 release %s%s or greater is required" 1758 (error "%s version 3 release %s%s or greater is required"
1739 ispell-program-name (car ispell-required-version) 1759 ispell-program-name (car ispell-required-version)
1740 (car (cdr ispell-required-version))) 1760 (car (cdr ispell-required-version)))
@@ -1743,8 +1763,8 @@ scrolling the current window. Leave the new window selected."
1743 (match-beginning 2) (match-end 2)))) 1763 (match-beginning 2) (match-end 2))))
1744 (car (cdr ispell-required-version))) 1764 (car (cdr ispell-required-version)))
1745 (setq ispell-offset 0))) 1765 (setq ispell-offset 0)))
1746 (kill-buffer (current-buffer)) 1766 (kill-buffer (current-buffer)))
1747 result))) 1767 result))
1748 1768
1749 1769
1750(defun ispell-init-process () 1770(defun ispell-init-process ()
@@ -1790,13 +1810,14 @@ scrolling the current window. Leave the new window selected."
1790 (if (and (boundp 'enable-multibyte-characters) 1810 (if (and (boundp 'enable-multibyte-characters)
1791 (fboundp 'set-process-coding-system) 1811 (fboundp 'set-process-coding-system)
1792 enable-multibyte-characters) 1812 enable-multibyte-characters)
1793 (set-process-coding-system ispell-process (ispell-get-coding-system))) 1813 (set-process-coding-system ispell-process (ispell-get-coding-system)
1814 (ispell-get-coding-system)))
1794 ;; Get version ID line 1815 ;; Get version ID line
1795 (if (not (string-match "18\\.[0-9]+\\.[0-9]+" emacs-version)) 1816 (if (not (string-match "18\\.[0-9]+\\.[0-9]+" emacs-version))
1796 (accept-process-output ispell-process 5) 1817 (accept-process-output ispell-process 3)
1797 (accept-process-output ispell-process)) 1818 (accept-process-output ispell-process))
1798 ;; get more output if filter empty? 1819 ;; get more output if filter empty?
1799 (if (null ispell-filter) (accept-process-output ispell-process 5)) 1820 (if (null ispell-filter) (accept-process-output ispell-process 3))
1800 (cond ((null ispell-filter) 1821 (cond ((null ispell-filter)
1801 (error "%s did not output version line" ispell-program-name)) 1822 (error "%s did not output version line" ispell-program-name))
1802 ((and 1823 ((and
@@ -1804,7 +1825,7 @@ scrolling the current window. Leave the new window selected."
1804 (if (string-match "warning: " (car ispell-filter)) 1825 (if (string-match "warning: " (car ispell-filter))
1805 (progn 1826 (progn
1806 (if (not (string-match "18\\.[0-9]+\\.[0-9]+" emacs-version)) 1827 (if (not (string-match "18\\.[0-9]+\\.[0-9]+" emacs-version))
1807 (accept-process-output ispell-process 5) ; was warn msg. 1828 (accept-process-output ispell-process 3) ; was warn msg.
1808 (accept-process-output ispell-process)) 1829 (accept-process-output ispell-process))
1809 (stringp (car ispell-filter))) 1830 (stringp (car ispell-filter)))
1810 (null (cdr ispell-filter))) 1831 (null (cdr ispell-filter)))
@@ -1817,7 +1838,7 @@ scrolling the current window. Leave the new window selected."
1817 ;; But first wait to see if some more output is going to arrive. 1838 ;; But first wait to see if some more output is going to arrive.
1818 ;; Otherwise we get cool errors like "Can't open ". 1839 ;; Otherwise we get cool errors like "Can't open ".
1819 (sleep-for 1) 1840 (sleep-for 1)
1820 (accept-process-output) 1841 (accept-process-output ispell-process 3)
1821 (error "%s" (mapconcat 'identity ispell-filter "\n")))) 1842 (error "%s" (mapconcat 'identity ispell-filter "\n"))))
1822 (setq ispell-filter nil) ; Discard version ID line 1843 (setq ispell-filter nil) ; Discard version ID line
1823 (let ((extended-char-mode (ispell-get-extended-character-mode))) 1844 (let ((extended-char-mode (ispell-get-extended-character-mode)))
@@ -1835,7 +1856,15 @@ With NO-ERROR, just return non-nil if there was no Ispell running."
1835 (eq (process-status ispell-process) 'run))) 1856 (eq (process-status ispell-process) 'run)))
1836 (or no-error 1857 (or no-error
1837 (error "There is no ispell process running!")) 1858 (error "There is no ispell process running!"))
1838 (kill-process ispell-process) 1859 (process-send-eof ispell-process)
1860 (process-send-string ispell-process "\n") ; make sure side effects occured
1861 (if (eq (process-status ispell-process) 'run)
1862 (accept-process-output ispell-process 1))
1863 (if (eq (process-status ispell-process) 'run)
1864 (kill-process ispell-process))
1865 (while (not (or (eq (process-status ispell-process) 'exit)
1866 (eq (process-status ispell-process) 'signal)))
1867 (sleep-for 0 250))
1839 (setq ispell-process nil) 1868 (setq ispell-process nil)
1840 (message "Ispell process killed") 1869 (message "Ispell process killed")
1841 nil)) 1870 nil))
@@ -1846,7 +1875,7 @@ With NO-ERROR, just return non-nil if there was no Ispell running."
1846 1875
1847;;;###autoload 1876;;;###autoload
1848(defun ispell-change-dictionary (dict &optional arg) 1877(defun ispell-change-dictionary (dict &optional arg)
1849 "Change `ispell-dictionary' (q.v.) and kill old Ispell process. 1878 "Change `ispell-dictionary' (q.v.) to DICT and kill old Ispell process.
1850A new one will be started as soon as necessary. 1879A new one will be started as soon as necessary.
1851 1880
1852By just answering RET you can find out what the current dictionary is. 1881By just answering RET you can find out what the current dictionary is.
@@ -1894,7 +1923,7 @@ With prefix argument, set the default directory."
1894;;;###autoload 1923;;;###autoload
1895(defun ispell-region (reg-start reg-end) 1924(defun ispell-region (reg-start reg-end)
1896 "Interactively check a region for spelling errors. 1925 "Interactively check a region for spelling errors.
1897Return non-nil if not aborted." 1926Return non-nil if spell session completed normally."
1898 (interactive "r") ; Don't flag errors on read-only bufs. 1927 (interactive "r") ; Don't flag errors on read-only bufs.
1899 (ispell-accept-buffer-local-defs) ; set up dictionary, local words, etc. 1928 (ispell-accept-buffer-local-defs) ; set up dictionary, local words, etc.
1900 (unwind-protect 1929 (unwind-protect
@@ -1959,8 +1988,7 @@ Return non-nil if not aborted."
1959 (if string ; there is something to spell check! 1988 (if string ; there is something to spell check!
1960 (ispell-process-line string)) ; (special start end) 1989 (ispell-process-line string)) ; (special start end)
1961 (goto-char end))))) 1990 (goto-char end)))))
1962 (not ispell-quit) 1991 (not ispell-quit))
1963 )
1964 ;; protected 1992 ;; protected
1965 (if (get-buffer ispell-choices-buffer) 1993 (if (get-buffer ispell-choices-buffer)
1966 (kill-buffer ispell-choices-buffer)) 1994 (kill-buffer ispell-choices-buffer))
@@ -1975,7 +2003,7 @@ Return non-nil if not aborted."
1975 (if (and ispell-checking-message (numberp ispell-quit)) 2003 (if (and ispell-checking-message (numberp ispell-quit))
1976 (progn 2004 (progn
1977 (setq ispell-quit nil) 2005 (setq ispell-quit nil)
1978 (error "Message send aborted."))) 2006 (error "Message send aborted")))
1979 (setq ispell-quit nil)) 2007 (setq ispell-quit nil))
1980 (set-marker ispell-region-end nil) 2008 (set-marker ispell-region-end nil)
1981 ;; Only save if successful exit. 2009 ;; Only save if successful exit.
@@ -1999,16 +2027,24 @@ Return non-nil if not aborted."
1999 (if ispell-skip-tib 2027 (if ispell-skip-tib
2000 (setq skip-regexp (concat ispell-tib-ref-beginning "\\|" skip-regexp))) 2028 (setq skip-regexp (concat ispell-tib-ref-beginning "\\|" skip-regexp)))
2001 (if ispell-skip-sgml 2029 (if ispell-skip-sgml
2002 (setq skip-regexp (concat "[<&]\\|" skip-regexp))) 2030 (setq skip-regexp (concat "<author>" "\\|"
2031 "<[cC][oO][dD][eE]>" "\\|"
2032 "<[vV][eE][rR][bB]>" "\\|"
2033 "<[tT][tT]>" "\\|"
2034 "<[tT][tT]/" "\\|"
2035 "</" "\\|"
2036 "<" "\\|"
2037 "&" "\\|"
2038 skip-regexp)))
2003 (if (eq ispell-parser 'tex) 2039 (if (eq ispell-parser 'tex)
2004 (setq skip-regexp (concat (ispell-begin-tex-skip-regexp) "\\|" 2040 (setq skip-regexp (concat (ispell-begin-tex-skip-regexp) "\\|"
2005 skip-regexp))) 2041 skip-regexp)))
2006 skip-regexp)) 2042 skip-regexp))
2007 2043
2008 2044
2009;;; Regular expression of tex commands to skip.
2010;;; Generated from `ispell-tex-skip-alists'
2011(defun ispell-begin-tex-skip-regexp () 2045(defun ispell-begin-tex-skip-regexp ()
2046 "Regular expression of tex commands to skip.
2047Generated from `ispell-tex-skip-alists'."
2012 (concat 2048 (concat
2013 (mapconcat (function (lambda (lst) (car lst))) 2049 (mapconcat (function (lambda (lst) (car lst)))
2014 (car ispell-tex-skip-alists) 2050 (car ispell-tex-skip-alists)
@@ -2022,10 +2058,10 @@ Return non-nil if not aborted."
2022 "\\|"))) 2058 "\\|")))
2023 2059
2024 2060
2025;;; Regular expression of regions to skip for all buffers.
2026;;; Each selection should be a key of `ispell-skip-region-alist'
2027;;; otherwise, the current line is skipped.
2028(defun ispell-begin-skip-region () 2061(defun ispell-begin-skip-region ()
2062 "Regular expression of regions to skip for all buffers.
2063Each selection should be a key of `ispell-skip-region-alist';
2064otherwise, the current line is skipped."
2029 (mapconcat (function (lambda (lst) (if (stringp (car lst)) (car lst) 2065 (mapconcat (function (lambda (lst) (if (stringp (car lst)) (car lst)
2030 (eval (car lst))))) 2066 (eval (car lst)))))
2031 ispell-skip-region-alist 2067 ispell-skip-region-alist
@@ -2062,8 +2098,20 @@ Return non-nil if not aborted."
2062 (search-forward comment-start ispell-region-end :end)) 2098 (search-forward comment-start ispell-region-end :end))
2063 ((and ispell-skip-tib (string-match ispell-tib-ref-beginning key)) 2099 ((and ispell-skip-tib (string-match ispell-tib-ref-beginning key))
2064 (re-search-forward ispell-tib-ref-end ispell-region-end t)) 2100 (re-search-forward ispell-tib-ref-end ispell-region-end t))
2065 ((and ispell-skip-sgml (string-match "<" key)) 2101 ((and ispell-skip-sgml (string-match "<author>" key))
2102 (search-forward-regexp ".$" ispell-region-end t))
2103 ((and ispell-skip-sgml (string-match "</" key))
2066 (search-forward ">" ispell-region-end t)) 2104 (search-forward ">" ispell-region-end t))
2105 ((and ispell-skip-sgml (string-match "<[cC][oO][dD][eE]>" key))
2106 (search-forward-regexp "</[cC][oO][dD][eE]>" ispell-region-end t))
2107 ((and ispell-skip-sgml (string-match "<[vV][eE][rR][bB]>" key))
2108 (search-forward-regexp "</[vV][eE][rR][bB]>" ispell-region-end t))
2109 ((and ispell-skip-sgml (string-match "<[tT][tT]>" key))
2110 (search-forward-regexp "</[tT][tT]>" ispell-region-end t))
2111 ((and ispell-skip-sgml (string-match "<[tT][tT]/" key))
2112 (search-forward "/" ispell-region-end t))
2113 ((and ispell-skip-sgml (string-match "<" key))
2114 (search-forward-regexp "[/>]" ispell-region-end t))
2067 ((and ispell-skip-sgml (string-match "&" key)) 2115 ((and ispell-skip-sgml (string-match "&" key))
2068 (search-forward ";" ispell-region-end t)) 2116 (search-forward ";" ispell-region-end t))
2069 ;; markings from alist 2117 ;; markings from alist
@@ -2257,7 +2305,7 @@ Return non-nil if not aborted."
2257 (setq state (parse-partial-sexp start (point-max) 2305 (setq state (parse-partial-sexp start (point-max)
2258 nil nil state 'syntax-table)) 2306 nil nil state 'syntax-table))
2259 (when (or (nth 3 state) (nth 4 state)) 2307 (when (or (nth 3 state) (nth 4 state))
2260 (error "Unterminated string or comment.")) 2308 (error "Unterminated string or comment"))
2261 (save-excursion 2309 (save-excursion
2262 (setq done (not (ispell-region start (point)))))))))) 2310 (setq done (not (ispell-region start (point))))))))))
2263 2311
@@ -2271,8 +2319,8 @@ Return non-nil if not aborted."
2271 2319
2272;;;###autoload 2320;;;###autoload
2273(defun ispell-continue () 2321(defun ispell-continue ()
2274 (interactive)
2275 "Continue a halted spelling session beginning with the current word." 2322 "Continue a halted spelling session beginning with the current word."
2323 (interactive)
2276 (if (not (marker-position ispell-region-end)) 2324 (if (not (marker-position ispell-region-end))
2277 (message "No session to continue. Use 'X' command when checking!") 2325 (message "No session to continue. Use 'X' command when checking!")
2278 (if (not (equal (marker-buffer ispell-region-end) (current-buffer))) 2326 (if (not (equal (marker-buffer ispell-region-end) (current-buffer)))
@@ -2301,14 +2349,14 @@ Return non-nil if not aborted."
2301 2349
2302;;;###autoload 2350;;;###autoload
2303(defun ispell-complete-word (&optional interior-frag) 2351(defun ispell-complete-word (&optional interior-frag)
2304 "Look up word before or under point in dictionary (see lookup-words command) 2352 "Try to complete the word before or under point (see `lookup-words')
2305and try to complete it. If optional INTERIOR-FRAG is non-nil then the word 2353If optional INTERIOR-FRAG is non-nil then the word may be a character
2306may be a character sequence inside of a word. 2354sequence inside of a word.
2307 2355
2308Standard ispell choices are then available." 2356Standard ispell choices are then available."
2309 (interactive "P") 2357 (interactive "P")
2310 (let ((cursor-location (point)) 2358 (let ((cursor-location (point))
2311 case-fold-search 2359 (case-fold-search-val case-fold-search)
2312 (word (ispell-get-word nil "\\*")) ; force "previous-word" processing. 2360 (word (ispell-get-word nil "\\*")) ; force "previous-word" processing.
2313 start end possibilities replacement) 2361 start end possibilities replacement)
2314 (setq start (car (cdr word)) 2362 (setq start (car (cdr word))
@@ -2325,13 +2373,20 @@ Standard ispell choices are then available."
2325 ((null possibilities) 2373 ((null possibilities)
2326 (message "No match for \"%s\"" word)) 2374 (message "No match for \"%s\"" word))
2327 (t ; There is a modification... 2375 (t ; There is a modification...
2328 (cond ; Try and respect case of word. 2376 (setq case-fold-search nil) ; Try and respect case of word.
2329 ((string-match "^[^A-Z]+$" word) 2377 (cond
2330 (setq possibilities (mapcar 'downcase possibilities))) 2378 ((string-equal (upcase word) word)
2331 ((string-match "^[^a-z]+$" word)
2332 (setq possibilities (mapcar 'upcase possibilities))) 2379 (setq possibilities (mapcar 'upcase possibilities)))
2333 ((string-match "^[A-Z]" word) 2380 ((string-equal (upcase (substring word 0 1)) (substring word 0 1))
2334 (setq possibilities (mapcar 'capitalize possibilities)))) 2381 (setq possibilities (mapcar (function
2382 (lambda (pos)
2383 (if (string-equal
2384 (substring word 0 1)
2385 (substring pos 0 1))
2386 pos
2387 (capitalize pos))))
2388 possibilities))))
2389 (setq case-fold-search case-fold-search-val)
2335 (save-window-excursion 2390 (save-window-excursion
2336 (setq replacement 2391 (setq replacement
2337 (ispell-command-loop possibilities nil word start end))) 2392 (ispell-command-loop possibilities nil word start end)))
@@ -2411,13 +2466,15 @@ Don't read buffer-local settings or word lists."
2411 (let ((ispell-minor-mode nil) 2466 (let ((ispell-minor-mode nil)
2412 (ispell-check-only t) 2467 (ispell-check-only t)
2413 (last-char (char-after (1- (point))))) 2468 (last-char (char-after (1- (point)))))
2414 (if (or (eq last-char ?\ ) (eq last-char ?\n)) 2469 (if (or (eq last-char ?\ ) (eq last-char ?\n)
2470 (and ispell-skip-sgml (eq last-char ?>))
2471 (and ispell-skip-sgml (eq last-char ?\;)))
2415 nil 2472 nil
2416 (save-window-excursion 2473 (save-window-excursion
2417 (save-restriction 2474 (save-restriction
2418 (narrow-to-region (save-excursion (forward-line -1) (point)) (point)) 2475 (narrow-to-region (save-excursion (forward-line -1) (point)) (point))
2419 (ispell-word nil t)))) 2476 (ispell-word nil t))))
2420 (call-interactively (key-binding (this-command-keys))))) 2477 (command-execute (key-binding (this-command-keys)))))
2421 2478
2422 2479
2423;;; ********************************************************************** 2480;;; **********************************************************************
@@ -2446,7 +2503,7 @@ Don't read buffer-local settings or word lists."
2446 ;; Matches commonly used "cut" boundaries 2503 ;; Matches commonly used "cut" boundaries
2447 "^\\(- \\)?[-=_]+\\s ?\\(cut here\\|Environment Follows\\)") 2504 "^\\(- \\)?[-=_]+\\s ?\\(cut here\\|Environment Follows\\)")
2448 "\\|") 2505 "\\|")
2449 "*End of text which will be checked in ispell-message. 2506 "*End of text which will be checked in `ispell-message'.
2450If it is a string, limit at first occurrence of that regular expression. 2507If it is a string, limit at first occurrence of that regular expression.
2451Otherwise, it must be a function which is called to get the limit.") 2508Otherwise, it must be a function which is called to get the limit.")
2452 2509
@@ -2509,16 +2566,18 @@ You can bind this to the key C-c i in GNUS or mail by adding to
2509 ((or (equal major-mode 'news-reply-mode) ;GNUS 4 & below 2566 ((or (equal major-mode 'news-reply-mode) ;GNUS 4 & below
2510 (equal major-mode 'message-mode)) ;GNUS 5 2567 (equal major-mode 'message-mode)) ;GNUS 5
2511 (concat "In article <" "\\|" 2568 (concat "In article <" "\\|"
2512 "[^,;&+=]+ <[^,;&+=]+> writes:" "\\|" 2569 "[^,;&+=\n]+ <[^,;&+=]+> writes:" "\\|"
2570 message-yank-prefix "\\|"
2513 default-prefix)) 2571 default-prefix))
2514 ((equal major-mode 'mh-letter-mode) ; mh mail message 2572 ((equal major-mode 'mh-letter-mode) ; mh mail message
2515 (ispell-non-empty-string mh-ins-buf-prefix)) 2573 (concat "[^,;&+=\n]+ writes:" "\\|"
2574 (ispell-non-empty-string mh-ins-buf-prefix)))
2516 ((not internal-messagep) ; Assume nn sent us this message. 2575 ((not internal-messagep) ; Assume nn sent us this message.
2517 (concat "In [a-zA-Z.]+ you write:" "\\|" 2576 (concat "In [a-zA-Z.]+ you write:" "\\|"
2518 "In <[^,;&+=]+> [^,;&+=]+ writes:" "\\|" 2577 "In <[^,;&+=]+> [^,;&+=]+ writes:" "\\|"
2519 " *> *")) 2578 " *> *"))
2520 ((boundp 'vm-included-text-prefix) ; VM mail message 2579 ((boundp 'vm-included-text-prefix) ; VM mail message
2521 (concat "[^,;&+=]+ writes:" "\\|" 2580 (concat "[^,;&+=\n]+ writes:" "\\|"
2522 (ispell-non-empty-string vm-included-text-prefix))) 2581 (ispell-non-empty-string vm-included-text-prefix)))
2523 (t default-prefix))) 2582 (t default-prefix)))
2524 (ispell-skip-region-alist 2583 (ispell-skip-region-alist
@@ -2526,7 +2585,6 @@ You can bind this to the key C-c i in GNUS or mail by adding to
2526 (function forward-line)) 2585 (function forward-line))
2527 ispell-skip-region-alist)) 2586 ispell-skip-region-alist))
2528 (old-case-fold-search case-fold-search) 2587 (old-case-fold-search case-fold-search)
2529 (case-fold-search t)
2530 (dictionary-alist ispell-message-dictionary-alist) 2588 (dictionary-alist ispell-message-dictionary-alist)
2531 (ispell-checking-message t)) 2589 (ispell-checking-message t))
2532 2590
@@ -2544,18 +2602,21 @@ You can bind this to the key C-c i in GNUS or mail by adding to
2544 (progn 2602 (progn
2545 ;; Spell check any original Subject: 2603 ;; Spell check any original Subject:
2546 (goto-char (point-min)) 2604 (goto-char (point-min))
2605 (setq case-fold-search t)
2547 (if (re-search-forward "^Subject: *" end-of-headers t) 2606 (if (re-search-forward "^Subject: *" end-of-headers t)
2548 (progn 2607 (progn
2549 (goto-char (match-end 0)) 2608 (goto-char (match-end 0))
2550 (if (and (not (looking-at ".*Re\\>")) 2609 (if (and (not (looking-at ".*Re\\>"))
2551 (not (looking-at "\\["))) 2610 (not (looking-at "\\[")))
2552 (let ((case-fold-search old-case-fold-search)) 2611 (progn
2612 (setq case-fold-search old-case-fold-search)
2553 (ispell-region (point) 2613 (ispell-region (point)
2554 (progn ;Tab-initiated continuation lns. 2614 (progn ;Tab-initiated continuation lns.
2555 (end-of-line) 2615 (end-of-line)
2556 (while (looking-at "\n[ \t]") 2616 (while (looking-at "\n[ \t]")
2557 (end-of-line 2)) 2617 (end-of-line 2))
2558 (point))))))) 2618 (point)))))))
2619 (setq case-fold-search old-case-fold-search)
2559 (goto-char end-of-headers) 2620 (goto-char end-of-headers)
2560 (forward-line 1) 2621 (forward-line 1)
2561 (ispell-region (point) limit)) 2622 (ispell-region (point) limit))
@@ -2599,9 +2660,8 @@ Includes Latex/Nroff modes and extended character mode."
2599 ;; If needed, test for SGML & HTML modes and set a buffer local nil/t value. 2660 ;; If needed, test for SGML & HTML modes and set a buffer local nil/t value.
2600 (if (and ispell-skip-sgml (not (eq ispell-skip-sgml t))) 2661 (if (and ispell-skip-sgml (not (eq ispell-skip-sgml t)))
2601 (set (make-local-variable 'ispell-skip-sgml) 2662 (set (make-local-variable 'ispell-skip-sgml)
2602 (not (null (let ((case-fold-search t)) 2663 (not (null (string-match "sgml\\|html"
2603 (string-match "sgml\\|html" 2664 (downcase (symbol-name major-mode)))))))
2604 (symbol-name major-mode)))))))
2605 ;; Set default extended character mode for given buffer, if any. 2665 ;; Set default extended character mode for given buffer, if any.
2606 (let ((extended-char-mode (ispell-get-extended-character-mode))) 2666 (let ((extended-char-mode (ispell-get-extended-character-mode)))
2607 (if extended-char-mode 2667 (if extended-char-mode
@@ -2612,17 +2672,16 @@ Includes Latex/Nroff modes and extended character mode."
2612 ;; Uses last occurrence of ispell-parsing-keyword 2672 ;; Uses last occurrence of ispell-parsing-keyword
2613 (if (search-backward ispell-parsing-keyword nil t) 2673 (if (search-backward ispell-parsing-keyword nil t)
2614 (let ((end (save-excursion (end-of-line) (point))) 2674 (let ((end (save-excursion (end-of-line) (point)))
2615 (case-fold-search t)
2616 string) 2675 string)
2617 (search-forward ispell-parsing-keyword) 2676 (search-forward ispell-parsing-keyword)
2618 (while (re-search-forward " *\\([^ \"]+\\)" end t) 2677 (while (re-search-forward " *\\([^ \"]+\\)" end t)
2619 ;; space separated definitions. 2678 ;; space separated definitions.
2620 (setq string (buffer-substring-no-properties (match-beginning 1) 2679 (setq string (downcase (buffer-substring-no-properties
2621 (match-end 1))) 2680 (match-beginning 1) (match-end 1))))
2622 (cond ((string-match "latex-mode" string) 2681 (cond ((string-match "latex-mode" string)
2623 (process-send-string ispell-process "+\n~tex\n")) 2682 (process-send-string ispell-process "+\n~tex\n"))
2624 ((string-match "nroff-mode" string) 2683 ((string-match "nroff-mode" string)
2625 (process-send-string ispell-process "-\n~nroff")) 2684 (process-send-string ispell-process "-\n~nroff\n"))
2626 ((string-match "~" string) ; Set extended character mode. 2685 ((string-match "~" string) ; Set extended character mode.
2627 (process-send-string ispell-process (concat string "\n"))) 2686 (process-send-string ispell-process (concat string "\n")))
2628 (t (message "Invalid Ispell Parsing argument!") 2687 (t (message "Invalid Ispell Parsing argument!")
@@ -2704,17 +2763,20 @@ Both should not be used to define a buffer-local dictionary."
2704;;; returns optionally adjusted region-end-point. 2763;;; returns optionally adjusted region-end-point.
2705 2764
2706(defun ispell-add-per-file-word-list (word) 2765(defun ispell-add-per-file-word-list (word)
2707 "Adds new word to the per-file word list." 2766 "Add WORD to the per-file word list."
2708 (or ispell-buffer-local-name 2767 (or ispell-buffer-local-name
2709 (setq ispell-buffer-local-name (buffer-name))) 2768 (setq ispell-buffer-local-name (buffer-name)))
2710 (save-excursion 2769 (save-excursion
2711 (goto-char (point-min)) 2770 (goto-char (point-min))
2712 (let (case-fold-search line-okay search done string) 2771 (let ((old-case-fold-search case-fold-search)
2772 line-okay search done string)
2713 (while (not done) 2773 (while (not done)
2714 (setq search (search-forward ispell-words-keyword nil 'move) 2774 (setq case-fold-search nil
2775 search (search-forward ispell-words-keyword nil 'move)
2715 line-okay (< (+ (length word) 1 ; 1 for space after word.. 2776 line-okay (< (+ (length word) 1 ; 1 for space after word..
2716 (progn (end-of-line) (current-column))) 2777 (progn (end-of-line) (current-column)))
2717 80)) 2778 80)
2779 case-fold-search old-case-fold-search)
2718 (if (or (and search line-okay) 2780 (if (or (and search line-okay)
2719 (null search)) 2781 (null search))
2720 (progn 2782 (progn
@@ -2733,7 +2795,7 @@ Both should not be used to define a buffer-local dictionary."
2733 (insert (concat " " word)))))))) 2795 (insert (concat " " word))))))))
2734 2796
2735 2797
2736(defconst ispell-version "ispell.el 3.0 -- Tue Apr 28 14:40:01 PDT 1998") 2798(defconst ispell-version "ispell.el 3.1 -- Mon Nov 30 20:32:48 PST 1998")
2737 2799
2738(provide 'ispell) 2800(provide 'ispell)
2739 2801
@@ -2775,4 +2837,3 @@ Both should not be used to define a buffer-local dictionary."
2775; LocalWords: VM lns HTML eval american IspellPersDict 2837; LocalWords: VM lns HTML eval american IspellPersDict
2776 2838
2777;;; ispell.el ends here 2839;;; ispell.el ends here
2778