Mercurial > hg > xemacs-beta
comparison lisp/packages/ispell.el @ 2:ac2d302a0011 r19-15b2
Import from CVS: tag r19-15b2
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:46:35 +0200 |
parents | 376386a54a3c |
children | bcdc7deadc19 |
comparison
equal
deleted
inserted
replaced
1:c0c6a60d29db | 2:ac2d302a0011 |
---|---|
1 ;;;;;;;;;;;;;;;;;;;;;;;;;;; -*- Mode: emacs-lisp -*- ;;;;;;;;;;;;;;;;;;;;;;;;;; | 1 ;;; ispell.el --- spell checking using Ispell |
2 ;;; GNU EMACS interface for International Ispell Version 3.1 by Geoff Kuenning. | 2 |
3 ;;; | 3 ;; Copyright (C) 1994, 1995 Free Software Foundation, Inc. |
4 ;;; | 4 |
5 ;;; Copyright (C) 1994, 1995 Free Software Foundation, Inc. | 5 ;; Authors : Ken Stevens <k.stevens@ieee.org> |
6 ;;; | 6 ;; Last Modified On: Tue Jun 13 12:05:28 EDT 1995 |
7 ;;; | 7 ;; Update Revision : 2.37 |
8 ;;; Authors : Ken Stevens <k.stevens@ieee.org> | 8 ;; Syntax : emacs-lisp |
9 ;;; Last Modified On: Tue Jun 13 12:05:28 EDT 1995 | 9 ;; Status : Release with 3.1.12+ ispell. |
10 ;;; Update Revision : 2.37 | 10 ;; Version : International Ispell Version 3.1 by Geoff Kuenning. |
11 ;;; Syntax : emacs-lisp | 11 ;; Bug Reports : ispell-el-bugs@itcorp.com |
12 ;;; Status : Release with 3.1.12+ ispell. | 12 |
13 ;;; Version : International Ispell Version 3.1 by Geoff Kuenning. | 13 ;; Note: version numbers and time stamp are not updated |
14 ;;; Bug Reports : ispell-el-bugs@itcorp.com | 14 ;; when this file is edited for release with GNU emacs. |
15 ;;; | 15 |
16 ;;; Note: version numbers and time stamp are not updated | 16 ;; This file is part of XEmacs. |
17 ;;; when this file is edited for release with GNU emacs. | 17 |
18 ;;; | 18 ;; XEmacs is free software; you can redistribute it and/or modify it |
19 ;;; This file is part of GNU Emacs. | 19 ;; under the terms of the GNU General Public License as published by |
20 ;;; | 20 ;; the Free Software Foundation; either version 2, or (at your option) |
21 ;;; GNU Emacs is free software; you can redistribute it and/or modify | 21 ;; any later version. |
22 ;;; it under the terms of the GNU General Public License as published by | 22 |
23 ;;; the Free Software Foundation; either version 2, or (at your option) | 23 ;; XEmacs is distributed in the hope that it will be useful, but |
24 ;;; any later version. | 24 ;; WITHOUT ANY WARRANTY; without even the implied warranty of |
25 ;;; | 25 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
26 ;;; GNU Emacs is distributed in the hope that it will be useful, | 26 ;; General Public License for more details. |
27 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of | 27 |
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 28 ;; You should have received a copy of the GNU General Public License |
29 ;;; GNU General Public License for more details. | 29 ;; along with XEmacs; see the file COPYING. If not, write to the Free |
30 ;;; | 30 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
31 ;;; You should have received a copy of the GNU General Public License | 31 ;; 02111-1307, USA. |
32 ;;; along with GNU Emacs; see the file COPYING. If not, write to | 32 |
33 ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
34 ;;; | |
35 ;;; Commentary: | 33 ;;; Commentary: |
36 ;;; | 34 |
37 ;;; INSTRUCTIONS | 35 ;; INSTRUCTIONS |
38 ;;; | 36 ;; |
39 ;;; This code contains a section of user-settable variables that you should | 37 ;; This code contains a section of user-settable variables that you should |
40 ;;; inspect prior to installation. Look past the end of the history list. | 38 ;; inspect prior to installation. Look past the end of the history list. |
41 ;;; Set them up for your locale and the preferences of the majority of the | 39 ;; Set them up for your locale and the preferences of the majority of the |
42 ;;; users. Otherwise the users may need to set a number of variables | 40 ;; users. Otherwise the users may need to set a number of variables |
43 ;;; themselves. | 41 ;; themselves. |
44 ;;; You particularly may want to change the default dictionary for your | 42 ;; You particularly may want to change the default dictionary for your |
45 ;;; country and language. | 43 ;; country and language. |
46 ;;; | 44 ;; |
47 ;;; | 45 ;; |
48 ;;; To fully install this, add this file to your Emacs Lisp directory and | 46 ;; To fully install this, add this file to your Emacs Lisp directory and |
49 ;;; compile it with M-X byte-compile-file. Then add the following to the | 47 ;; compile it with M-X byte-compile-file. Then add the following to the |
50 ;;; appropriate init file: | 48 ;; appropriate init file: |
51 ;;; | 49 ;; |
52 ;;; (autoload 'ispell-word "ispell" | 50 ;; (autoload 'ispell-word "ispell" |
53 ;;; "Check the spelling of word in buffer." t) | 51 ;; "Check the spelling of word in buffer." t) |
54 ;;; (global-set-key "\e$" 'ispell-word) | 52 ;; (global-set-key "\e$" 'ispell-word) |
55 ;;; (autoload 'ispell-region "ispell" | 53 ;; (autoload 'ispell-region "ispell" |
56 ;;; "Check the spelling of region." t) | 54 ;; "Check the spelling of region." t) |
57 ;;; (autoload 'ispell-buffer "ispell" | 55 ;; (autoload 'ispell-buffer "ispell" |
58 ;;; "Check the spelling of buffer." t) | 56 ;; "Check the spelling of buffer." t) |
59 ;;; (autoload 'ispell-complete-word "ispell" | 57 ;; (autoload 'ispell-complete-word "ispell" |
60 ;;; "Look up current word in dictionary and try to complete it." t) | 58 ;; "Look up current word in dictionary and try to complete it." t) |
61 ;;; (autoload 'ispell-change-dictionary "ispell" | 59 ;; (autoload 'ispell-change-dictionary "ispell" |
62 ;;; "Change ispell dictionary." t) | 60 ;; "Change ispell dictionary." t) |
63 ;;; (autoload 'ispell-message "ispell" | 61 ;; (autoload 'ispell-message "ispell" |
64 ;;; "Check spelling of mail message or news post.") | 62 ;; "Check spelling of mail message or news post.") |
65 ;;; | 63 ;; |
66 ;;; Depending on the mail system you use, you may want to include these: | 64 ;; Depending on the mail system you use, you may want to include these: |
67 ;;; | 65 ;; |
68 ;;; (add-hook 'news-inews-hook 'ispell-message) | 66 ;; (add-hook 'news-inews-hook 'ispell-message) |
69 ;;; (add-hook 'mail-send-hook 'ispell-message) | 67 ;; (add-hook 'mail-send-hook 'ispell-message) |
70 ;;; (add-hook 'mh-before-send-letter-hook 'ispell-message) | 68 ;; (add-hook 'mh-before-send-letter-hook 'ispell-message) |
71 ;;; | 69 ;; |
72 ;;; | 70 ;; |
73 ;;; Ispell has a TeX parser and a nroff parser (the default). | 71 ;; Ispell has a TeX parser and a nroff parser (the default). |
74 ;;; The parsing is controlled by the variable ispell-parser. Currently | 72 ;; The parsing is controlled by the variable ispell-parser. Currently |
75 ;;; it is just a "toggle" between TeX and nroff, but if more parsers are | 73 ;; it is just a "toggle" between TeX and nroff, but if more parsers are |
76 ;;; added it will be updated. See the variable description for more info. | 74 ;; added it will be updated. See the variable description for more info. |
77 ;;; | 75 ;; |
78 ;;; | 76 ;; |
79 ;;; TABLE OF CONTENTS | 77 ;; TABLE OF CONTENTS |
80 ;;; | 78 ;; |
81 ;;; ispell-word | 79 ;; ispell-word |
82 ;;; ispell-region | 80 ;; ispell-region |
83 ;;; ispell-buffer | 81 ;; ispell-buffer |
84 ;;; ispell-message | 82 ;; ispell-message |
85 ;;; ispell-continue | 83 ;; ispell-continue |
86 ;;; ispell-complete-word | 84 ;; ispell-complete-word |
87 ;;; ispell-complete-word-interior-frag | 85 ;; ispell-complete-word-interior-frag |
88 ;;; ispell-change-dictionary | 86 ;; ispell-change-dictionary |
89 ;;; ispell-kill-ispell | 87 ;; ispell-kill-ispell |
90 ;;; ispell-pdict-save | 88 ;; ispell-pdict-save |
91 ;;; | 89 ;; |
92 ;;; | 90 ;; |
93 ;;; Commands in ispell-region: | 91 ;; Commands in ispell-region: |
94 ;;; Character replacement: Replace word with choice. May query-replace. | 92 ;; Character replacement: Replace word with choice. May query-replace. |
95 ;;; ' ': Accept word this time. | 93 ;; ' ': Accept word this time. |
96 ;;; 'i': Accept word and insert into private dictionary. | 94 ;; 'i': Accept word and insert into private dictionary. |
97 ;;; 'a': Accept word for this session. | 95 ;; 'a': Accept word for this session. |
98 ;;; 'A': Accept word and place in buffer-local dictionary. | 96 ;; 'A': Accept word and place in buffer-local dictionary. |
99 ;;; 'r': Replace word with typed-in value. Rechecked. | 97 ;; 'r': Replace word with typed-in value. Rechecked. |
100 ;;; 'R': Replace word with typed-in value. Query-replaced in buffer. Rechecked. | 98 ;; 'R': Replace word with typed-in value. Query-replaced in buffer. Rechecked. |
101 ;;; '?': Show these commands | 99 ;; '?': Show these commands |
102 ;;; 'x': Exit spelling buffer. Move cursor to original point. | 100 ;; 'x': Exit spelling buffer. Move cursor to original point. |
103 ;;; 'X': Exit spelling buffer. Leave cursor at the current point. | 101 ;; 'X': Exit spelling buffer. Leave cursor at the current point. |
104 ;;; 'q': Quit spelling session (Kills ispell process). | 102 ;; 'q': Quit spelling session (Kills ispell process). |
105 ;;; 'l': Look up typed-in replacement in alternate dictionary. Wildcards okay. | 103 ;; 'l': Look up typed-in replacement in alternate dictionary. Wildcards okay. |
106 ;;; 'u': Like 'i', but the word is lower-cased first. | 104 ;; 'u': Like 'i', but the word is lower-cased first. |
107 ;;; 'm': Like 'i', but allows one to include dictionary completion info. | 105 ;; 'm': Like 'i', but allows one to include dictionary completion info. |
108 ;;; 'C-l': redraws screen | 106 ;; 'C-l': redraws screen |
109 ;;; 'C-r': recursive edit | 107 ;; 'C-r': recursive edit |
110 ;;; 'C-z': suspend emacs or iconify frame | 108 ;; 'C-z': suspend emacs or iconify frame |
111 ;;; | 109 ;; |
112 ;;; Buffer-Local features: | 110 ;; Buffer-Local features: |
113 ;;; There are a number of buffer-local features that can be used to customize | 111 ;; There are a number of buffer-local features that can be used to customize |
114 ;;; ispell for the current buffer. This includes language dictionaries, | 112 ;; ispell for the current buffer. This includes language dictionaries, |
115 ;;; personal dictionaries, parsing, and local word spellings. Each of these | 113 ;; personal dictionaries, parsing, and local word spellings. Each of these |
116 ;;; local customizations are done either through local variables, or by | 114 ;; local customizations are done either through local variables, or by |
117 ;;; including the keyword and argument(s) at the end of the buffer (usually | 115 ;; including the keyword and argument(s) at the end of the buffer (usually |
118 ;;; prefixed by the comment characters). See the end of this file for | 116 ;; prefixed by the comment characters). See the end of this file for |
119 ;;; examples. The local keywords and variables are: | 117 ;; examples. The local keywords and variables are: |
120 ;;; | 118 ;; |
121 ;;; ispell-dictionary-keyword language-dictionary | 119 ;; ispell-dictionary-keyword language-dictionary |
122 ;;; uses local variable ispell-local-dictionary | 120 ;; uses local variable ispell-local-dictionary |
123 ;;; ispell-pdict-keyword personal-dictionary | 121 ;; ispell-pdict-keyword personal-dictionary |
124 ;;; uses local variable ispell-local-pdict | 122 ;; uses local variable ispell-local-pdict |
125 ;;; ispell-parsing-keyword mode-arg extended-char-arg | 123 ;; ispell-parsing-keyword mode-arg extended-char-arg |
126 ;;; ispell-words-keyword any number of local word spellings | 124 ;; ispell-words-keyword any number of local word spellings |
127 ;;; | 125 ;; |
128 ;;; | 126 ;; |
129 ;;; BUGS: | 127 ;; BUGS: |
130 ;;; Highlighting in version 19 still doesn't work on tty's. | 128 ;; Highlighting in version 19 still doesn't work on tty's. |
131 ;;; On some versions of emacs, growing the minibuffer fails. | 129 ;; On some versions of emacs, growing the minibuffer fails. |
132 ;;; | 130 ;; |
133 ;;; HISTORY | 131 ;; HISTORY |
134 ;;; | 132 ;; |
135 ;;; Revision 2.37 1995/6/13 12:05:28 stevens | 133 ;; Revision 2.38 1996/5/30 ethanb@phys.washington.edu |
136 ;;; Removed autoload from ispell-dictionary-alist. *choices* mode-line shows | 134 ;; Update ispell-message for gnus 5 (news-inews-hook => message-send-hook; |
137 ;;; misspelled word. Block skip for pgp & forwarded messages added. | 135 ;; different header for quoted message). |
138 ;;; | 136 ;; |
139 ;;; Revision 2.36 1995/2/6 17:39:38 stevens | 137 ;; Revision 2.37 1995/6/13 12:05:28 stevens |
140 ;;; Properly adjust screen with different ispell-choices-win-default-height | 138 ;; Removed autoload from ispell-dictionary-alist. *choices* mode-line shows |
141 ;;; settings. Skips SGML entity references. | 139 ;; misspelled word. Block skip for pgp & forwarded messages added. |
142 ;;; | 140 ;; RMS: the autoload changes had problems and I removed them. |
143 ;;; Revision 2.35 1995/1/13 14:16:46 stevens | 141 ;; |
144 ;;; Skips SGML tags, ispell-change-dictionary fix for add-hook, assure personal | 142 ;; Revision 2.36 1995/2/6 17:39:38 stevens |
145 ;;; dictionary is saved when called from the menu | 143 ;; Properly adjust screen with different ispell-choices-win-default-height |
146 ;;; | 144 ;; settings. Skips SGML entity references. |
147 ;;; Revision 2.34 1994/12/08 13:17:41 stevens | 145 ;; |
148 ;;; Interaction corrected to function with all 3.1 ispell versions. | 146 ;; Revision 2.35 1995/1/13 14:16:46 stevens |
149 ;;; | 147 ;; Skips SGML tags, ispell-change-dictionary fix for add-hook, assure personal |
150 ;;; Revision 2.33 1994/11/24 02:31:20 stevens | 148 ;; dictionary is saved when called from the menu |
151 ;;; Repaired bug introduced in 2.32 that corrupts buffers when correcting. | 149 ;; |
152 ;;; Improved buffer scrolling. Nondestructive buffer selections allowed. | 150 ;; Revision 2.34 1994/12/08 13:17:41 stevens |
153 ;;; | 151 ;; Interaction corrected to function with all 3.1 ispell versions. |
154 ;;; Revision 2.32 1994/10/31 21:10:08 geoff | 152 ;; |
155 ;;; Many revisions accepted from RMS/FSF. I think (though I don't know) that | 153 ;; Revision 2.33 1994/11/24 02:31:20 stevens |
156 ;;; this represents an 'official' version. | 154 ;; Repaired bug introduced in 2.32 that corrupts buffers when correcting. |
157 ;;; | 155 ;; Improved buffer scrolling. Nondestructive buffer selections allowed. |
158 ;;; Revision 2.31 1994/5/31 10:18:17 stevens | 156 ;; |
159 ;;; Repaired comments. buffer-local commands executed in `ispell-word' now. | 157 ;; Revision 2.32 1994/10/31 21:10:08 geoff |
160 ;;; German dictionary described for extended character mode. Dict messages. | 158 ;; Many revisions accepted from RMS/FSF. I think (though I don't know) that |
161 ;;; | 159 ;; this represents an 'official' version. |
162 ;;; Revision 2.30 1994/5/20 22:18:36 stevens | 160 ;; |
163 ;;; Continue ispell from ispell-word, C-z functionality fixed. | 161 ;; Revision 2.31 1994/5/31 10:18:17 stevens |
164 ;;; | 162 ;; Repaired comments. buffer-local commands executed in `ispell-word' now. |
165 ;;; Revision 2.29 1994/5/12 09:44:33 stevens | 163 ;; German dictionary described for extended character mode. Dict messages. |
166 ;;; Restored ispell-use-ptys-p, ispell-message aborts sends with interrupt. | 164 ;; |
167 ;;; defined fn ispell | 165 ;; Revision 2.30 1994/5/20 22:18:36 stevens |
168 ;;; | 166 ;; Continue ispell from ispell-word, C-z functionality fixed. |
169 ;;; Revision 2.28 1994/4/28 16:24:40 stevens | 167 ;; |
170 ;;; Window checking when ispell-message put on gnus-inews-article-hook jwz. | 168 ;; Revision 2.29 1994/5/12 09:44:33 stevens |
171 ;;; prefixed ispell- to highlight functions and horiz-scroll fn. | 169 ;; Restored ispell-use-ptys-p, ispell-message aborts sends with interrupt. |
172 ;;; Try and respect case of word in ispell-complete-word. | 170 ;; defined fn ispell |
173 ;;; Ignore non-char events. Ispell-use-ptys-p commented out. Lucid menu. | 171 ;; |
174 ;;; Better interrupt handling. ispell-message improvements from Ethan. | 172 ;; Revision 2.28 1994/4/28 16:24:40 stevens |
175 ;;; | 173 ;; Window checking when ispell-message put on gnus-inews-article-hook jwz. |
176 ;;; Revision 2.27 | 174 ;; prefixed ispell- to highlight functions and horiz-scroll fn. |
177 ;;; version 18 explicit C-g handling disabled as it didn't work. Added | 175 ;; Try and respect case of word in ispell-complete-word. |
178 ;;; ispell-extra-args for ispell customization (jwz) | 176 ;; Ignore non-char events. Ispell-use-ptys-p commented out. Lucid menu. |
179 ;;; | 177 ;; Better interrupt handling. ispell-message improvements from Ethan. |
180 ;;; Revision 2.26 1994/2/15 16:11:14 stevens | 178 ;; |
181 ;;; name changes for copyright assignment. Added word-frags in complete-word. | 179 ;; Revision 2.27 |
182 ;;; Horizontal scroll (John Conover). Query-replace matches words now. bugs. | 180 ;; version 18 explicit C-g handling disabled as it didn't work. Added |
183 ;;; | 181 ;; ispell-extra-args for ispell customization (jwz) |
184 ;;; Revision 2.25 | 182 ;; |
185 ;;; minor mods, upgraded ispell-message | 183 ;; Revision 2.26 1994/2/15 16:11:14 stevens |
186 ;;; | 184 ;; name changes for copyright assignment. Added word-frags in complete-word. |
187 ;;; Revision 2.24 | 185 ;; Horizontal scroll (John Conover). Query-replace matches words now. bugs. |
188 ;;; query-replace more robust, messages, defaults, ispell-change-dict. | 186 ;; |
189 ;;; | 187 ;; Revision 2.25 |
190 ;;; Revision 2.23 1993/11/22 23:47:03 stevens | 188 ;; minor mods, upgraded ispell-message |
191 ;;; ispell-message, Fixed highlighting, added menu-bar, fixed ispell-help, ... | 189 ;; |
192 ;;; | 190 ;; Revision 2.24 |
193 ;;; Revision 2.22 | 191 ;; query-replace more robust, messages, defaults, ispell-change-dict. |
194 ;;; Added 'u' command. Fixed default in ispell-local-dictionary. | 192 ;; |
195 ;;; fixed affix rules display. Tib skipping more robust. Contributions by | 193 ;; Revision 2.23 1993/11/22 23:47:03 stevens |
196 ;;; Per Abraham (parser selection), Denis Howe, and Eberhard Mattes. | 194 ;; ispell-message, Fixed highlighting, added menu-bar, fixed ispell-help, ... |
197 ;;; | 195 ;; |
198 ;;; Revision 2.21 1993/06/30 14:09:04 stevens | 196 ;; Revision 2.22 |
199 ;;; minor bugs. (nroff word skipping fixed) | 197 ;; Added 'u' command. Fixed default in ispell-local-dictionary. |
200 ;;; | 198 ;; fixed affix rules display. Tib skipping more robust. Contributions by |
201 ;;; Revision 2.20 1993/06/30 14:09:04 stevens | 199 ;; Per Abraham (parser selection), Denis Howe, and Eberhard Mattes. |
202 ;;; | 200 ;; |
203 ;;; Debugging and contributions by: Boris Aronov, Rik Faith, Chris Moore, | 201 ;; Revision 2.21 1993/06/30 14:09:04 stevens |
204 ;;; Kevin Rodgers, Malcolm Davis. | 202 ;; minor bugs. (nroff word skipping fixed) |
205 ;;; Particular thanks to Michael Lipp, Jamie Zawinski, Phil Queinnec | 203 ;; |
206 ;;; and John Heidemann for suggestions and code. | 204 ;; Revision 2.20 1993/06/30 14:09:04 stevens |
207 ;;; Major update including many tweaks. | 205 ;; |
208 ;;; Many changes were integrations of suggestions. | 206 ;; Debugging and contributions by: Boris Aronov, Rik Faith, Chris Moore, |
209 ;;; lookup-words rehacked to use call-process (Jamie). | 207 ;; Kevin Rodgers, Malcolm Davis. |
210 ;;; ispell-complete-word rehacked to be compatible with the rest of the | 208 ;; Particular thanks to Michael Lipp, Jamie Zawinski, Phil Queinnec |
211 ;;; system for word searching and to include multiple wildcards, | 209 ;; and John Heidemann for suggestions and code. |
212 ;;; and it's own dictionary. | 210 ;; Major update including many tweaks. |
213 ;;; query-replace capability added. New options 'X', 'R', and 'A'. | 211 ;; Many changes were integrations of suggestions. |
214 ;;; buffer-local modes for dictionary, word-spelling, and formatter-parsing. | 212 ;; lookup-words rehacked to use call-process (Jamie). |
215 ;;; Many random bugs, like commented comments being skipped, fix to | 213 ;; ispell-complete-word rehacked to be compatible with the rest of the |
216 ;;; keep-choices-win, fix for math mode, added pipe mode choice, | 214 ;; system for word searching and to include multiple wildcards, |
217 ;;; fixed 'q' command, ispell-word checks previous word and leave cursor | 215 ;; and it's own dictionary. |
218 ;;; in same location. Fixed tib code which could drop spelling regions. | 216 ;; query-replace capability added. New options 'X', 'R', and 'A'. |
219 ;;; Cleaned up setq calls for efficiency. Gave more context on window overlays. | 217 ;; buffer-local modes for dictionary, word-spelling, and formatter-parsing. |
220 ;;; Assure context on ispell-command-loop. Window lossage in look cmd fixed. | 218 ;; Many random bugs, like commented comments being skipped, fix to |
221 ;;; Due to pervasive opinion, common-lisp package syntax removed. Display | 219 ;; keep-choices-win, fix for math mode, added pipe mode choice, |
222 ;;; problem when not highlighting. | 220 ;; fixed 'q' command, ispell-word checks previous word and leave cursor |
223 ;;; | 221 ;; in same location. Fixed tib code which could drop spelling regions. |
224 ;;; Revision 2.19 1992/01/10 10:54:08 geoff | 222 ;; Cleaned up setq calls for efficiency. Gave more context on window overlays. |
225 ;;; Make another attempt at fixing the "Bogus, dude" problem. This one is | 223 ;; Assure context on ispell-command-loop. Window lossage in look cmd fixed. |
226 ;;; less elegant, but has the advantage of working. | 224 ;; Due to pervasive opinion, common-lisp package syntax removed. Display |
227 ;;; | 225 ;; problem when not highlighting. |
228 ;;; Revision 2.18 1992/01/07 10:04:52 geoff | 226 ;; |
229 ;;; Fix the "Bogus, Dude" problem in ispell-word. | 227 ;; Revision 2.19 1992/01/10 10:54:08 geoff |
230 ;;; | 228 ;; Make another attempt at fixing the "Bogus, dude" problem. This one is |
231 ;;; Revision 2.17 1991/09/12 00:01:42 geoff | 229 ;; less elegant, but has the advantage of working. |
232 ;;; Add some changes to make ispell-complete-word work better, though | 230 ;; |
233 ;;; still not perfectly. | 231 ;; Revision 2.18 1992/01/07 10:04:52 geoff |
234 ;;; | 232 ;; Fix the "Bogus, Dude" problem in ispell-word. |
235 ;;; Revision 2.16 91/09/04 18:00:52 geoff | 233 ;; |
236 ;;; More updates from Sebastian, to make the multiple-dictionary support | 234 ;; Revision 2.17 1991/09/12 00:01:42 geoff |
237 ;;; more flexible. | 235 ;; Add some changes to make ispell-complete-word work better, though |
238 ;;; | 236 ;; still not perfectly. |
239 ;;; Revision 2.15 91/09/04 17:30:02 geoff | 237 ;; |
240 ;;; Sebastian Kremer's tib support | 238 ;; Revision 2.16 91/09/04 18:00:52 geoff |
241 ;;; | 239 ;; More updates from Sebastian, to make the multiple-dictionary support |
242 ;;; Revision 2.14 91/09/04 16:19:37 geoff | 240 ;; more flexible. |
243 ;;; Don't do set-window-start if the move-to-window-line moved us | 241 ;; |
244 ;;; downward, rather than upward. This prevents getting the buffer all | 242 ;; Revision 2.15 91/09/04 17:30:02 geoff |
245 ;;; confused. Also, don't use the "not-modified" function to clear the | 243 ;; Sebastian Kremer's tib support |
246 ;;; modification flag; instead use set-buffer-modified-p. This prevents | 244 ;; |
247 ;;; extra messages from flashing. | 245 ;; Revision 2.14 91/09/04 16:19:37 geoff |
248 ;;; | 246 ;; Don't do set-window-start if the move-to-window-line moved us |
249 ;;; Revision 2.13 91/09/04 14:35:41 geoff | 247 ;; downward, rather than upward. This prevents getting the buffer all |
250 ;;; Fix a spelling error in a comment. Add code to handshake with the | 248 ;; confused. Also, don't use the "not-modified" function to clear the |
251 ;;; ispell process before sending anything to it. | 249 ;; modification flag; instead use set-buffer-modified-p. This prevents |
252 ;;; | 250 ;; extra messages from flashing. |
253 ;;; Revision 2.12 91/09/03 20:14:21 geoff | 251 ;; |
254 ;;; Add Sebastian Kremer's multiple-language support. | 252 ;; Revision 2.13 91/09/04 14:35:41 geoff |
255 ;;; | 253 ;; Fix a spelling error in a comment. Add code to handshake with the |
256 ;;; | 254 ;; ispell process before sending anything to it. |
257 ;;; Walt Buehring | 255 ;; |
258 ;;; Texas Instruments - Computer Science Center | 256 ;; Revision 2.12 91/09/03 20:14:21 geoff |
259 ;;; ARPA: Buehring%TI-CSL@CSNet-Relay | 257 ;; Add Sebastian Kremer's multiple-language support. |
260 ;;; UUCP: {smu, texsun, im4u, rice} ! ti-csl ! buehring | 258 ;; |
261 ;;; | 259 ;; |
262 ;;; ispell-region and associated routines added by | 260 ;; Walt Buehring |
263 ;;; Perry Smith | 261 ;; Texas Instruments - Computer Science Center |
264 ;;; pedz@bobkat | 262 ;; ARPA: Buehring%TI-CSL@CSNet-Relay |
265 ;;; Tue Jan 13 20:18:02 CST 1987 | 263 ;; UUCP: {smu, texsun, im4u, rice} ! ti-csl ! buehring |
266 ;;; | 264 ;; |
267 ;;; extensively modified by Mark Davies and Andrew Vignaux | 265 ;; ispell-region and associated routines added by |
268 ;;; {mark,andrew}@vuwcomp | 266 ;; Perry Smith |
269 ;;; Sun May 10 11:45:04 NZST 1987 | 267 ;; pedz@bobkat |
270 ;;; | 268 ;; Tue Jan 13 20:18:02 CST 1987 |
271 ;;; Ken Stevens ARPA: k.stevens@ieee.org | 269 ;; |
272 ;;; Tue Jan 3 16:59:07 PST 1989 | 270 ;; extensively modified by Mark Davies and Andrew Vignaux |
273 ;;; This file has overgone a major overhaul to be compatible with ispell | 271 ;; {mark,andrew}@vuwcomp |
274 ;;; version 2.1. Most of the functions have been totally rewritten, and | 272 ;; Sun May 10 11:45:04 NZST 1987 |
275 ;;; many user-accessible variables have been added. The syntax table has | 273 ;; |
276 ;;; been removed since it didn't work properly anyway, and a filter is | 274 ;; Ken Stevens ARPA: k.stevens@ieee.org |
277 ;;; used rather than a buffer. Regular expressions are used based on | 275 ;; Tue Jan 3 16:59:07 PST 1989 |
278 ;;; ispell's internal definition of characters (see ispell(4)). | 276 ;; This file has overgone a major overhaul to be compatible with ispell |
279 ;;; Some new updates: | 277 ;; version 2.1. Most of the functions have been totally rewritten, and |
280 ;;; - Updated to version 3.0 to include terse processing. | 278 ;; many user-accessible variables have been added. The syntax table has |
281 ;;; - Added a variable for the look command. | 279 ;; been removed since it didn't work properly anyway, and a filter is |
282 ;;; - Fixed a bug in ispell-word when cursor is far away from the word | 280 ;; used rather than a buffer. Regular expressions are used based on |
283 ;;; that is to be checked. | 281 ;; ispell's internal definition of characters (see ispell(4)). |
284 ;;; - Ispell places the incorrect word or guess in the minibuffer now. | 282 ;; Some new updates: |
285 ;;; - fixed a bug with 'l' option when multiple windows are on the screen. | 283 ;; - Updated to version 3.0 to include terse processing. |
286 ;;; - lookup-words just didn't work with the process filter. Fixed. | 284 ;; - Added a variable for the look command. |
287 ;;; - Rewrote the process filter to make it cleaner and more robust | 285 ;; - Fixed a bug in ispell-word when cursor is far away from the word |
288 ;;; in the event of a continued line not being completed. | 286 ;; that is to be checked. |
289 ;;; - Made ispell-init-process more robust in handling errors. | 287 ;; - Ispell places the incorrect word or guess in the minibuffer now. |
290 ;;; - Fixed bug in continuation location after a region has been modified by | 288 ;; - fixed a bug with 'l' option when multiple windows are on the screen. |
291 ;;; correcting a misspelling. | 289 ;; - lookup-words just didn't work with the process filter. Fixed. |
292 ;;; Mon 17 Sept 1990 | 290 ;; - Rewrote the process filter to make it cleaner and more robust |
293 ;;; | 291 ;; in the event of a continued line not being completed. |
294 ;;; Sebastian Kremer <sk@thp.uni-koeln.de> | 292 ;; - Made ispell-init-process more robust in handling errors. |
295 ;;; Wed Aug 7 14:02:17 MET DST 1991 | 293 ;; - Fixed bug in continuation location after a region has been modified by |
296 ;;; - Ported ispell-complete-word from Ispell 2 to Ispell 3. | 294 ;; correcting a misspelling. |
297 ;;; - Added ispell-kill-ispell command. | 295 ;; Mon 17 Sept 1990 |
298 ;;; - Added ispell-dictionary and ispell-dictionary-alist variables to | 296 ;; |
299 ;;; support other than default language. See their docstrings and | 297 ;; Sebastian Kremer <sk@thp.uni-koeln.de> |
300 ;;; command ispell-change-dictionary. | 298 ;; Wed Aug 7 14:02:17 MET DST 1991 |
301 ;;; - (ispelled it :-) | 299 ;; - Ported ispell-complete-word from Ispell 2 to Ispell 3. |
302 ;;; - Added ispell-skip-tib variable to support the tib bibliography | 300 ;; - Added ispell-kill-ispell command. |
303 ;;; program. | 301 ;; - Added ispell-dictionary and ispell-dictionary-alist variables to |
304 ;;; | 302 ;; support other than default language. See their docstrings and |
305 ;;; | 303 ;; command ispell-change-dictionary. |
306 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 304 ;; - (ispelled it :-) |
307 | 305 ;; - Added ispell-skip-tib variable to support the tib bibliography |
308 | 306 ;; program. |
309 | 307 |
310 ;;; ********************************************************************** | 308 |
311 ;;; The following variables should be set according to personal preference | 309 ;; ********************************************************************** |
312 ;;; and location of binaries: | 310 ;; The following variables should be set according to personal preference |
313 ;;; ********************************************************************** | 311 ;; and location of binaries: |
314 | 312 ;; ********************************************************************** |
315 | 313 |
316 ;;; ******* THIS FILE IS WRITTEN FOR ISPELL VERSION 3.1 | 314 ;; ******* THIS FILE IS WRITTEN FOR ISPELL VERSION 3.1 |
315 | |
317 ;;; Code: | 316 ;;; Code: |
318 | 317 |
319 (defvar ispell-highlight-p t | 318 (defvar ispell-highlight-p t |
320 "*Highlight spelling errors when non-nil.") | 319 "*Highlight spelling errors when non-nil.") |
321 | 320 |
325 `region', and `underline'. | 324 `region', and `underline'. |
326 This variable can be set by the user to whatever face they desire. | 325 This variable can be set by the user to whatever face they desire. |
327 It's most convenient if the cursor color and highlight color are | 326 It's most convenient if the cursor color and highlight color are |
328 slightly different.") | 327 slightly different.") |
329 | 328 |
330 (defvar ispell-check-comments nil | 329 (defvar ispell-check-comments t |
331 "*Spelling of comments checked when non-nil.") | 330 "*If nil, don't check spelling of comments.") |
332 | 331 |
333 (defvar ispell-query-replace-choices nil | 332 (defvar ispell-query-replace-choices nil |
334 "*Corrections made throughout region when non-nil. | 333 "*Corrections made throughout region when non-nil. |
335 Uses `query-replace' (\\[query-replace]) for corrections.") | 334 Uses `query-replace' (\\[query-replace]) for corrections.") |
336 | 335 |
412 | 411 |
413 (defvar ispell-format-word (function upcase) | 412 (defvar ispell-format-word (function upcase) |
414 "*Formatting function for displaying word being spell checked. | 413 "*Formatting function for displaying word being spell checked. |
415 The function must take one string argument and return a string.") | 414 The function must take one string argument and return a string.") |
416 | 415 |
417 ;; XEmacs change - ispell-local-pdict depends on this | |
418 ;;;###autoload | 416 ;;;###autoload |
419 (defvar ispell-personal-dictionary nil | 417 (defvar ispell-personal-dictionary nil |
420 "*File name of your personal spelling dictionary, or nil. | 418 "*File name of your personal spelling dictionary, or nil. |
421 If nil, the default personal dictionary, \"~/.ispell_DICTNAME\" is used, | 419 If nil, the default personal dictionary, \"~/.ispell_DICTNAME\" is used, |
422 where DICTNAME is the name of your default dictionary.") | 420 where DICTNAME is the name of your default dictionary.") |
439 (defvar ispell-extra-args nil | 437 (defvar ispell-extra-args nil |
440 "*If non-nil, a list of extra switches to pass to the Ispell program. | 438 "*If non-nil, a list of extra switches to pass to the Ispell program. |
441 For example, '(\"-W\" \"3\") to cause it to accept all 1-3 character | 439 For example, '(\"-W\" \"3\") to cause it to accept all 1-3 character |
442 words as correct. See also `ispell-dictionary-alist', which may be used | 440 words as correct. See also `ispell-dictionary-alist', which may be used |
443 for language-specific arguments.") | 441 for language-specific arguments.") |
442 | |
443 ;;; The preparation of the menu bar menu must be autoloaded | |
444 ;;; because otherwise this file gets autoloaded every time Emacs starts | |
445 ;;; so that it can set up the menus and determine keyboard equivalents. | |
444 | 446 |
445 ;;;###autoload | 447 ;;;###autoload |
446 (defvar ispell-dictionary-alist-1 ; sk 9-Aug-1991 18:28 | 448 (defvar ispell-dictionary-alist-1 ; sk 9-Aug-1991 18:28 |
447 '((nil ; default (english.aff) | 449 '((nil ; default (english.aff) |
448 "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil) | 450 "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil) |
533 | 535 |
534 Note that the CASECHARS and OTHERCHARS slots of the alist should | 536 Note that the CASECHARS and OTHERCHARS slots of the alist should |
535 contain the same character set as casechars and otherchars in the | 537 contain the same character set as casechars and otherchars in the |
536 language.aff file \(e.g., english.aff\).") | 538 language.aff file \(e.g., english.aff\).") |
537 | 539 |
538 | |
539 ;;;###autoload | 540 ;;;###autoload |
540 (defvar ispell-menu-map nil "Key map for ispell menu") | 541 (defvar ispell-menu-map nil "Key map for ispell menu") |
541 | 542 |
542 ;;;###autoload | 543 ;;;###autoload |
543 (defvar ispell-menu-lucid nil "Spelling menu for Lucid Emacs.") | 544 (defvar ispell-menu-xemacs nil "Spelling menu for XEmacs.") |
544 | 545 |
545 ;;; Break out lucid menu and split into several calls to avoid having | 546 ;;; Break out XEmacs menu and split into several calls to avoid having |
546 ;;; long lines in loaddefs.el. Detect need off following constant. | 547 ;;; long lines in loaddefs.el. Detect need off following constant. |
547 | 548 |
548 ;;;###autoload | 549 ;;;###autoload |
549 (defconst ispell-menu-map-needed ; make sure this is not Lucid Emacs | 550 (defconst ispell-menu-map-needed ; make sure this is not XEmacs |
550 (and (not ispell-menu-map) | 551 (and (not ispell-menu-map) |
551 (string-lessp "19" emacs-version) | 552 (string-lessp "19" emacs-version) |
552 ;; make sure this isn't XEmacs | 553 ;; make sure this isn't XEmacs |
553 (not (string-match "XEmacs" emacs-version)))) | 554 (not (string-match "XEmacs" emacs-version)))) |
554 | 555 |
555 | 556 |
556 ;;; setup dictionary | 557 ;;; Set up dictionary |
557 ;;;###autoload | 558 ;;;###autoload |
558 (if ispell-menu-map-needed | 559 (if ispell-menu-map-needed |
559 (let ((dicts (reverse (cons (cons "default" nil) ispell-dictionary-alist))) | 560 (let ((dicts (reverse (cons (cons "default" nil) ispell-dictionary-alist))) |
560 name) | 561 name) |
561 (setq ispell-menu-map (make-sparse-keymap "Spell")) | 562 (setq ispell-menu-map (make-sparse-keymap "Spell")) |
635 (setq menu (append menu | 636 (setq menu (append menu |
636 (list | 637 (list |
637 (vector (concat "Select " (capitalize name)) | 638 (vector (concat "Select " (capitalize name)) |
638 (list 'ispell-change-dictionary name) | 639 (list 'ispell-change-dictionary name) |
639 t)))))) | 640 t)))))) |
640 (setq ispell-menu-lucid menu) | 641 (setq ispell-menu-xemacs menu) |
641 (if current-menubar | 642 (if current-menubar |
642 (progn | 643 (progn |
643 (delete-menu-item '("Edit" "Spell")) ; in case already defined | 644 (delete-menu-item '("Edit" "Spell")) ; in case already defined |
644 (add-menu '("Edit") "Spell" ispell-menu-lucid))))) | 645 (add-menu '("Edit") "Spell" ispell-menu-xemacs))))) |
645 | 646 |
646 | 647 |
647 ;;; ********************************************************************** | 648 ;;; ********************************************************************** |
648 ;;; The following are used by ispell, and should not be changed. | 649 ;;; The following are used by ispell, and should not be changed. |
649 ;;; ********************************************************************** | 650 ;;; ********************************************************************** |
1109 (setq ispell-quit t) | 1110 (setq ispell-quit t) |
1110 nil) | 1111 nil) |
1111 ;; Quit and preserve point. | 1112 ;; Quit and preserve point. |
1112 ((= char ?X) | 1113 ((= char ?X) |
1113 (ispell-pdict-save ispell-silently-savep) | 1114 (ispell-pdict-save ispell-silently-savep) |
1114 (message | 1115 (message "%s" |
1115 (substitute-command-keys | 1116 (substitute-command-keys |
1116 (concat "Spell-checking suspended;" | 1117 (concat "Spell-checking suspended;" |
1117 " use C-u \\[ispell-word] to resume"))) | 1118 " use C-u \\[ispell-word] to resume"))) |
1118 (setq ispell-quit (max (point-min) | 1119 (setq ispell-quit (max (point-min) |
1119 (- (point) (length word)))) | 1120 (- (point) (length word)))) |
1262 (goto-char (point-min))) | 1263 (goto-char (point-min))) |
1263 (t | 1264 (t |
1264 (if (string-lessp "19" emacs-version) | 1265 (if (string-lessp "19" emacs-version) |
1265 (message nil)) | 1266 (message nil)) |
1266 (enlarge-window 2) | 1267 (enlarge-window 2) |
1268 ;; Make sure we display the minibuffer | |
1269 ;; in this window, not some other. | |
1270 (set-minibuffer-window (selected-window)) | |
1267 (insert (concat help-1 "\n" help-2 "\n" help-3)))) | 1271 (insert (concat help-1 "\n" help-2 "\n" help-3)))) |
1268 (sit-for 5) | 1272 (sit-for 5) |
1269 (erase-buffer))))) | 1273 (erase-buffer))))) |
1270 | 1274 |
1271 | 1275 |
1329 ;;; "output" can contain multiple lines, part of a line, or both. | 1333 ;;; "output" can contain multiple lines, part of a line, or both. |
1330 ;;; "start" and "end" are used to keep bounds on lines when "output" contains | 1334 ;;; "start" and "end" are used to keep bounds on lines when "output" contains |
1331 ;;; multiple lines. | 1335 ;;; multiple lines. |
1332 ;;; "ispell-filter-continue" is true when we have received only part of a | 1336 ;;; "ispell-filter-continue" is true when we have received only part of a |
1333 ;;; line as output from a generating function ("output" did not end with \n) | 1337 ;;; line as output from a generating function ("output" did not end with \n) |
1334 ;;; NOTE THAT THIS FUNCTION WILL FAIL IF THE PROCESS OUTPUT DOESNT END WITH \n! | 1338 ;;; THIS FUNCTION WILL FAIL IF THE PROCESS OUTPUT DOESN'T END WITH \n! |
1335 ;;; This is the case when a process dies or fails. The default behavior | 1339 ;;; This is the case when a process dies or fails. The default behavior |
1336 ;;; in this case treats the next input received as fresh input. | 1340 ;;; in this case treats the next input received as fresh input. |
1337 | 1341 |
1338 (defun ispell-filter (process output) | 1342 (defun ispell-filter (process output) |
1339 "Output filter function for ispell, grep, and look." | 1343 "Output filter function for ispell, grep, and look." |
1707 (forward-char 1)) | 1711 (forward-char 1)) |
1708 ((or (and ispell-skip-tib ; SKIP TIB REFERENCES OR SGML MARKUP | 1712 ((or (and ispell-skip-tib ; SKIP TIB REFERENCES OR SGML MARKUP |
1709 (re-search-forward ispell-tib-ref-beginning end t) | 1713 (re-search-forward ispell-tib-ref-beginning end t) |
1710 (setq ref-type 'tib)) | 1714 (setq ref-type 'tib)) |
1711 (and ispell-skip-sgml | 1715 (and ispell-skip-sgml |
1712 (search-forward "[<&]" end t) | 1716 (re-search-forward "[<&]" end t) |
1713 (setq ref-type 'sgml))) | 1717 (setq ref-type 'sgml))) |
1714 (if (or (and (eq 'tib ref-type) ; tib tag is 2 chars. | 1718 (if (or (and (eq 'tib ref-type) ; tib tag is 2 chars. |
1715 (= (- (point) 2) start)) | 1719 (= (- (point) 2) start)) |
1716 (and (eq 'sgml ref-type) ; sgml skips 1 char. | 1720 (and (eq 'sgml ref-type) ; sgml skips 1 char. |
1717 (= (- (point) 1) start))) | 1721 (= (- (point) 1) start))) |
1721 (and | 1725 (and |
1722 (eq 'tib ref-type) | 1726 (eq 'tib ref-type) |
1723 (not | 1727 (not |
1724 (re-search-forward ispell-tib-ref-end reg-end t))) | 1728 (re-search-forward ispell-tib-ref-end reg-end t))) |
1725 (and (eq 'sgml ref-type) | 1729 (and (eq 'sgml ref-type) |
1726 (not (search-forward "[>;]" reg-end t)))) | 1730 (not (re-search-forward "[>;]" reg-end t)))) |
1727 (progn | 1731 (progn |
1728 (ispell-pdict-save ispell-silently-savep) | 1732 (ispell-pdict-save ispell-silently-savep) |
1729 (ding) | 1733 (ding) |
1730 (message | 1734 (message |
1731 (concat | 1735 (concat |
1788 ;; This occurs due to filter pipe problems | 1792 ;; This occurs due to filter pipe problems |
1789 (error | 1793 (error |
1790 (concat "Ispell misalignment: word " | 1794 (concat "Ispell misalignment: word " |
1791 "`%s' point %d; please retry") | 1795 "`%s' point %d; please retry") |
1792 (car poss) word-start)) | 1796 (car poss) word-start)) |
1797 (if (not (pos-visible-in-window-p)) | |
1798 (sit-for 0)) | |
1793 (if ispell-keep-choices-win | 1799 (if ispell-keep-choices-win |
1794 (setq replace | 1800 (setq replace |
1795 (ispell-command-loop | 1801 (ispell-command-loop |
1796 (car (cdr (cdr poss))) | 1802 (car (cdr (cdr poss))) |
1797 (car (cdr (cdr (cdr poss)))) | 1803 (car (cdr (cdr (cdr poss)))) |
1863 (length (car poss))))) | 1869 (length (car poss))))) |
1864 (setq reg-end (+ reg-end change) | 1870 (setq reg-end (+ reg-end change) |
1865 offset-change (+ offset-change change) | 1871 offset-change (+ offset-change change) |
1866 end (+ end change))))) | 1872 end (+ end change))))) |
1867 (if (not ispell-quit) | 1873 (if (not ispell-quit) |
1868 (message | 1874 (message "Continuing spelling check using %s dictionary..." |
1869 (concat "Continuing spelling check using " | 1875 (or ispell-dictionary "default"))) |
1870 (or ispell-dictionary "default") | |
1871 " dictionary..."))) | |
1872 (sit-for 0))) | 1876 (sit-for 0))) |
1873 ;; finished with line! | 1877 ;; finished with line! |
1874 (setq ispell-filter (cdr ispell-filter))))) | 1878 (setq ispell-filter (cdr ispell-filter))))) |
1875 (goto-char end))))) | 1879 (goto-char end))))) |
1876 (not ispell-quit)) | 1880 (not ispell-quit)) |
2057 "^begin [0-9][0-9][0-9] .*\nM.*\nM.*\nM" | 2061 "^begin [0-9][0-9][0-9] .*\nM.*\nM.*\nM" |
2058 ;; Matches shell files (esp. auto-decoding) | 2062 ;; Matches shell files (esp. auto-decoding) |
2059 "^#! /bin/[ck]?sh" | 2063 "^#! /bin/[ck]?sh" |
2060 ;; Matches context difference listing | 2064 ;; Matches context difference listing |
2061 "\\(diff -c .*\\)?\n\\*\\*\\* .*\n--- .*\n\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*" | 2065 "\\(diff -c .*\\)?\n\\*\\*\\* .*\n--- .*\n\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*" |
2066 ;; Matches reporter.el bug report | |
2067 "^current state:\n==============\n" | |
2062 ;; Matches "----------------- cut here" | 2068 ;; Matches "----------------- cut here" |
2063 "^[-=_]+\\s ?cut here") | 2069 ;; and "------- Start of forwarded message" |
2070 "^[-=_]+\\s ?\\(cut here\\|Start of forwarded message\\)") | |
2064 "\\|") | 2071 "\\|") |
2065 "*End of text which will be checked in ispell-message. | 2072 "*End of text which will be checked in ispell-message. |
2066 If it is a string, limit at first occurrence of that regular expression. | 2073 If it is a string, limit at first occurrence of that regular expression. |
2067 Otherwise, it must be a function which is called to get the limit.") | 2074 Otherwise, it must be a function which is called to get the limit.") |
2068 | 2075 |
2097 (defun ispell-message () | 2104 (defun ispell-message () |
2098 "Check the spelling of a mail message or news post. | 2105 "Check the spelling of a mail message or news post. |
2099 Don't check spelling of message headers except the Subject field. | 2106 Don't check spelling of message headers except the Subject field. |
2100 Don't check included messages. | 2107 Don't check included messages. |
2101 | 2108 |
2102 To abort spell checking of a message REGION and send the message anyway, | 2109 To abort spell checking of a message region and send the message anyway, |
2103 use the `x' or `q' command. (Any subsequent regions will be checked.) | 2110 use the `x' or `q' command. (Any subsequent regions will be checked.) |
2104 The `X' command aborts the message send so that you can edit the buffer. | 2111 The `X' command aborts the message send so that you can edit the buffer. |
2105 | 2112 |
2106 To spell-check whenever a message is sent, include the appropriate lines | 2113 To spell-check whenever a message is sent, include the appropriate lines |
2107 in your .emacs file: | 2114 in your .emacs file: |
2108 (add-hook 'news-inews-hook 'ispell-message) | 2115 (add-hook 'message-send-hook 'ispell-message) |
2109 (add-hook 'mail-send-hook 'ispell-message) | 2116 (add-hook 'mail-send-hook 'ispell-message) |
2110 (add-hook 'mh-before-send-letter-hook 'ispell-message) | 2117 (add-hook 'mh-before-send-letter-hook 'ispell-message) |
2111 | 2118 |
2112 You can bind this to the key C-c i in GNUS or mail by adding to | 2119 You can bind this to the key C-c i in GNUS or mail by adding to |
2113 `news-reply-mode-hook' or `mail-mode-hook' the following lambda expression: | 2120 `news-reply-mode-hook' or `mail-mode-hook' the following lambda expression: |
2135 (concat "\\(" (sc-cite-regexp) "\\)" "\\|" | 2142 (concat "\\(" (sc-cite-regexp) "\\)" "\\|" |
2136 (ispell-non-empty-string sc-reference-tag-string))) | 2143 (ispell-non-empty-string sc-reference-tag-string))) |
2137 ((featurep 'sc) ; sc 2.3 | 2144 ((featurep 'sc) ; sc 2.3 |
2138 (concat "\\(" sc-cite-regexp "\\)" "\\|" | 2145 (concat "\\(" sc-cite-regexp "\\)" "\\|" |
2139 (ispell-non-empty-string sc-reference-tag-string))) | 2146 (ispell-non-empty-string sc-reference-tag-string))) |
2140 ((equal major-mode 'news-reply-mode) ;GNUS | 2147 ((equal major-mode 'news-reply-mode) ;GNUS 4 & below |
2141 (concat "In article <" "\\|" | 2148 (concat "In article <" "\\|" |
2149 (if mail-yank-prefix | |
2150 (ispell-non-empty-string mail-yank-prefix) | |
2151 "^ \\|^\t"))) | |
2152 ((equal major-mode 'message-mode) ;GNUS 5 | |
2153 (concat ".*@.* writes:$" "\\|" | |
2142 (if mail-yank-prefix | 2154 (if mail-yank-prefix |
2143 (ispell-non-empty-string mail-yank-prefix) | 2155 (ispell-non-empty-string mail-yank-prefix) |
2144 "^ \\|^\t"))) | 2156 "^ \\|^\t"))) |
2145 ((equal major-mode 'mh-letter-mode) ; mh mail message | 2157 ((equal major-mode 'mh-letter-mode) ; mh mail message |
2146 (ispell-non-empty-string mh-ins-buf-prefix)) | 2158 (ispell-non-empty-string mh-ins-buf-prefix)) |
2200 limit 'end) | 2212 limit 'end) |
2201 (progn (beginning-of-line) | 2213 (progn (beginning-of-line) |
2202 (point)))) | 2214 (point)))) |
2203 (end (or (and end-c end-fwd (min end-c end-fwd)) | 2215 (end (or (and end-c end-fwd (min end-c end-fwd)) |
2204 end-c end-fwd | 2216 end-c end-fwd |
2205 ;; defalut to limit of text. | 2217 ;; default to limit of text. |
2206 (marker-position limit)))) | 2218 (marker-position limit)))) |
2207 (goto-char start) | 2219 (goto-char start) |
2208 (ispell-region start end) | 2220 (ispell-region start end) |
2209 (if (and end-fwd (= end end-fwd)) | 2221 (if (and end-fwd (= end end-fwd)) |
2210 (progn | 2222 (progn |
2402 ; LocalWords: ispell ispell-highlight-p ispell-check-comments query-replace | 2414 ; LocalWords: ispell ispell-highlight-p ispell-check-comments query-replace |
2403 ; LocalWords: ispell-query-replace-choices ispell-skip-tib non-nil tib | 2415 ; LocalWords: ispell-query-replace-choices ispell-skip-tib non-nil tib |
2404 ; LocalWords: regexps ispell-tib-ref-beginning ispell-tib-ref-end | 2416 ; LocalWords: regexps ispell-tib-ref-beginning ispell-tib-ref-end |
2405 | 2417 |
2406 ;; ispell.el ends here | 2418 ;; ispell.el ends here |
2407 |