aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-06-16 05:13:01 +0000
committerRichard M. Stallman1995-06-16 05:13:01 +0000
commit8ce8687ea587e23dda18a59609981a0ba9e11d73 (patch)
treef61aeca1b3754317fcc42194db60838d8939f328
parent063c96e6754f8f3cb55f0afaf7f8dc4419205b03 (diff)
downloademacs-8ce8687ea587e23dda18a59609981a0ba9e11d73.tar.gz
emacs-8ce8687ea587e23dda18a59609981a0ba9e11d73.zip
Removed autoload from ispell-dictionary-alist,
ispell-menu-map, ispell-menu-lucid, and ispell-menu-map-needed so users can more easily modify and upgrade entries. (ispell-dictionary-alist): Once more a single variable. (ispell-required-version): Documentation changes (ispell-skip-sgml): Documentation changes (ispell-command-loop): mode-line-format now shows misspelled word. (ispell-message-text-end): Can now process postscript version 1. (ispell-message-start-skip): New variable for block skips, set up for pgp and forward blocks. (ispell-message-end-skip): New variable for block skips, set up for pgp and forward blocks. (ispell-message): Added block message skipping. (ispell-buffer-local-parsing): Added html-mode.
-rw-r--r--lisp/textmodes/ispell.el108
1 files changed, 64 insertions, 44 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index a8c3cb3d809..922402104b1 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -8,13 +8,16 @@
8;;; Authors : Ken Stevens <k.stevens@ieee.org> 8;;; Authors : Ken Stevens <k.stevens@ieee.org>
9;;; Note: version numbers and time stamp are not updated 9;;; Note: version numbers and time stamp are not updated
10;;; when this file is edited for release with GNU Emacs. 10;;; when this file is edited for release with GNU Emacs.
11;;; Last Modified On: Mon Feb 6 17:39:38 EST 1995 11;;; Last Modified On: Tue Jun 13 12:05:28 EDT 1995
12;;; Update Revision : 2.36 12;;; Update Revision : 2.37
13;;; Syntax : emacs-lisp 13;;; Syntax : emacs-lisp
14;;; Status : Release with 3.1.12+ ispell. 14;;; Status : Release with 3.1.12+ ispell.
15;;; Version : International Ispell Version 3.1 by Geoff Kuenning. 15;;; Version : International Ispell Version 3.1 by Geoff Kuenning.
16;;; Bug Reports : ispell-el-bugs@itcorp.com 16;;; Bug Reports : ispell-el-bugs@itcorp.com
17;;; 17;;;
18;;; Note: version numbers and time stamp are not updated
19;;; when this file is edited for release with GNU emacs.
20;;;
18;;; This file is part of GNU Emacs. 21;;; This file is part of GNU Emacs.
19;;; 22;;;
20;;; GNU Emacs is free software; you can redistribute it and/or modify 23;;; GNU Emacs is free software; you can redistribute it and/or modify
@@ -131,6 +134,10 @@
131;;; 134;;;
132;;; HISTORY 135;;; HISTORY
133;;; 136;;;
137;;; Revision 2.37 1995/6/13 12:05:28 stevens
138;;; Removed autoload from ispell-dictionary-alist. *choices* mode-line shows
139;;; misspelled word. Block skip for pgp & forwarded messages added.
140;;;
134;;; Revision 2.36 1995/2/6 17:39:38 stevens 141;;; Revision 2.36 1995/2/6 17:39:38 stevens
135;;; Properly adjust screen with different ispell-choices-win-default-height 142;;; Properly adjust screen with different ispell-choices-win-default-height
136;;; settings. Skips SGML entity references. 143;;; settings. Skips SGML entity references.
@@ -409,7 +416,6 @@ Otherwise use the minibuffer.")
409 "*Formatting function for displaying word being spell checked. 416 "*Formatting function for displaying word being spell checked.
410The function must take one string argument and return a string.") 417The function must take one string argument and return a string.")
411 418
412;;;###autoload
413(defvar ispell-personal-dictionary nil 419(defvar ispell-personal-dictionary nil
414 "*File name of your personal spelling dictionary, or nil. 420 "*File name of your personal spelling dictionary, or nil.
415If nil, the default personal dictionary, \"~/.ispell_DICTNAME\" is used, 421If nil, the default personal dictionary, \"~/.ispell_DICTNAME\" is used,
@@ -436,8 +442,10 @@ For example, '(\"-W\" \"3\") to cause it to accept all 1-3 character
436words as correct. See also `ispell-dictionary-alist', which may be used 442words as correct. See also `ispell-dictionary-alist', which may be used
437for language-specific arguments.") 443for language-specific arguments.")
438 444
439;;;###autoload 445;;; ispell-dictionary-alist is set up from two subvariables above
440(defvar ispell-dictionary-alist-1 ; sk 9-Aug-1991 18:28 446;;; to avoid having very long lines in loaddefs.el.
447(defvar ispell-dictionary-alist
448
441 '((nil ; default (english.aff) 449 '((nil ; default (english.aff)
442 "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil) 450 "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil)
443 ("english" ; make english explicitly selectable 451 ("english" ; make english explicitly selectable
@@ -457,11 +465,8 @@ for language-specific arguments.")
457 ("nederlands8" ; dutch8.aff 465 ("nederlands8" ; dutch8.aff
458 "[A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]" 466 "[A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]"
459 "[^A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]" 467 "[^A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]"
460 "[']" t ("-C") nil))) 468 "[']" t ("-C") nil)
461 469 ("svenska" ;7 bit swedish mode
462;;;###autoload
463(defvar ispell-dictionary-alist-2
464 '(("svenska" ;7 bit swedish mode
465 "[A-Za-z}{|\\133\\135\\\\]" "[^A-Za-z}{|\\133\\135\\\\]" 470 "[A-Za-z}{|\\133\\135\\\\]" "[^A-Za-z}{|\\133\\135\\\\]"
466 "[']" nil ("-C") nil) 471 "[']" nil ("-C") nil)
467 ("svenska8" ;8 bit swedish mode 472 ("svenska8" ;8 bit swedish mode
@@ -480,14 +485,8 @@ for language-specific arguments.")
480 ("dansk" ; dansk.aff 485 ("dansk" ; dansk.aff
481 "[A-Z\306\330\305a-z\346\370\345]" "[^A-Z\306\330\305a-z\346\370\345]" 486 "[A-Z\306\330\305a-z\346\370\345]" "[^A-Z\306\330\305a-z\346\370\345]"
482 "" nil ("-C") nil) 487 "" nil ("-C") nil)
483 )) 488 )
484 489
485
486;;; ispell-dictionary-alist is set up from two subvariables above
487;;; to avoid having very long lines in loaddefs.el.
488;;;###autoload
489(defvar ispell-dictionary-alist
490 (append ispell-dictionary-alist-1 ispell-dictionary-alist-2)
491 "An alist of dictionaries and their associated parameters. 490 "An alist of dictionaries and their associated parameters.
492 491
493Each element of this list is also a list: 492Each element of this list is also a list:
@@ -530,27 +529,21 @@ contain the same character set as casechars and otherchars in the
530language.aff file \(e.g., english.aff\).") 529language.aff file \(e.g., english.aff\).")
531 530
532 531
533;;;###autoload
534(defvar ispell-menu-map nil "Key map for ispell menu") 532(defvar ispell-menu-map nil "Key map for ispell menu")
535 533
536;;;###autoload
537(defvar ispell-menu-lucid nil "Spelling menu for Lucid Emacs.") 534(defvar ispell-menu-lucid nil "Spelling menu for Lucid Emacs.")
538 535
539;;; Break out lucid menu and split into several calls to avoid having 536;;; Break out lucid menu and split into several calls to avoid having
540;;; long lines in loaddefs.el. Detect need off following constant. 537;;; long lines in loaddefs.el. Detect need off following constant.
541 538
542;;;###autoload
543(defconst ispell-menu-map-needed ; make sure this is not Lucid Emacs 539(defconst ispell-menu-map-needed ; make sure this is not Lucid Emacs
544 (and (not ispell-menu-map) 540 (and (not ispell-menu-map)
545;;; This is commented out because it fails in Emacs. 541 (string-lessp "19" emacs-version)
546;;; due to the fact that menu-bar is loaded much later than loaddefs. 542 ;; make sure this isn't Lucid Emacs
547;;; ;; make sure this isn't Lucid Emacs 543 (not (string-match "Lucid" emacs-version))))
548;;; (featurep 'menu-bar)
549 (string-lessp "19" emacs-version)))
550 544
551 545
552;;; setup dictionary 546;;; setup dictionary
553;;;###autoload
554(if ispell-menu-map-needed 547(if ispell-menu-map-needed
555 (let ((dicts (reverse (cons (cons "default" nil) ispell-dictionary-alist))) 548 (let ((dicts (reverse (cons (cons "default" nil) ispell-dictionary-alist)))
556 name) 549 name)
@@ -566,7 +559,6 @@ language.aff file \(e.g., english.aff\).")
566 (list 'ispell-change-dictionary name)))))))) 559 (list 'ispell-change-dictionary name))))))))
567 560
568;;; define commands in menu in opposite order you want them to appear. 561;;; define commands in menu in opposite order you want them to appear.
569;;;###autoload
570(if ispell-menu-map-needed 562(if ispell-menu-map-needed
571 (progn 563 (progn
572 (define-key ispell-menu-map [ispell-change-dictionary] 564 (define-key ispell-menu-map [ispell-change-dictionary]
@@ -580,7 +572,6 @@ language.aff file \(e.g., english.aff\).")
580 (define-key ispell-menu-map [ispell-complete-word-interior-frag] 572 (define-key ispell-menu-map [ispell-complete-word-interior-frag]
581 '("Complete Word Frag" . ispell-complete-word-interior-frag)))) 573 '("Complete Word Frag" . ispell-complete-word-interior-frag))))
582 574
583;;;###autoload
584(if ispell-menu-map-needed 575(if ispell-menu-map-needed
585 (progn 576 (progn
586 (define-key ispell-menu-map [ispell-continue] 577 (define-key ispell-menu-map [ispell-continue]
@@ -592,7 +583,6 @@ language.aff file \(e.g., english.aff\).")
592 (define-key ispell-menu-map [ispell-buffer] 583 (define-key ispell-menu-map [ispell-buffer]
593 '("Check Buffer" . ispell-buffer)))) 584 '("Check Buffer" . ispell-buffer))))
594 585
595;;;###autoload
596(if ispell-menu-map-needed 586(if ispell-menu-map-needed
597 (progn 587 (progn
598 (define-key ispell-menu-map [ispell-message] 588 (define-key ispell-menu-map [ispell-message]
@@ -645,7 +635,7 @@ language.aff file \(e.g., english.aff\).")
645 635
646 636
647;;; The version must be 3.1 or greater for this version of ispell.el 637;;; The version must be 3.1 or greater for this version of ispell.el
648;;; There is an incompatibility between versin 3.1.12 and lower versions. 638;;; There is an incompatibility between version 3.1.12 and lower versions.
649(defconst ispell-required-version '("3.1." 12) 639(defconst ispell-required-version '("3.1." 12)
650 "Ispell versions with which this version of ispell.el is known to work.") 640 "Ispell versions with which this version of ispell.el is known to work.")
651(defvar ispell-offset 1 641(defvar ispell-offset 1
@@ -736,9 +726,8 @@ a `~' followed by an extended-character mode -- such as `~.tex'.")
736 726
737(defvar ispell-skip-sgml nil 727(defvar ispell-skip-sgml nil
738 "Skips spell checking of SGML tags and entity references when non-nil. 728 "Skips spell checking of SGML tags and entity references when non-nil.
739This variable is set when major-mode is sgml-mode.") 729This variable is set when major-mode is sgml-mode or html-mode.")
740 730
741;;;###autoload
742(defvar ispell-local-pdict ispell-personal-dictionary 731(defvar ispell-local-pdict ispell-personal-dictionary
743 "A buffer local variable containing the current personal dictionary. 732 "A buffer local variable containing the current personal dictionary.
744If non-nil, the value must be a string, which is a file name. 733If non-nil, the value must be a string, which is a file name.
@@ -783,7 +772,8 @@ You can set this variable in hooks in your init file -- eg:
783 (not (boundp 'epoch::version)) 772 (not (boundp 'epoch::version))
784 (defalias 'ispell 'ispell-buffer)) 773 (defalias 'ispell 'ispell-buffer))
785 774
786;;;###autoload (define-key global-map "\M-$" 'ispell-word) 775;;;###autoload
776(define-key global-map "\M-$" 'ispell-word)
787 777
788;;;###autoload 778;;;###autoload
789(defun ispell-word (&optional following quietly continue) 779(defun ispell-word (&optional following quietly continue)
@@ -973,7 +963,7 @@ used."
973 ;; setup the *Choices* buffer with valid data. 963 ;; setup the *Choices* buffer with valid data.
974 (save-excursion 964 (save-excursion
975 (set-buffer (get-buffer-create ispell-choices-buffer)) 965 (set-buffer (get-buffer-create ispell-choices-buffer))
976 (setq mode-line-format "-- %b --") 966 (setq mode-line-format (concat "-- %b -- word: " word))
977 (erase-buffer) 967 (erase-buffer)
978 (if guess 968 (if guess
979 (progn 969 (progn
@@ -1126,7 +1116,9 @@ used."
1126 (erase-buffer) 1116 (erase-buffer)
1127 (setq count ?0 1117 (setq count ?0
1128 skipped 0 1118 skipped 0
1129 mode-line-format "-- %b --" 1119 mode-line-format (concat
1120 "-- %b -- word: "
1121 new-word)
1130 miss (lookup-words new-word) 1122 miss (lookup-words new-word)
1131 choices miss) 1123 choices miss)
1132 (while (and choices ; adjust choices window. 1124 (while (and choices ; adjust choices window.
@@ -1587,7 +1579,7 @@ With NO-ERROR, just return non-nil if there was no Ispell running."
1587 nil)) 1579 nil))
1588 1580
1589 1581
1590;;; ispell-change-dictionary is set in some people's hooks. Maybe it should 1582;;; ispell-change-dictionary is set in some people's hooks. Maybe this should
1591;;; call ispell-init-process rather than wait for a spell checking command? 1583;;; call ispell-init-process rather than wait for a spell checking command?
1592 1584
1593;;;###autoload 1585;;;###autoload
@@ -2038,7 +2030,7 @@ warns you if the previous word is incorrectly spelled."
2038 (mapconcat (function identity) 2030 (mapconcat (function identity)
2039 '( 2031 '(
2040 ;; Matches postscript files. 2032 ;; Matches postscript files.
2041 "^%!PS-Adobe-[23].0" 2033 "^%!PS-Adobe-[123].0"
2042 ;; Matches uuencoded text 2034 ;; Matches uuencoded text
2043 "^begin [0-9][0-9][0-9] .*\nM.*\nM.*\nM" 2035 "^begin [0-9][0-9][0-9] .*\nM.*\nM.*\nM"
2044 ;; Matches shell files (esp. auto-decoding) 2036 ;; Matches shell files (esp. auto-decoding)
@@ -2054,6 +2046,32 @@ If it is a string, limit at first occurrence of that regular expression.
2054Otherwise, it must be a function which is called to get the limit.") 2046Otherwise, it must be a function which is called to get the limit.")
2055 2047
2056 2048
2049(defvar ispell-message-start-skip
2050 (mapconcat (function identity)
2051 '(
2052 ;; Matches forwarded messages
2053 "^---* Forwarded Message"
2054 ;; Matches PGP Public Key block
2055 "^---*BEGIN PGP [A-Z ]*--*"
2056 )
2057 "\\|")
2058 "Spelling is skipped inside these start/end groups by ispell-message.
2059Assumed that blocks are not mutually inclusive.")
2060
2061
2062(defvar ispell-message-end-skip
2063 (mapconcat (function identity)
2064 '(
2065 ;; Matches forwarded messages
2066 "^--- End of Forwarded Message"
2067 ;; Matches PGP Public Key block
2068 "^---*END PGP [A-Z ]*--*"
2069 )
2070 "\\|")
2071 "Spelling is skipped inside these start/end groups by ispell-message.
2072Assumed that blocks are not mutually inclusive.")
2073
2074
2057;;;###autoload 2075;;;###autoload
2058(defun ispell-message () 2076(defun ispell-message ()
2059 "Check the spelling of a mail message or news post. 2077 "Check the spelling of a mail message or news post.
@@ -2155,10 +2173,12 @@ You can bind this to the key C-c i in GNUS or mail by adding to
2155 ;; Check the next batch of lines that *aren't* cited. 2173 ;; Check the next batch of lines that *aren't* cited.
2156 (end-c (and (re-search-forward cite-regexp-end limit 'end) 2174 (end-c (and (re-search-forward cite-regexp-end limit 'end)
2157 (match-beginning 0))) 2175 (match-beginning 0)))
2158 ;; skip a forwarded message 2176 ;; Skip a block of included text.
2159 (end-fwd (and (goto-char start) 2177 (end-fwd (and (goto-char start)
2160 (re-search-forward "---* Forwarded Message" 2178 (re-search-forward ispell-message-start-skip
2161 limit 'end))) 2179 limit 'end)
2180 (progn (beginning-of-line)
2181 (point))))
2162 (end (or (and end-c end-fwd (min end-c end-fwd)) 2182 (end (or (and end-c end-fwd (min end-c end-fwd))
2163 end-c end-fwd 2183 end-c end-fwd
2164 ;; defalut to limit of text. 2184 ;; defalut to limit of text.
@@ -2168,7 +2188,7 @@ You can bind this to the key C-c i in GNUS or mail by adding to
2168 (if (and end-fwd (= end end-fwd)) 2188 (if (and end-fwd (= end end-fwd))
2169 (progn 2189 (progn
2170 (goto-char end) 2190 (goto-char end)
2171 (search-forward "--- End of Forwarded Message" limit 'end)) 2191 (re-search-forward ispell-message-end-skip limit 'end))
2172 (goto-char end))))) 2192 (goto-char end)))))
2173 (set-marker limit nil)))) 2193 (set-marker limit nil))))
2174 2194
@@ -2203,8 +2223,8 @@ Includes latex/nroff modes and extended character mode."
2203 (eq ispell-parser 'tex)) 2223 (eq ispell-parser 'tex))
2204 (process-send-string ispell-process "+\n") ; set ispell mode to tex 2224 (process-send-string ispell-process "+\n") ; set ispell mode to tex
2205 (process-send-string ispell-process "-\n")) ; set mode to normal (nroff) 2225 (process-send-string ispell-process "-\n")) ; set mode to normal (nroff)
2206 ;; Hard-wire test for SGML mode. 2226 ;; Hard-wire test for SGML & HTML mode.
2207 (setq ispell-skip-sgml (eq 'sgml-mode major-mode)) 2227 (setq ispell-skip-sgml (memq major-mode '(sgml-mode html-mode)))
2208 ;; Set default extended character mode for given buffer, if any. 2228 ;; Set default extended character mode for given buffer, if any.
2209 (let ((extended-char-mode (ispell-get-extended-character-mode))) 2229 (let ((extended-char-mode (ispell-get-extended-character-mode)))
2210 (if extended-char-mode 2230 (if extended-char-mode
@@ -2328,7 +2348,7 @@ Both should not be used to define a buffer-local dictionary."
2328 reg-end) 2348 reg-end)
2329 2349
2330 2350
2331(defconst ispell-version "2.36 -- Mon Feb 6 17:39:38 EST 1995") 2351(defconst ispell-version "2.37 -- Tue Jun 13 12:05:28 EDT 1995")
2332 2352
2333(provide 'ispell) 2353(provide 'ispell)
2334 2354