diff options
| author | Chong Yidong | 2008-09-22 18:16:42 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-09-22 18:16:42 +0000 |
| commit | bc129797ca107769279b1a44c9e183b8b6caa646 (patch) | |
| tree | 26e09a94ff1535eaafdbca8a4b195426cb125b7e | |
| parent | 841c809617baac9f7889443c6c6b3ca02a6ccf5a (diff) | |
| download | emacs-bc129797ca107769279b1a44c9e183b8b6caa646.tar.gz emacs-bc129797ca107769279b1a44c9e183b8b6caa646.zip | |
(Fixit): Favor C-/ keybinding for undo throughout. Link to Erasing
node.
(Undo): Reorganize paragraphs for logical flow. Move keybinding
rationale to a footnote.
(Kill Errors): Remove node, due to redundancy with Erasing.
(Spelling): Move discussion of flyspell to end. Note new behavior of
M-$ in active region. Remove non-ispell-specific keybindings from
table.
| -rw-r--r-- | doc/emacs/fixit.texi | 371 |
1 files changed, 154 insertions, 217 deletions
diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi index a6bd52b1bc4..114ba9247dd 100644 --- a/doc/emacs/fixit.texi +++ b/doc/emacs/fixit.texi | |||
| @@ -7,21 +7,24 @@ | |||
| 7 | @cindex typos, fixing | 7 | @cindex typos, fixing |
| 8 | @cindex mistakes, correcting | 8 | @cindex mistakes, correcting |
| 9 | 9 | ||
| 10 | In this chapter we describe the commands that are especially useful for | 10 | In this chapter we describe the commands that are especially useful |
| 11 | the times when you catch a mistake in your text just after you have made | 11 | when you catch a mistake in your text after you have made it, or |
| 12 | it, or change your mind while composing text on the fly. | 12 | change your mind while composing text on the fly. |
| 13 | 13 | ||
| 14 | The most fundamental command for correcting erroneous editing is the | 14 | The most fundamental command for correcting erroneous editing is the |
| 15 | undo command, @kbd{C-x u} or @kbd{C-_} or @kbd{C-/}. This command | 15 | undo command @kbd{C-/} (which is also bound to @kbd{C-x u} and |
| 16 | undoes a single command (usually), a part of a command (in the case of | 16 | @kbd{C-_}). This undoes a single command, or a part of a command (as |
| 17 | @code{query-replace}), or several consecutive self-inserting | 17 | in the case of @code{query-replace}), or several consecutive |
| 18 | characters. Consecutive repetitions of the undo command undo earlier | 18 | self-inserting characters. Consecutive repetitions of @kbd{C-/} undo |
| 19 | and earlier changes, back to the limit of the undo information | 19 | earlier and earlier changes, back to the limit of the undo information |
| 20 | available. @xref{Undo}, for more information. | 20 | available. |
| 21 | |||
| 22 | Aside from the commands described here, you can erase text using | ||
| 23 | deletion commands such as @key{DEL} (@code{delete-backward-char}). | ||
| 24 | These were described earlier in this manual. @xref{Erasing}. | ||
| 21 | 25 | ||
| 22 | @menu | 26 | @menu |
| 23 | * Undo:: The Undo commands. | 27 | * Undo:: The Undo commands. |
| 24 | * Kill Errors:: Commands to kill a batch of recently entered text. | ||
| 25 | * Transpose:: Exchanging two characters, words, lines, lists... | 28 | * Transpose:: Exchanging two characters, words, lines, lists... |
| 26 | * Fixing Case:: Correcting case of last word entered. | 29 | * Fixing Case:: Correcting case of last word entered. |
| 27 | * Spelling:: Apply spelling checker to a word, or a whole file. | 30 | * Spelling:: Apply spelling checker to a word, or a whole file. |
| @@ -32,19 +35,20 @@ available. @xref{Undo}, for more information. | |||
| 32 | @cindex undo | 35 | @cindex undo |
| 33 | @cindex changes, undoing | 36 | @cindex changes, undoing |
| 34 | 37 | ||
| 35 | The @dfn{undo} commands undo recent changes in the buffer's text. | 38 | The @dfn{undo} command reverses recent changes in the buffer's text. |
| 36 | Each buffer records changes individually, and the undo command always | 39 | Each buffer records changes individually, and the undo command always |
| 37 | applies to the current buffer. You can undo all the changes in a | 40 | applies to the current buffer. You can undo all the changes in a |
| 38 | buffer for as far as back these records go. Usually each editing | 41 | buffer for as far as back its records go. Usually, each editing |
| 39 | command makes a separate entry in the undo records, but some commands | 42 | command makes a separate entry in the undo records, but some commands |
| 40 | such as @code{query-replace} divide their changes into multiple | 43 | such as @code{query-replace} divide their changes into multiple |
| 41 | entries for flexibility in undoing. Meanwhile, self-inserting | 44 | entries for flexibility in undoing. Consecutive character insertion |
| 42 | characters are usually grouped to make undoing less tedious. | 45 | commands are usually grouped together into a single undo record, to |
| 46 | make undoing less tedious. | ||
| 43 | 47 | ||
| 44 | @table @kbd | 48 | @table @kbd |
| 45 | @item C-x u | 49 | @item C-/ |
| 50 | @itemx C-x u | ||
| 46 | @itemx C-_ | 51 | @itemx C-_ |
| 47 | @itemx C-/ | ||
| 48 | Undo one entry in the current buffer's undo records (@code{undo}). | 52 | Undo one entry in the current buffer's undo records (@code{undo}). |
| 49 | @end table | 53 | @end table |
| 50 | 54 | ||
| @@ -52,74 +56,75 @@ Undo one entry in the current buffer's undo records (@code{undo}). | |||
| 52 | @kindex C-_ | 56 | @kindex C-_ |
| 53 | @kindex C-/ | 57 | @kindex C-/ |
| 54 | @findex undo | 58 | @findex undo |
| 55 | To begin to undo, type the command @kbd{C-/} (or its aliases, | 59 | To begin to undo, type @kbd{C-/} (or its aliases, @kbd{C-_} or |
| 56 | @kbd{C-_} or @kbd{C-x u}). This undoes the most recent change in the | 60 | @kbd{C-x u})@footnote{Aside from @kbd{C-/}, the @code{undo} command is |
| 57 | buffer, and moves point back to where it was before that change. | 61 | also bound to @kbd{C-x u} because that is more straightforward for |
| 62 | beginners to remember: @samp{u} stands for ``undo''. It is also bound | ||
| 63 | to @kbd{C-_} because typing @kbd{C-/} on some text-only terminals | ||
| 64 | actually enters @kbd{C-_}.}. This undoes the most recent change in | ||
| 65 | the buffer, and moves point back to where it was before that change. | ||
| 58 | 66 | ||
| 59 | Consecutive repetitions of @kbd{C-/} (or its aliases) undo earlier | 67 | Consecutive repetitions of @kbd{C-/} (or its aliases) undo earlier |
| 60 | and earlier changes in the current buffer, back to the limit of the | 68 | and earlier changes in the current buffer. If all the recorded |
| 61 | current buffer's undo records. If all the recorded changes have | 69 | changes have already been undone, the undo command signals an error. |
| 62 | already been undone, the undo command just signals an error. | ||
| 63 | |||
| 64 | If you notice that a buffer has been modified accidentally, the | ||
| 65 | easiest way to recover is to type @kbd{C-/} repeatedly until the stars | ||
| 66 | disappear from the front of the mode line. At this time, all the | ||
| 67 | modifications you made have been canceled. Whenever an undo command | ||
| 68 | makes the stars disappear from the mode line, it means that the buffer | ||
| 69 | contents are the same as they were when the file was last read in or | ||
| 70 | saved. | ||
| 71 | |||
| 72 | If you do not remember whether you changed the buffer deliberately, | ||
| 73 | type @kbd{C-/} once. When you see the last change you made undone, you | ||
| 74 | will see whether it was an intentional change. If it was an accident, | ||
| 75 | leave it undone. If it was deliberate, redo the change as described | ||
| 76 | below. | ||
| 77 | 70 | ||
| 71 | @cindex redo | ||
| 78 | @findex undo-only | 72 | @findex undo-only |
| 79 | Any command other than an undo command breaks the sequence of undo | 73 | Any command other than an undo command breaks the sequence of undo |
| 80 | commands. Starting from that moment, the previous undo commands | 74 | commands. Starting from that moment, the entire sequence of undo |
| 81 | become ordinary changes that you can undo. Thus, to redo changes you | 75 | commands that you have just performed are themselves placed into the |
| 82 | have undone, type @kbd{C-f} or any other command that will harmlessly | 76 | undo record, as a single set of changes. Therefore, to re-apply |
| 83 | break the sequence of undoing, then type undo commands again. On the | 77 | changes you have undone, type @kbd{C-f} or any other command that |
| 84 | other hand, if you want to resume undoing, without redoing previous | 78 | harmlessly breaks the sequence of undoing; then type @kbd{C-/} to undo |
| 85 | undo commands, use @kbd{M-x undo-only}. This is like @code{undo}, but | 79 | the undo command. |
| 86 | will not redo changes you have just undone. | 80 | |
| 81 | On the other hand, if you want to resume undoing, without redoing | ||
| 82 | previous undo commands, use @kbd{M-x undo-only}. This is like | ||
| 83 | @code{undo}, but will not redo changes you have just undone. | ||
| 84 | |||
| 85 | If you notice that a buffer has been modified accidentally, the | ||
| 86 | easiest way to recover is to type @kbd{C-/} repeatedly until the stars | ||
| 87 | disappear from the front of the mode line (@pxref{Mode Line}). | ||
| 88 | Whenever an undo command makes the stars disappear from the mode line, | ||
| 89 | it means that the buffer contents are the same as they were when the | ||
| 90 | file was last read in or saved. If you do not remember whether you | ||
| 91 | changed the buffer deliberately, type @kbd{C-/} once. When you see | ||
| 92 | the last change you made undone, you will see whether it was an | ||
| 93 | intentional change. If it was an accident, leave it undone. If it | ||
| 94 | was deliberate, redo the change as described above. | ||
| 87 | 95 | ||
| 88 | @cindex selective undo | 96 | @cindex selective undo |
| 89 | @kindex C-u C-/ | 97 | @kindex C-u C-/ |
| 90 | When there is an active region, any use of @code{undo} performs | 98 | When there is an active region, any use of @code{undo} performs |
| 91 | @dfn{selective undo}, undoing the most recent change within the | 99 | @dfn{selective undo}: it undoes the most recent change within the |
| 92 | region, instead of the entire buffer. However, when Transient Mark | 100 | region, instead of the entire buffer. However, when Transient Mark |
| 93 | mode is off (@pxref{Persistent Mark}), @kbd{C-/} always operates on | 101 | mode is off (@pxref{Persistent Mark}), @kbd{C-/} always operates on |
| 94 | the entire buffer, ignoring the region. In this case, you can perform | 102 | the entire buffer, ignoring the region. In this case, you can perform |
| 95 | selective undo by supplying a prefix argument to the @code{undo} | 103 | selective undo by supplying a prefix argument to the @code{undo} |
| 96 | command: @kbd{C-u C-/} or @kbd{C-u C-x u}. To undo further changes in | 104 | command: @kbd{C-u C-/}. To undo further changes in the same region, |
| 97 | the same region, repeat the @code{undo} command (no prefix argument is | 105 | repeat the @code{undo} command (no prefix argument is needed). |
| 98 | needed). | ||
| 99 | 106 | ||
| 100 | Some specialized buffers do not make undo records. Buffers | 107 | Some specialized buffers do not make undo records. Buffers whose |
| 101 | whose names start with spaces never do; these buffers are used | 108 | names start with spaces never do; these buffers are used internally by |
| 102 | internally by Emacs and its extensions to hold text that users don't | 109 | Emacs to hold text that users don't normally look at or edit. |
| 103 | normally look at or edit. | ||
| 104 | 110 | ||
| 105 | @vindex undo-limit | 111 | @vindex undo-limit |
| 106 | @vindex undo-strong-limit | 112 | @vindex undo-strong-limit |
| 107 | @vindex undo-outer-limit | 113 | @vindex undo-outer-limit |
| 108 | @cindex undo limit | 114 | @cindex undo limit |
| 109 | When the undo records for a buffer becomes too large, Emacs | 115 | When the undo records for a buffer becomes too large, Emacs discards |
| 110 | discards the oldest undo records from time to time (during garbage | 116 | the oldest undo records from time to time (during @dfn{garbage |
| 111 | collection). You can specify how much undo records to keep by | 117 | collection}). You can specify how much undo records to keep by |
| 112 | setting three variables: @code{undo-limit}, @code{undo-strong-limit}, | 118 | setting the variables @code{undo-limit}, @code{undo-strong-limit}, and |
| 113 | and @code{undo-outer-limit}. Their values are expressed in units of | 119 | @code{undo-outer-limit}. Their values are expressed in bytes. |
| 114 | bytes of space. | ||
| 115 | 120 | ||
| 116 | The variable @code{undo-limit} sets a soft limit: Emacs keeps undo | 121 | The variable @code{undo-limit} sets a soft limit: Emacs keeps undo |
| 117 | data for enough commands to reach this size, and perhaps exceed it, | 122 | data for enough commands to reach this size, and perhaps exceed it, |
| 118 | but does not keep data for any earlier commands beyond that. Its | 123 | but does not keep data for any earlier commands beyond that. Its |
| 119 | default value is 20000. The variable @code{undo-strong-limit} sets a | 124 | default value is 20000. The variable @code{undo-strong-limit} sets a |
| 120 | stricter limit: a previous command (not the most recent one) which | 125 | stricter limit: any previous command (though not the most recent one) |
| 121 | pushes the size past this amount is itself forgotten. The default | 126 | that pushes the size past this amount is forgotten. The default value |
| 122 | value of @code{undo-strong-limit} is 30000. | 127 | of @code{undo-strong-limit} is 30000. |
| 123 | 128 | ||
| 124 | Regardless of the values of those variables, the most recent change | 129 | Regardless of the values of those variables, the most recent change |
| 125 | is never discarded unless it gets bigger than @code{undo-outer-limit} | 130 | is never discarded unless it gets bigger than @code{undo-outer-limit} |
| @@ -131,46 +136,6 @@ future. But if you didn't expect the command to create such large | |||
| 131 | undo data, then it is probably a bug and you should report it. | 136 | undo data, then it is probably a bug and you should report it. |
| 132 | @xref{Bugs,, Reporting Bugs}. | 137 | @xref{Bugs,, Reporting Bugs}. |
| 133 | 138 | ||
| 134 | The reason the @code{undo} command has three key bindings, @kbd{C-x | ||
| 135 | u}, @kbd{C-_} and @kbd{C-/}, is that it is worthy of a | ||
| 136 | single-character key, but @kbd{C-x u} is more straightforward for | ||
| 137 | beginners to remember and type. Meanwhile, @kbd{C--} on a text-only | ||
| 138 | terminal is really @kbd{C-_}, which makes it a natural and easily | ||
| 139 | typed binding for undoing. | ||
| 140 | |||
| 141 | @node Kill Errors | ||
| 142 | @section Killing Your Mistakes | ||
| 143 | |||
| 144 | @table @kbd | ||
| 145 | @item @key{DEL} | ||
| 146 | Delete last character (@code{delete-backward-char}). | ||
| 147 | @item M-@key{DEL} | ||
| 148 | Kill last word (@code{backward-kill-word}). | ||
| 149 | @item C-x @key{DEL} | ||
| 150 | Kill to beginning of sentence (@code{backward-kill-sentence}). | ||
| 151 | @end table | ||
| 152 | |||
| 153 | The @key{DEL} character (@code{delete-backward-char}) is the most | ||
| 154 | important correction command. It deletes the character before point. | ||
| 155 | When @key{DEL} follows a self-inserting character command, you can think | ||
| 156 | of it as canceling that command. However, avoid the confusion of thinking | ||
| 157 | of @key{DEL} as a general way to cancel a command! | ||
| 158 | |||
| 159 | When your mistake is longer than a couple of characters, it might be | ||
| 160 | more convenient to use @kbd{M-@key{DEL}} or @kbd{C-x @key{DEL}}. | ||
| 161 | @kbd{M-@key{DEL}} kills back to the start of the last word, and @kbd{C-x | ||
| 162 | @key{DEL}} kills back to the start of the last sentence. @kbd{C-x | ||
| 163 | @key{DEL}} is particularly useful when you change your mind about the | ||
| 164 | phrasing of the text you are writing. @kbd{M-@key{DEL}} and @kbd{C-x | ||
| 165 | @key{DEL}} save the killed text for @kbd{C-y} and @kbd{M-y} to | ||
| 166 | retrieve. @xref{Yanking}.@refill | ||
| 167 | |||
| 168 | @kbd{M-@key{DEL}} is often useful even when you have typed only a few | ||
| 169 | characters wrong, if you know you are confused in your typing and aren't | ||
| 170 | sure exactly what you typed. At such a time, you cannot correct with | ||
| 171 | @key{DEL} except by looking at the screen to see what you did. Often it | ||
| 172 | requires less thought to kill the whole word and start again. | ||
| 173 | |||
| 174 | @node Transpose | 139 | @node Transpose |
| 175 | @section Transposing Text | 140 | @section Transposing Text |
| 176 | 141 | ||
| @@ -262,103 +227,82 @@ case-convert it and go on typing. @xref{Case}.@refill | |||
| 262 | @cindex checking spelling | 227 | @cindex checking spelling |
| 263 | @cindex correcting spelling | 228 | @cindex correcting spelling |
| 264 | 229 | ||
| 265 | This section describes the commands to check the spelling of a single | 230 | This section describes the commands to check the spelling of a |
| 266 | word or of a portion of a buffer. These commands work with the spelling | 231 | single word or of a portion of a buffer. These commands only work if |
| 267 | checker programs Aspell and Ispell, which are not part of Emacs. | 232 | the spelling checker program Aspell or Ispell is installed. Neither |
| 233 | Aspell nor Ispell are part of Emacs, but one or the other is usually | ||
| 234 | installed in GNU/Linux and other free operating systems. | ||
| 268 | @ifnottex | 235 | @ifnottex |
| 269 | @xref{Top, Aspell,, aspell, The Aspell Manual}. | 236 | @xref{Top, Aspell,, aspell, The Aspell Manual}. |
| 270 | @end ifnottex | 237 | @end ifnottex |
| 271 | 238 | ||
| 272 | @table @kbd | 239 | @table @kbd |
| 273 | @item M-x flyspell-mode | ||
| 274 | Enable Flyspell mode, which highlights all misspelled words. | ||
| 275 | @item M-x flyspell-prog-mode | ||
| 276 | Enable Flyspell mode for comments and strings only. | ||
| 277 | @item M-$ | 240 | @item M-$ |
| 278 | Check and correct spelling of the word at point (@code{ispell-word}). | 241 | Check and correct spelling of the active region or the word at point |
| 279 | @item M-@key{TAB} | 242 | (@code{ispell-word}). |
| 280 | @itemx @key{ESC} @key{TAB} | ||
| 281 | Complete the word before point based on the spelling dictionary | ||
| 282 | (@code{ispell-complete-word}). | ||
| 283 | @item M-x ispell | 243 | @item M-x ispell |
| 284 | Spell-check the active region or the current buffer. | 244 | Check and correct spelling in the active region or the entire buffer. |
| 285 | @item M-x ispell-buffer | 245 | @item M-x ispell-buffer |
| 286 | Check and correct spelling of each word in the buffer. | 246 | Check and correct spelling in the buffer. |
| 287 | @item M-x ispell-region | 247 | @item M-x ispell-region |
| 288 | Check and correct spelling of each word in the region. | 248 | Check and correct spelling in the region. |
| 289 | @item M-x ispell-message | 249 | @item M-x ispell-message |
| 290 | Check and correct spelling of each word in a draft mail message, | 250 | Check and correct spelling in a draft mail message, excluding cited |
| 291 | excluding cited material. | 251 | material. |
| 292 | @item M-x ispell-change-dictionary @key{RET} @var{dict} @key{RET} | 252 | @item M-x ispell-change-dictionary @key{RET} @var{dict} @key{RET} |
| 293 | Restart the Aspell or Ispell process, using @var{dict} as the dictionary. | 253 | Restart the Aspell or Ispell process, using @var{dict} as the dictionary. |
| 294 | @item M-x ispell-kill-ispell | 254 | @item M-x ispell-kill-ispell |
| 295 | Kill the Aspell or Ispell subprocess. | 255 | Kill the Aspell or Ispell subprocess. |
| 256 | @item M-@key{TAB} | ||
| 257 | @itemx @key{ESC} @key{TAB} | ||
| 258 | Complete the word before point based on the spelling dictionary | ||
| 259 | (@code{ispell-complete-word}). | ||
| 260 | @item M-x flyspell-mode | ||
| 261 | Enable Flyspell mode, which highlights all misspelled words. | ||
| 262 | @item M-x flyspell-prog-mode | ||
| 263 | Enable Flyspell mode for comments and strings only. | ||
| 296 | @end table | 264 | @end table |
| 297 | 265 | ||
| 298 | @cindex Flyspell mode | ||
| 299 | @findex flyspell-mode | ||
| 300 | Flyspell mode is a fully-automatic way to check spelling as you edit | ||
| 301 | in Emacs. It operates by checking words as you change or insert them. | ||
| 302 | When it finds a word that it does not recognize, it highlights that | ||
| 303 | word. This does not interfere with your editing, but when you see the | ||
| 304 | highlighted word, you can move to it and fix it. Type @kbd{M-x | ||
| 305 | flyspell-mode} to enable or disable this mode in the current buffer. | ||
| 306 | |||
| 307 | When Flyspell mode highlights a word as misspelled, you can click on | ||
| 308 | it with @kbd{Mouse-2} to display a menu of possible corrections and | ||
| 309 | actions. You can also correct the word by editing it manually in any | ||
| 310 | way you like. | ||
| 311 | |||
| 312 | @findex flyspell-prog-mode | ||
| 313 | Flyspell Prog mode works just like ordinary Flyspell mode, except that | ||
| 314 | it only checks words in comments and string constants. This feature | ||
| 315 | is useful for editing programs. Type @kbd{M-x flyspell-prog-mode} to | ||
| 316 | enable or disable this mode in the current buffer. | ||
| 317 | |||
| 318 | The other Emacs spell-checking features check or look up words when | ||
| 319 | you give an explicit command to do so. | ||
| 320 | |||
| 321 | @kindex M-$ | 266 | @kindex M-$ |
| 322 | @findex ispell-word | 267 | @findex ispell-word |
| 323 | To check the spelling of the word around or before point, and | 268 | To check the spelling of the word around or before point, and |
| 324 | optionally correct it as well, use the command @kbd{M-$} | 269 | optionally correct it as well, type @kbd{M-$} (@code{ispell-word}). |
| 325 | (@code{ispell-word}). If the word is not correct, Emacs offers you | 270 | If a region is active, @kbd{M-$} checks the spelling of all words |
| 326 | various alternatives for what to do about it. If a region is active, | 271 | within the region. @xref{Mark}. (When Transient Mark mode is off, |
| 327 | @kbd{M-$} checks the spelling of all words within the region | 272 | @kbd{M-$} always acts on the word around or before point, ignoring the |
| 328 | (@pxref{Mark}). (However, when Transient Mark mode is off, @kbd{M-$} | 273 | region. @xref{Persistent Mark}.) |
| 329 | always acts on the word around or before point, ignoring the region. | ||
| 330 | @xref{Persistent Mark}.) | ||
| 331 | 274 | ||
| 332 | @findex ispell | 275 | @findex ispell |
| 333 | @cindex spell-checking the active region | ||
| 334 | The @kbd{M-x ispell} command performs spell-checking on the entire | ||
| 335 | buffer if no region is active, or on region if one is active. (When | ||
| 336 | Transient Mark mode is off, it always acts on the entire buffer, | ||
| 337 | ignoring the region.) | ||
| 338 | |||
| 339 | @findex ispell-buffer | 276 | @findex ispell-buffer |
| 340 | @findex ispell-region | 277 | @findex ispell-region |
| 341 | The commands @kbd{M-x ispell-buffer} and @kbd{M-x ispell-region} | 278 | @cindex spell-checking the active region |
| 279 | Similarly, the command @kbd{M-x ispell} performs spell-checking in | ||
| 280 | the region if one is active, or in the entire buffer otherwise. The | ||
| 281 | commands @kbd{M-x ispell-buffer} and @kbd{M-x ispell-region} | ||
| 342 | explicitly perform spell-checking on the entire buffer or the region | 282 | explicitly perform spell-checking on the entire buffer or the region |
| 343 | respectively. | 283 | respectively. To check spelling in an email message you are writing, |
| 284 | use @kbd{M-x ispell-message}; that command checks the whole buffer, | ||
| 285 | except for material that is indented or appears to be cited from other | ||
| 286 | messages. @xref{Sending Mail}. | ||
| 344 | 287 | ||
| 345 | To check spelling in an email message you are writing, use @kbd{M-x | 288 | When one of these commands encounters what appears to be an |
| 346 | ispell-message}; that command checks the whole buffer, except for | 289 | incorrect word, it asks you what to do. It usually displays a list of |
| 347 | material that is indented or appears to be cited from other messages. | 290 | numbered ``near-misses''---words that are close to the incorrect word. |
| 348 | 291 | Then you must type a single-character response. Here are the valid | |
| 349 | Each time these commands encounter an incorrect word, they ask you | 292 | responses: |
| 350 | what to do. They display a list of alternatives, usually including | ||
| 351 | several ``near-misses''---words that are close to the word being | ||
| 352 | checked. Then you must type a single-character response. Here are | ||
| 353 | the valid responses: | ||
| 354 | 293 | ||
| 355 | @table @kbd | 294 | @table @kbd |
| 295 | @item @var{digit} | ||
| 296 | Replace the word, just this time, with one of the displayed | ||
| 297 | near-misses. Each near-miss is listed with a digit; type that digit | ||
| 298 | to select it. | ||
| 299 | |||
| 356 | @item @key{SPC} | 300 | @item @key{SPC} |
| 357 | Skip this word---continue to consider it incorrect, but don't change it | 301 | Skip this word---continue to consider it incorrect, but don't change it |
| 358 | here. | 302 | here. |
| 359 | 303 | ||
| 360 | @item r @var{new} @key{RET} | 304 | @item r @var{new} @key{RET} |
| 361 | Replace the word (just this time) with @var{new}. (The replacement | 305 | Replace the word, just this time, with @var{new}. (The replacement |
| 362 | string will be rescanned for more spelling errors.) | 306 | string will be rescanned for more spelling errors.) |
| 363 | 307 | ||
| 364 | @item R @var{new} @key{RET} | 308 | @item R @var{new} @key{RET} |
| @@ -366,11 +310,6 @@ Replace the word with @var{new}, and do a @code{query-replace} so you | |||
| 366 | can replace it elsewhere in the buffer if you wish. (The replacements | 310 | can replace it elsewhere in the buffer if you wish. (The replacements |
| 367 | will be rescanned for more spelling errors.) | 311 | will be rescanned for more spelling errors.) |
| 368 | 312 | ||
| 369 | @item @var{digit} | ||
| 370 | Replace the word (just this time) with one of the displayed | ||
| 371 | near-misses. Each near-miss is listed with a digit; type that digit to | ||
| 372 | select it. | ||
| 373 | |||
| 374 | @item a | 313 | @item a |
| 375 | Accept the incorrect word---treat it as correct, but only in this | 314 | Accept the incorrect word---treat it as correct, but only in this |
| 376 | editing session. | 315 | editing session. |
| @@ -383,14 +322,14 @@ editing session and for this buffer. | |||
| 383 | Insert this word in your private dictionary file so that Aspell or Ispell will | 322 | Insert this word in your private dictionary file so that Aspell or Ispell will |
| 384 | consider it correct from now on, even in future sessions. | 323 | consider it correct from now on, even in future sessions. |
| 385 | 324 | ||
| 386 | @item u | ||
| 387 | Insert the lower-case version of this word in your private dic@-tion@-ary | ||
| 388 | file. | ||
| 389 | |||
| 390 | @item m | 325 | @item m |
| 391 | Like @kbd{i}, but you can also specify dictionary completion | 326 | Like @kbd{i}, but you can also specify dictionary completion |
| 392 | information. | 327 | information. |
| 393 | 328 | ||
| 329 | @item u | ||
| 330 | Insert the lower-case version of this word in your private dic@-tion@-ary | ||
| 331 | file. | ||
| 332 | |||
| 394 | @item l @var{word} @key{RET} | 333 | @item l @var{word} @key{RET} |
| 395 | Look in the dictionary for words that match @var{word}. These words | 334 | Look in the dictionary for words that match @var{word}. These words |
| 396 | become the new list of ``near-misses''; you can select one of them as | 335 | become the new list of ``near-misses''; you can select one of them as |
| @@ -398,13 +337,11 @@ the replacement by typing a digit. You can use @samp{*} in @var{word} as a | |||
| 398 | wildcard. | 337 | wildcard. |
| 399 | 338 | ||
| 400 | @item C-g | 339 | @item C-g |
| 340 | @itemx X | ||
| 401 | Quit interactive spell checking, leaving point at the word that was | 341 | Quit interactive spell checking, leaving point at the word that was |
| 402 | being checked. You can restart checking again afterward with @kbd{C-u | 342 | being checked. You can restart checking again afterward with @kbd{C-u |
| 403 | M-$}. | 343 | M-$}. |
| 404 | 344 | ||
| 405 | @item X | ||
| 406 | Same as @kbd{C-g}. | ||
| 407 | |||
| 408 | @item x | 345 | @item x |
| 409 | Quit interactive spell checking and move point back to where it was | 346 | Quit interactive spell checking and move point back to where it was |
| 410 | when you started spell checking. | 347 | when you started spell checking. |
| @@ -412,65 +349,65 @@ when you started spell checking. | |||
| 412 | @item q | 349 | @item q |
| 413 | Quit interactive spell checking and kill the Ispell subprocess. | 350 | Quit interactive spell checking and kill the Ispell subprocess. |
| 414 | 351 | ||
| 415 | @item C-l | ||
| 416 | Refresh the screen. | ||
| 417 | |||
| 418 | @item C-z | ||
| 419 | This key has its normal command meaning (suspend Emacs or iconify this | ||
| 420 | frame). | ||
| 421 | |||
| 422 | @item ? | 352 | @item ? |
| 423 | Show the list of options. | 353 | Show the list of options. |
| 424 | @end table | 354 | @end table |
| 425 | 355 | ||
| 426 | @findex ispell-complete-word | 356 | @findex ispell-complete-word |
| 427 | The command @code{ispell-complete-word}, which is bound to the key | 357 | In Text mode and related modes, the command @kbd{M-@key{TAB}} |
| 428 | @kbd{M-@key{TAB}} in Text mode and related modes, shows a list of | 358 | (@code{ispell-complete-word}) shows a list of completions based on |
| 429 | completions based on spelling correction. Insert the beginning of a | 359 | spelling correction. Insert the beginning of a word, and then type |
| 430 | word, and then type @kbd{M-@key{TAB}}; the command displays a | 360 | @kbd{M-@key{TAB}}; the command displays a completion list window. (If |
| 431 | completion list window. (If your window manager intercepts | 361 | your window manager intercepts @kbd{M-@key{TAB}}, type @kbd{@key{ESC} |
| 432 | @kbd{M-@key{TAB}}, type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i}.) To | 362 | @key{TAB}} or @kbd{C-M-i}.) To choose one of the completions listed, |
| 433 | choose one of the completions listed, click @kbd{Mouse-2} or | 363 | click @kbd{Mouse-2} or @kbd{Mouse-1} fast on it, or move the cursor |
| 434 | @kbd{Mouse-1} fast on it, or move the cursor there in the completions | 364 | there in the completions window and type @key{RET}. @xref{Text Mode}. |
| 435 | window and type @key{RET}. @xref{Text Mode}. | ||
| 436 | |||
| 437 | @ignore | ||
| 438 | @findex reload-ispell | ||
| 439 | The first time you use any of the spell checking commands, it starts | ||
| 440 | an Ispell subprocess. The first thing the subprocess does is read your | ||
| 441 | private dictionary, which defaults to the file @file{~/ispell.words}. | ||
| 442 | Words that you ``insert'' with the @kbd{i} command are added to that | ||
| 443 | file, but not right away---only at the end of the interactive | ||
| 444 | replacement procedure. Use the @kbd{M-x reload-ispell} command to | ||
| 445 | reload your private dictionary if you edit the file outside of Ispell. | ||
| 446 | @end ignore | ||
| 447 | 365 | ||
| 448 | @cindex @code{ispell} program | 366 | @cindex @code{ispell} program |
| 449 | @findex ispell-kill-ispell | 367 | @findex ispell-kill-ispell |
| 450 | Once started, the Aspell or Ispell subprocess continues to run | 368 | Once started, the Aspell or Ispell subprocess continues to run, |
| 451 | (waiting for something to do), so that subsequent spell checking | 369 | waiting for something to do, so that subsequent spell checking |
| 452 | commands complete more quickly. If you want to get rid of the | 370 | commands complete more quickly. If you want to get rid of the |
| 453 | process, use @kbd{M-x ispell-kill-ispell}. This is not usually | 371 | process, use @kbd{M-x ispell-kill-ispell}. This is not usually |
| 454 | necessary, since the process uses no time except when you do spelling | 372 | necessary, since the process uses no time except when you do spelling |
| 455 | correction. | 373 | correction. |
| 456 | 374 | ||
| 457 | @vindex ispell-dictionary | 375 | @vindex ispell-dictionary |
| 458 | Ispell and Aspell use two dictionaries together for spell checking: the | 376 | @vindex ispell-complete-word-dict |
| 459 | standard dictionary and your private dictionary. The variable | 377 | Ispell and Aspell use two dictionaries together for spell checking: |
| 378 | the standard dictionary and your private dictionary. The variable | ||
| 460 | @code{ispell-dictionary} specifies the file name to use for the | 379 | @code{ispell-dictionary} specifies the file name to use for the |
| 461 | standard dictionary; a value of @code{nil} selects the default | 380 | standard dictionary; a value of @code{nil} selects the default |
| 462 | dictionary. The command @kbd{M-x ispell-change-dictionary} sets this | 381 | dictionary. The command @kbd{M-x ispell-change-dictionary} sets this |
| 463 | variable and then restarts the subprocess, so that it will use | 382 | variable and then restarts the subprocess, so that it will use a |
| 464 | a different standard dictionary. | 383 | different standard dictionary. A separate dictionary is used for word |
| 465 | 384 | completion. The variable @code{ispell-complete-word-dict} specifies | |
| 466 | @vindex ispell-complete-word-dict | 385 | the file name of this dictionary. The completion dictionary must be |
| 467 | Aspell and Ispell use a separate dictionary for word completion. | 386 | different because it cannot use root and affix information. For some |
| 468 | The variable @code{ispell-complete-word-dict} specifies the file name | 387 | languages, there is a spell checking dictionary but no word completion |
| 469 | of this dictionary. The completion dictionary must be different | ||
| 470 | because it cannot use root and affix information. For some languages | ||
| 471 | there is a spell checking dictionary but no word completion | ||
| 472 | dictionary. | 388 | dictionary. |
| 473 | 389 | ||
| 390 | @cindex Flyspell mode | ||
| 391 | @findex flyspell-mode | ||
| 392 | Flyspell mode is a fully-automatic way to check spelling as you edit | ||
| 393 | in Emacs. It operates by checking words as you change or insert them. | ||
| 394 | When it finds a word that it does not recognize, it highlights that | ||
| 395 | word. This does not interfere with your editing, but when you see the | ||
| 396 | highlighted word, you can move to it and fix it. Type @kbd{M-x | ||
| 397 | flyspell-mode} to enable or disable this mode in the current buffer. | ||
| 398 | |||
| 399 | When Flyspell mode highlights a word as misspelled, you can click on | ||
| 400 | it with @kbd{Mouse-2} to display a menu of possible corrections and | ||
| 401 | actions. You can also correct the word by editing it manually in any | ||
| 402 | way you like. | ||
| 403 | |||
| 404 | @findex flyspell-prog-mode | ||
| 405 | Flyspell Prog mode works just like ordinary Flyspell mode, except | ||
| 406 | that it only checks words in comments and string constants. This | ||
| 407 | feature is useful for editing programs. Type @kbd{M-x | ||
| 408 | flyspell-prog-mode} to enable or disable this mode in the current | ||
| 409 | buffer. | ||
| 410 | |||
| 474 | @ignore | 411 | @ignore |
| 475 | arch-tag: 3359a443-96ed-448f-9f05-c8111ba8eac0 | 412 | arch-tag: 3359a443-96ed-448f-9f05-c8111ba8eac0 |
| 476 | @end ignore | 413 | @end ignore |