annotate man/fixit.texi @ 60475:79a6a2fec394

*** empty log message ***
author Nick Roberts <nickrob@snap.net.nz>
date Mon, 07 Mar 2005 01:54:41 +0000
parents 8e852ce0e115
children 1193719f830c 29e773288013
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
1 @c This is part of the Emacs manual.
Dave Love <fx@gnu.org>
parents:
diff changeset
2 @c Copyright (C) 1985, 86, 87, 93, 94, 95, 1997 Free Software Foundation, Inc.
Dave Love <fx@gnu.org>
parents:
diff changeset
3 @c See file emacs.texi for copying conditions.
52241
0b4e04022bd6 (Fixit): Update `Next' pointer.
Luc Teirlinck <teirllm@auburn.edu>
parents: 49600
diff changeset
4 @node Fixit, Keyboard Macros, Search, Top
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
5 @chapter Commands for Fixing Typos
Dave Love <fx@gnu.org>
parents:
diff changeset
6 @cindex typos, fixing
Dave Love <fx@gnu.org>
parents:
diff changeset
7 @cindex mistakes, correcting
Dave Love <fx@gnu.org>
parents:
diff changeset
8
Dave Love <fx@gnu.org>
parents:
diff changeset
9 In this chapter we describe the commands that are especially useful for
Dave Love <fx@gnu.org>
parents:
diff changeset
10 the times when you catch a mistake in your text just after you have made
Dave Love <fx@gnu.org>
parents:
diff changeset
11 it, or change your mind while composing text on the fly.
Dave Love <fx@gnu.org>
parents:
diff changeset
12
Dave Love <fx@gnu.org>
parents:
diff changeset
13 The most fundamental command for correcting erroneous editing is the
60242
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
14 undo command, @kbd{C-x u} or @kbd{C-_} or @kbd{C-/}. This command
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
15 undoes a single command (usually), a part of a command (in the case of
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
16 @code{query-replace}), or several consecutive self-inserting
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
17 characters. Consecutive repetitions of the undo command undo earlier
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
18 and earlier changes, back to the limit of the undo information
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
19 available. @xref{Undo}, for more information.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
20
Dave Love <fx@gnu.org>
parents:
diff changeset
21 @menu
Dave Love <fx@gnu.org>
parents:
diff changeset
22 * Kill Errors:: Commands to kill a batch of recently entered text.
Dave Love <fx@gnu.org>
parents:
diff changeset
23 * Transpose:: Exchanging two characters, words, lines, lists...
Dave Love <fx@gnu.org>
parents:
diff changeset
24 * Fixing Case:: Correcting case of last word entered.
Dave Love <fx@gnu.org>
parents:
diff changeset
25 * Spelling:: Apply spelling checker to a word, or a whole file.
Dave Love <fx@gnu.org>
parents:
diff changeset
26 @end menu
Dave Love <fx@gnu.org>
parents:
diff changeset
27
Dave Love <fx@gnu.org>
parents:
diff changeset
28 @node Kill Errors
Dave Love <fx@gnu.org>
parents:
diff changeset
29 @section Killing Your Mistakes
Dave Love <fx@gnu.org>
parents:
diff changeset
30
Dave Love <fx@gnu.org>
parents:
diff changeset
31 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
32 @item @key{DEL}
Dave Love <fx@gnu.org>
parents:
diff changeset
33 Delete last character (@code{delete-backward-char}).
Dave Love <fx@gnu.org>
parents:
diff changeset
34 @item M-@key{DEL}
Dave Love <fx@gnu.org>
parents:
diff changeset
35 Kill last word (@code{backward-kill-word}).
Dave Love <fx@gnu.org>
parents:
diff changeset
36 @item C-x @key{DEL}
Dave Love <fx@gnu.org>
parents:
diff changeset
37 Kill to beginning of sentence (@code{backward-kill-sentence}).
Dave Love <fx@gnu.org>
parents:
diff changeset
38 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
39
Dave Love <fx@gnu.org>
parents:
diff changeset
40 The @key{DEL} character (@code{delete-backward-char}) is the most
Dave Love <fx@gnu.org>
parents:
diff changeset
41 important correction command. It deletes the character before point.
Dave Love <fx@gnu.org>
parents:
diff changeset
42 When @key{DEL} follows a self-inserting character command, you can think
Dave Love <fx@gnu.org>
parents:
diff changeset
43 of it as canceling that command. However, avoid the mistake of thinking
Dave Love <fx@gnu.org>
parents:
diff changeset
44 of @key{DEL} as a general way to cancel a command!
Dave Love <fx@gnu.org>
parents:
diff changeset
45
Dave Love <fx@gnu.org>
parents:
diff changeset
46 When your mistake is longer than a couple of characters, it might be
Dave Love <fx@gnu.org>
parents:
diff changeset
47 more convenient to use @kbd{M-@key{DEL}} or @kbd{C-x @key{DEL}}.
Dave Love <fx@gnu.org>
parents:
diff changeset
48 @kbd{M-@key{DEL}} kills back to the start of the last word, and @kbd{C-x
Dave Love <fx@gnu.org>
parents:
diff changeset
49 @key{DEL}} kills back to the start of the last sentence. @kbd{C-x
Dave Love <fx@gnu.org>
parents:
diff changeset
50 @key{DEL}} is particularly useful when you change your mind about the
Dave Love <fx@gnu.org>
parents:
diff changeset
51 phrasing of the text you are writing. @kbd{M-@key{DEL}} and @kbd{C-x
Dave Love <fx@gnu.org>
parents:
diff changeset
52 @key{DEL}} save the killed text for @kbd{C-y} and @kbd{M-y} to
Dave Love <fx@gnu.org>
parents:
diff changeset
53 retrieve. @xref{Yanking}.@refill
Dave Love <fx@gnu.org>
parents:
diff changeset
54
Dave Love <fx@gnu.org>
parents:
diff changeset
55 @kbd{M-@key{DEL}} is often useful even when you have typed only a few
Dave Love <fx@gnu.org>
parents:
diff changeset
56 characters wrong, if you know you are confused in your typing and aren't
Dave Love <fx@gnu.org>
parents:
diff changeset
57 sure exactly what you typed. At such a time, you cannot correct with
Dave Love <fx@gnu.org>
parents:
diff changeset
58 @key{DEL} except by looking at the screen to see what you did. Often it
Dave Love <fx@gnu.org>
parents:
diff changeset
59 requires less thought to kill the whole word and start again.
Dave Love <fx@gnu.org>
parents:
diff changeset
60
Dave Love <fx@gnu.org>
parents:
diff changeset
61 @node Transpose
Dave Love <fx@gnu.org>
parents:
diff changeset
62 @section Transposing Text
Dave Love <fx@gnu.org>
parents:
diff changeset
63
Dave Love <fx@gnu.org>
parents:
diff changeset
64 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
65 @item C-t
Dave Love <fx@gnu.org>
parents:
diff changeset
66 Transpose two characters (@code{transpose-chars}).
Dave Love <fx@gnu.org>
parents:
diff changeset
67 @item M-t
Dave Love <fx@gnu.org>
parents:
diff changeset
68 Transpose two words (@code{transpose-words}).
Dave Love <fx@gnu.org>
parents:
diff changeset
69 @item C-M-t
Dave Love <fx@gnu.org>
parents:
diff changeset
70 Transpose two balanced expressions (@code{transpose-sexps}).
Dave Love <fx@gnu.org>
parents:
diff changeset
71 @item C-x C-t
Dave Love <fx@gnu.org>
parents:
diff changeset
72 Transpose two lines (@code{transpose-lines}).
Dave Love <fx@gnu.org>
parents:
diff changeset
73 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
74
Dave Love <fx@gnu.org>
parents:
diff changeset
75 @kindex C-t
Dave Love <fx@gnu.org>
parents:
diff changeset
76 @findex transpose-chars
Dave Love <fx@gnu.org>
parents:
diff changeset
77 The common error of transposing two characters can be fixed, when they
Dave Love <fx@gnu.org>
parents:
diff changeset
78 are adjacent, with the @kbd{C-t} command (@code{transpose-chars}). Normally,
Dave Love <fx@gnu.org>
parents:
diff changeset
79 @kbd{C-t} transposes the two characters on either side of point. When
Dave Love <fx@gnu.org>
parents:
diff changeset
80 given at the end of a line, rather than transposing the last character of
Dave Love <fx@gnu.org>
parents:
diff changeset
81 the line with the newline, which would be useless, @kbd{C-t} transposes the
Dave Love <fx@gnu.org>
parents:
diff changeset
82 last two characters on the line. So, if you catch your transposition error
Dave Love <fx@gnu.org>
parents:
diff changeset
83 right away, you can fix it with just a @kbd{C-t}. If you don't catch it so
38954
5c282c7df1cf Minor clarifications.
Richard M. Stallman <rms@gnu.org>
parents: 38745
diff changeset
84 fast, you must move the cursor back between the two transposed
5c282c7df1cf Minor clarifications.
Richard M. Stallman <rms@gnu.org>
parents: 38745
diff changeset
85 characters before you type @kbd{C-t}. If you transposed a space with
5c282c7df1cf Minor clarifications.
Richard M. Stallman <rms@gnu.org>
parents: 38745
diff changeset
86 the last character of the word before it, the word motion commands are
5c282c7df1cf Minor clarifications.
Richard M. Stallman <rms@gnu.org>
parents: 38745
diff changeset
87 a good way of getting there. Otherwise, a reverse search (@kbd{C-r})
5c282c7df1cf Minor clarifications.
Richard M. Stallman <rms@gnu.org>
parents: 38745
diff changeset
88 is often the best way. @xref{Search}.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
89
Dave Love <fx@gnu.org>
parents:
diff changeset
90 @kindex C-x C-t
Dave Love <fx@gnu.org>
parents:
diff changeset
91 @findex transpose-lines
Dave Love <fx@gnu.org>
parents:
diff changeset
92 @kindex M-t
Dave Love <fx@gnu.org>
parents:
diff changeset
93 @findex transpose-words
36263
11db0318031d Remove redundant index entries.
Eli Zaretskii <eliz@gnu.org>
parents: 31059
diff changeset
94 @c Don't index C-M-t and transpose-sexps here, they are indexed in
11db0318031d Remove redundant index entries.
Eli Zaretskii <eliz@gnu.org>
parents: 31059
diff changeset
95 @c programs.texi, in the "List Commands" node.
11db0318031d Remove redundant index entries.
Eli Zaretskii <eliz@gnu.org>
parents: 31059
diff changeset
96 @c @kindex C-M-t
11db0318031d Remove redundant index entries.
Eli Zaretskii <eliz@gnu.org>
parents: 31059
diff changeset
97 @c @findex transpose-sexps
37120
f863383a5c3e Minor change.
Richard M. Stallman <rms@gnu.org>
parents: 36314
diff changeset
98 @kbd{M-t} transposes the word before point with the word after point
f863383a5c3e Minor change.
Richard M. Stallman <rms@gnu.org>
parents: 36314
diff changeset
99 (@code{transpose-words}). It moves point forward over a word,
f863383a5c3e Minor change.
Richard M. Stallman <rms@gnu.org>
parents: 36314
diff changeset
100 dragging the word preceding or containing point forward as well. The
f863383a5c3e Minor change.
Richard M. Stallman <rms@gnu.org>
parents: 36314
diff changeset
101 punctuation characters between the words do not move. For example,
f863383a5c3e Minor change.
Richard M. Stallman <rms@gnu.org>
parents: 36314
diff changeset
102 @w{@samp{FOO, BAR}} transposes into @w{@samp{BAR, FOO}} rather than
f863383a5c3e Minor change.
Richard M. Stallman <rms@gnu.org>
parents: 36314
diff changeset
103 @samp{@w{BAR FOO,}}.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
104
38204
baa9ae31d281 Say "expression" instead of "sexp". Update xref, Sexps -> Expressions.
Richard M. Stallman <rms@gnu.org>
parents: 38024
diff changeset
105 @kbd{C-M-t} (@code{transpose-sexps}) is a similar command for
baa9ae31d281 Say "expression" instead of "sexp". Update xref, Sexps -> Expressions.
Richard M. Stallman <rms@gnu.org>
parents: 38024
diff changeset
106 transposing two expressions (@pxref{Expressions}), and @kbd{C-x C-t}
baa9ae31d281 Say "expression" instead of "sexp". Update xref, Sexps -> Expressions.
Richard M. Stallman <rms@gnu.org>
parents: 38024
diff changeset
107 (@code{transpose-lines}) exchanges lines. They work like @kbd{M-t}
38745
5464ee1ba8e2 Minor cleanups.
Richard M. Stallman <rms@gnu.org>
parents: 38204
diff changeset
108 except as regards what units of text they transpose.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
109
Dave Love <fx@gnu.org>
parents:
diff changeset
110 A numeric argument to a transpose command serves as a repeat count: it
38204
baa9ae31d281 Say "expression" instead of "sexp". Update xref, Sexps -> Expressions.
Richard M. Stallman <rms@gnu.org>
parents: 38024
diff changeset
111 tells the transpose command to move the character (word, expression, line)
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
112 before or containing point across several other characters (words,
38204
baa9ae31d281 Say "expression" instead of "sexp". Update xref, Sexps -> Expressions.
Richard M. Stallman <rms@gnu.org>
parents: 38024
diff changeset
113 expressions, lines). For example, @kbd{C-u 3 C-t} moves the character before
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
114 point forward across three other characters. It would change
Dave Love <fx@gnu.org>
parents:
diff changeset
115 @samp{f@point{}oobar} into @samp{oobf@point{}ar}. This is equivalent to
Dave Love <fx@gnu.org>
parents:
diff changeset
116 repeating @kbd{C-t} three times. @kbd{C-u - 4 M-t} moves the word
Dave Love <fx@gnu.org>
parents:
diff changeset
117 before point backward across four words. @kbd{C-u - C-M-t} would cancel
Dave Love <fx@gnu.org>
parents:
diff changeset
118 the effect of plain @kbd{C-M-t}.@refill
Dave Love <fx@gnu.org>
parents:
diff changeset
119
Dave Love <fx@gnu.org>
parents:
diff changeset
120 A numeric argument of zero is assigned a special meaning (because
Dave Love <fx@gnu.org>
parents:
diff changeset
121 otherwise a command with a repeat count of zero would do nothing): to
38204
baa9ae31d281 Say "expression" instead of "sexp". Update xref, Sexps -> Expressions.
Richard M. Stallman <rms@gnu.org>
parents: 38024
diff changeset
122 transpose the character (word, expression, line) ending after point
baa9ae31d281 Say "expression" instead of "sexp". Update xref, Sexps -> Expressions.
Richard M. Stallman <rms@gnu.org>
parents: 38024
diff changeset
123 with the one ending after the mark.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
124
Dave Love <fx@gnu.org>
parents:
diff changeset
125 @node Fixing Case
Dave Love <fx@gnu.org>
parents:
diff changeset
126 @section Case Conversion
Dave Love <fx@gnu.org>
parents:
diff changeset
127
Dave Love <fx@gnu.org>
parents:
diff changeset
128 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
129 @item M-- M-l
Dave Love <fx@gnu.org>
parents:
diff changeset
130 Convert last word to lower case. Note @kbd{Meta--} is Meta-minus.
Dave Love <fx@gnu.org>
parents:
diff changeset
131 @item M-- M-u
Dave Love <fx@gnu.org>
parents:
diff changeset
132 Convert last word to all upper case.
Dave Love <fx@gnu.org>
parents:
diff changeset
133 @item M-- M-c
Dave Love <fx@gnu.org>
parents:
diff changeset
134 Convert last word to lower case with capital initial.
Dave Love <fx@gnu.org>
parents:
diff changeset
135 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
136
Dave Love <fx@gnu.org>
parents:
diff changeset
137 @kindex M-@t{-} M-l
Dave Love <fx@gnu.org>
parents:
diff changeset
138 @kindex M-@t{-} M-u
Dave Love <fx@gnu.org>
parents:
diff changeset
139 @kindex M-@t{-} M-c
Dave Love <fx@gnu.org>
parents:
diff changeset
140 A very common error is to type words in the wrong case. Because of this,
Dave Love <fx@gnu.org>
parents:
diff changeset
141 the word case-conversion commands @kbd{M-l}, @kbd{M-u} and @kbd{M-c} have a
Dave Love <fx@gnu.org>
parents:
diff changeset
142 special feature when used with a negative argument: they do not move the
Dave Love <fx@gnu.org>
parents:
diff changeset
143 cursor. As soon as you see you have mistyped the last word, you can simply
Dave Love <fx@gnu.org>
parents:
diff changeset
144 case-convert it and go on typing. @xref{Case}.@refill
Dave Love <fx@gnu.org>
parents:
diff changeset
145
Dave Love <fx@gnu.org>
parents:
diff changeset
146 @node Spelling
Dave Love <fx@gnu.org>
parents:
diff changeset
147 @section Checking and Correcting Spelling
Dave Love <fx@gnu.org>
parents:
diff changeset
148 @cindex spelling, checking and correcting
Dave Love <fx@gnu.org>
parents:
diff changeset
149 @cindex checking spelling
Dave Love <fx@gnu.org>
parents:
diff changeset
150 @cindex correcting spelling
Dave Love <fx@gnu.org>
parents:
diff changeset
151
Dave Love <fx@gnu.org>
parents:
diff changeset
152 This section describes the commands to check the spelling of a single
Dave Love <fx@gnu.org>
parents:
diff changeset
153 word or of a portion of a buffer. These commands work with the spelling
Dave Love <fx@gnu.org>
parents:
diff changeset
154 checker program Ispell, which is not part of Emacs.
Dave Love <fx@gnu.org>
parents:
diff changeset
155 @ifinfo
54975
cb7efcd51e78 (Spelling): Remove file extension from ispell xref.
Juri Linkov <juri@jurta.org>
parents: 52401
diff changeset
156 @xref{Top, Ispell, Overview ispell, ispell, The Ispell Manual}.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
157 @end ifinfo
Dave Love <fx@gnu.org>
parents:
diff changeset
158
Dave Love <fx@gnu.org>
parents:
diff changeset
159 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
160 @item M-x flyspell-mode
Dave Love <fx@gnu.org>
parents:
diff changeset
161 Enable Flyspell mode, which highlights all misspelled words.
59887
709df438e565 (Spelling): Fix typo.
Richard M. Stallman <rms@gnu.org>
parents: 56652
diff changeset
162 @item M-x flyspell-prog-mode
47501
c0b4dc1b7414 Describe Flyspell Prog mode.
Richard M. Stallman <rms@gnu.org>
parents: 46911
diff changeset
163 Enable Flyspell mode for comments and strings only.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
164 @item M-$
Dave Love <fx@gnu.org>
parents:
diff changeset
165 Check and correct spelling of the word at point (@code{ispell-word}).
Dave Love <fx@gnu.org>
parents:
diff changeset
166 @item M-@key{TAB}
60242
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
167 @itemx @key{ESC} @key{TAB}
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
168 Complete the word before point based on the spelling dictionary
Dave Love <fx@gnu.org>
parents:
diff changeset
169 (@code{ispell-complete-word}).
31059
b65102a3c19d Document the new operation of the `ispell' command.
Eli Zaretskii <eliz@gnu.org>
parents: 25829
diff changeset
170 @item M-x ispell
b65102a3c19d Document the new operation of the `ispell' command.
Eli Zaretskii <eliz@gnu.org>
parents: 25829
diff changeset
171 Spell-check the active region or the current buffer.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
172 @item M-x ispell-buffer
Dave Love <fx@gnu.org>
parents:
diff changeset
173 Check and correct spelling of each word in the buffer.
Dave Love <fx@gnu.org>
parents:
diff changeset
174 @item M-x ispell-region
Dave Love <fx@gnu.org>
parents:
diff changeset
175 Check and correct spelling of each word in the region.
Dave Love <fx@gnu.org>
parents:
diff changeset
176 @item M-x ispell-message
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47501
diff changeset
177 Check and correct spelling of each word in a draft mail message,
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
178 excluding cited material.
Dave Love <fx@gnu.org>
parents:
diff changeset
179 @item M-x ispell-change-dictionary @key{RET} @var{dict} @key{RET}
Dave Love <fx@gnu.org>
parents:
diff changeset
180 Restart the Ispell process, using @var{dict} as the dictionary.
Dave Love <fx@gnu.org>
parents:
diff changeset
181 @item M-x ispell-kill-ispell
Dave Love <fx@gnu.org>
parents:
diff changeset
182 Kill the Ispell subprocess.
Dave Love <fx@gnu.org>
parents:
diff changeset
183 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
184
Dave Love <fx@gnu.org>
parents:
diff changeset
185 @cindex Flyspell mode
Dave Love <fx@gnu.org>
parents:
diff changeset
186 @findex flyspell-mode
Dave Love <fx@gnu.org>
parents:
diff changeset
187 Flyspell mode is a fully-automatic way to check spelling as you edit
Dave Love <fx@gnu.org>
parents:
diff changeset
188 in Emacs. It operates by checking words as you change or insert them.
Dave Love <fx@gnu.org>
parents:
diff changeset
189 When it finds a word that it does not recognize, it highlights that
Dave Love <fx@gnu.org>
parents:
diff changeset
190 word. This does not interfere with your editing, but when you see the
Dave Love <fx@gnu.org>
parents:
diff changeset
191 highlighted word, you can move to it and fix it. Type @kbd{M-x
Dave Love <fx@gnu.org>
parents:
diff changeset
192 flyspell-mode} to enable or disable this mode in the current buffer.
Dave Love <fx@gnu.org>
parents:
diff changeset
193
Dave Love <fx@gnu.org>
parents:
diff changeset
194 When Flyspell mode highlights a word as misspelled, you can click on
Dave Love <fx@gnu.org>
parents:
diff changeset
195 it with @kbd{Mouse-2} to display a menu of possible corrections and
Dave Love <fx@gnu.org>
parents:
diff changeset
196 actions. You can also correct the word by editing it manually in any
Dave Love <fx@gnu.org>
parents:
diff changeset
197 way you like.
Dave Love <fx@gnu.org>
parents:
diff changeset
198
47501
c0b4dc1b7414 Describe Flyspell Prog mode.
Richard M. Stallman <rms@gnu.org>
parents: 46911
diff changeset
199 @findex flyspell-prog-mode
c0b4dc1b7414 Describe Flyspell Prog mode.
Richard M. Stallman <rms@gnu.org>
parents: 46911
diff changeset
200 Flyspell Prog mode works just like ordinary Flyspell mode, except that
c0b4dc1b7414 Describe Flyspell Prog mode.
Richard M. Stallman <rms@gnu.org>
parents: 46911
diff changeset
201 it only checks words in comments and string constants. This feature
c0b4dc1b7414 Describe Flyspell Prog mode.
Richard M. Stallman <rms@gnu.org>
parents: 46911
diff changeset
202 is useful for editing programs. Type @kbd{M-x flyspell-prog-mode} to
c0b4dc1b7414 Describe Flyspell Prog mode.
Richard M. Stallman <rms@gnu.org>
parents: 46911
diff changeset
203 enable or disable this mode in the current buffer.
c0b4dc1b7414 Describe Flyspell Prog mode.
Richard M. Stallman <rms@gnu.org>
parents: 46911
diff changeset
204
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
205 The other Emacs spell-checking features check or look up words when
Dave Love <fx@gnu.org>
parents:
diff changeset
206 you give an explicit command to do so. Checking all or part of the
Dave Love <fx@gnu.org>
parents:
diff changeset
207 buffer is useful when you have text that was written outside of this
Dave Love <fx@gnu.org>
parents:
diff changeset
208 Emacs session and might contain any number of misspellings.
Dave Love <fx@gnu.org>
parents:
diff changeset
209
Dave Love <fx@gnu.org>
parents:
diff changeset
210 @kindex M-$
Dave Love <fx@gnu.org>
parents:
diff changeset
211 @findex ispell-word
Dave Love <fx@gnu.org>
parents:
diff changeset
212 To check the spelling of the word around or next to point, and
Dave Love <fx@gnu.org>
parents:
diff changeset
213 optionally correct it as well, use the command @kbd{M-$}
Dave Love <fx@gnu.org>
parents:
diff changeset
214 (@code{ispell-word}). If the word is not correct, the command offers
Dave Love <fx@gnu.org>
parents:
diff changeset
215 you various alternatives for what to do about it.
Dave Love <fx@gnu.org>
parents:
diff changeset
216
Dave Love <fx@gnu.org>
parents:
diff changeset
217 @findex ispell-buffer
Dave Love <fx@gnu.org>
parents:
diff changeset
218 @findex ispell-region
Dave Love <fx@gnu.org>
parents:
diff changeset
219 To check the entire current buffer, use @kbd{M-x ispell-buffer}. Use
Dave Love <fx@gnu.org>
parents:
diff changeset
220 @kbd{M-x ispell-region} to check just the current region. To check
Dave Love <fx@gnu.org>
parents:
diff changeset
221 spelling in an email message you are writing, use @kbd{M-x
38954
5c282c7df1cf Minor clarifications.
Richard M. Stallman <rms@gnu.org>
parents: 38745
diff changeset
222 ispell-message}; that command checks the whole buffer, except for
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
223 material that is indented or appears to be cited from other messages.
Dave Love <fx@gnu.org>
parents:
diff changeset
224
31059
b65102a3c19d Document the new operation of the `ispell' command.
Eli Zaretskii <eliz@gnu.org>
parents: 25829
diff changeset
225 @findex ispell
b65102a3c19d Document the new operation of the `ispell' command.
Eli Zaretskii <eliz@gnu.org>
parents: 25829
diff changeset
226 @cindex spell-checking the active region
b65102a3c19d Document the new operation of the `ispell' command.
Eli Zaretskii <eliz@gnu.org>
parents: 25829
diff changeset
227 The @kbd{M-x ispell} command spell-checks the active region if the
b65102a3c19d Document the new operation of the `ispell' command.
Eli Zaretskii <eliz@gnu.org>
parents: 25829
diff changeset
228 Transient Mark mode is on (@pxref{Transient Mark}), otherwise it
b65102a3c19d Document the new operation of the `ispell' command.
Eli Zaretskii <eliz@gnu.org>
parents: 25829
diff changeset
229 spell-checks the current buffer.
b65102a3c19d Document the new operation of the `ispell' command.
Eli Zaretskii <eliz@gnu.org>
parents: 25829
diff changeset
230
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
231 Each time these commands encounter an incorrect word, they ask you
Dave Love <fx@gnu.org>
parents:
diff changeset
232 what to do. They display a list of alternatives, usually including
Dave Love <fx@gnu.org>
parents:
diff changeset
233 several ``near-misses''---words that are close to the word being
38954
5c282c7df1cf Minor clarifications.
Richard M. Stallman <rms@gnu.org>
parents: 38745
diff changeset
234 checked. Then you must type a single-character response. Here are
5c282c7df1cf Minor clarifications.
Richard M. Stallman <rms@gnu.org>
parents: 38745
diff changeset
235 the valid responses:
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
236
Dave Love <fx@gnu.org>
parents:
diff changeset
237 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
238 @item @key{SPC}
Dave Love <fx@gnu.org>
parents:
diff changeset
239 Skip this word---continue to consider it incorrect, but don't change it
Dave Love <fx@gnu.org>
parents:
diff changeset
240 here.
Dave Love <fx@gnu.org>
parents:
diff changeset
241
Dave Love <fx@gnu.org>
parents:
diff changeset
242 @item r @var{new} @key{RET}
60242
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
243 Replace the word (just this time) with @var{new}. (The replacement
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
244 string will be rescanned for more spelling errors.)
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
245
Dave Love <fx@gnu.org>
parents:
diff changeset
246 @item R @var{new} @key{RET}
Dave Love <fx@gnu.org>
parents:
diff changeset
247 Replace the word with @var{new}, and do a @code{query-replace} so you
60242
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
248 can replace it elsewhere in the buffer if you wish. (The replacements
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
249 will be rescanned for more spelling errors.)
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
250
Dave Love <fx@gnu.org>
parents:
diff changeset
251 @item @var{digit}
Dave Love <fx@gnu.org>
parents:
diff changeset
252 Replace the word (just this time) with one of the displayed
Dave Love <fx@gnu.org>
parents:
diff changeset
253 near-misses. Each near-miss is listed with a digit; type that digit to
Dave Love <fx@gnu.org>
parents:
diff changeset
254 select it.
Dave Love <fx@gnu.org>
parents:
diff changeset
255
Dave Love <fx@gnu.org>
parents:
diff changeset
256 @item a
Dave Love <fx@gnu.org>
parents:
diff changeset
257 Accept the incorrect word---treat it as correct, but only in this
Dave Love <fx@gnu.org>
parents:
diff changeset
258 editing session.
Dave Love <fx@gnu.org>
parents:
diff changeset
259
Dave Love <fx@gnu.org>
parents:
diff changeset
260 @item A
Dave Love <fx@gnu.org>
parents:
diff changeset
261 Accept the incorrect word---treat it as correct, but only in this
Dave Love <fx@gnu.org>
parents:
diff changeset
262 editing session and for this buffer.
Dave Love <fx@gnu.org>
parents:
diff changeset
263
Dave Love <fx@gnu.org>
parents:
diff changeset
264 @item i
Dave Love <fx@gnu.org>
parents:
diff changeset
265 Insert this word in your private dictionary file so that Ispell will
38954
5c282c7df1cf Minor clarifications.
Richard M. Stallman <rms@gnu.org>
parents: 38745
diff changeset
266 consider it correct from now on, even in future sessions.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
267
Dave Love <fx@gnu.org>
parents:
diff changeset
268 @item u
38024
939c227505cd Advise TeX about hyphenation of "dictionary".
Eli Zaretskii <eliz@gnu.org>
parents: 37120
diff changeset
269 Insert the lower-case version of this word in your private dic@-tion@-ary
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
270 file.
Dave Love <fx@gnu.org>
parents:
diff changeset
271
Dave Love <fx@gnu.org>
parents:
diff changeset
272 @item m
Dave Love <fx@gnu.org>
parents:
diff changeset
273 Like @kbd{i}, but you can also specify dictionary completion
Dave Love <fx@gnu.org>
parents:
diff changeset
274 information.
Dave Love <fx@gnu.org>
parents:
diff changeset
275
Dave Love <fx@gnu.org>
parents:
diff changeset
276 @item l @var{word} @key{RET}
Dave Love <fx@gnu.org>
parents:
diff changeset
277 Look in the dictionary for words that match @var{word}. These words
38954
5c282c7df1cf Minor clarifications.
Richard M. Stallman <rms@gnu.org>
parents: 38745
diff changeset
278 become the new list of ``near-misses''; you can select one of them as
5c282c7df1cf Minor clarifications.
Richard M. Stallman <rms@gnu.org>
parents: 38745
diff changeset
279 the replacement by typing a digit. You can use @samp{*} in @var{word} as a
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
280 wildcard.
Dave Love <fx@gnu.org>
parents:
diff changeset
281
Dave Love <fx@gnu.org>
parents:
diff changeset
282 @item C-g
60242
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
283 Quit interactive spell checking, leaving point at the word that was
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
284 being checked. You can restart checking again afterward with @kbd{C-u
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
285 M-$}.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
286
Dave Love <fx@gnu.org>
parents:
diff changeset
287 @item X
Dave Love <fx@gnu.org>
parents:
diff changeset
288 Same as @kbd{C-g}.
Dave Love <fx@gnu.org>
parents:
diff changeset
289
Dave Love <fx@gnu.org>
parents:
diff changeset
290 @item x
Dave Love <fx@gnu.org>
parents:
diff changeset
291 Quit interactive spell checking and move point back to where it was
Dave Love <fx@gnu.org>
parents:
diff changeset
292 when you started spell checking.
Dave Love <fx@gnu.org>
parents:
diff changeset
293
Dave Love <fx@gnu.org>
parents:
diff changeset
294 @item q
Dave Love <fx@gnu.org>
parents:
diff changeset
295 Quit interactive spell checking and kill the Ispell subprocess.
Dave Love <fx@gnu.org>
parents:
diff changeset
296
Dave Love <fx@gnu.org>
parents:
diff changeset
297 @item C-l
Dave Love <fx@gnu.org>
parents:
diff changeset
298 Refresh the screen.
Dave Love <fx@gnu.org>
parents:
diff changeset
299
Dave Love <fx@gnu.org>
parents:
diff changeset
300 @item C-z
Dave Love <fx@gnu.org>
parents:
diff changeset
301 This key has its normal command meaning (suspend Emacs or iconify this
Dave Love <fx@gnu.org>
parents:
diff changeset
302 frame).
60242
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
303
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
304 @item ?
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
305 Show the list of options.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
306 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
307
Dave Love <fx@gnu.org>
parents:
diff changeset
308 @findex ispell-complete-word
Dave Love <fx@gnu.org>
parents:
diff changeset
309 The command @code{ispell-complete-word}, which is bound to the key
Dave Love <fx@gnu.org>
parents:
diff changeset
310 @kbd{M-@key{TAB}} in Text mode and related modes, shows a list of
Dave Love <fx@gnu.org>
parents:
diff changeset
311 completions based on spelling correction. Insert the beginning of a
60105
af5eff7d6e41 (Spelling): Mention ESC TAB as alt. for M-TAB.
Richard M. Stallman <rms@gnu.org>
parents: 59887
diff changeset
312 word, and then type @kbd{M-@key{TAB}}; the command displays a
af5eff7d6e41 (Spelling): Mention ESC TAB as alt. for M-TAB.
Richard M. Stallman <rms@gnu.org>
parents: 59887
diff changeset
313 completion list window. (If your window manager intercepts
60427
8e852ce0e115 (Spelling): C-M-i like M-TAB.
Richard M. Stallman <rms@gnu.org>
parents: 60242
diff changeset
314 @kbd{M-@key{TAB}}, type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i}.) To
8e852ce0e115 (Spelling): C-M-i like M-TAB.
Richard M. Stallman <rms@gnu.org>
parents: 60242
diff changeset
315 choose one of the completions listed, click @kbd{Mouse-2} or
8e852ce0e115 (Spelling): C-M-i like M-TAB.
Richard M. Stallman <rms@gnu.org>
parents: 60242
diff changeset
316 @kbd{Mouse-1} fast on it, or move the cursor there in the completions
8e852ce0e115 (Spelling): C-M-i like M-TAB.
Richard M. Stallman <rms@gnu.org>
parents: 60242
diff changeset
317 window and type @key{RET}. @xref{Text Mode}.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
318
Dave Love <fx@gnu.org>
parents:
diff changeset
319 @ignore
Dave Love <fx@gnu.org>
parents:
diff changeset
320 @findex reload-ispell
Dave Love <fx@gnu.org>
parents:
diff changeset
321 The first time you use any of the spell checking commands, it starts
Dave Love <fx@gnu.org>
parents:
diff changeset
322 an Ispell subprocess. The first thing the subprocess does is read your
Dave Love <fx@gnu.org>
parents:
diff changeset
323 private dictionary, which defaults to the file @file{~/ispell.words}.
Dave Love <fx@gnu.org>
parents:
diff changeset
324 Words that you ``insert'' with the @kbd{i} command are added to that
Dave Love <fx@gnu.org>
parents:
diff changeset
325 file, but not right away---only at the end of the interactive
Dave Love <fx@gnu.org>
parents:
diff changeset
326 replacement procedure. Use the @kbd{M-x reload-ispell} command to
Dave Love <fx@gnu.org>
parents:
diff changeset
327 reload your private dictionary if you edit the file outside of Ispell.
Dave Love <fx@gnu.org>
parents:
diff changeset
328 @end ignore
Dave Love <fx@gnu.org>
parents:
diff changeset
329
Dave Love <fx@gnu.org>
parents:
diff changeset
330 @cindex @code{ispell} program
Dave Love <fx@gnu.org>
parents:
diff changeset
331 @findex ispell-kill-ispell
Dave Love <fx@gnu.org>
parents:
diff changeset
332 Once started, the Ispell subprocess continues to run (waiting for
Dave Love <fx@gnu.org>
parents:
diff changeset
333 something to do), so that subsequent spell checking commands complete
Dave Love <fx@gnu.org>
parents:
diff changeset
334 more quickly. If you want to get rid of the Ispell process, use
Dave Love <fx@gnu.org>
parents:
diff changeset
335 @kbd{M-x ispell-kill-ispell}. This is not usually necessary, since the
Dave Love <fx@gnu.org>
parents:
diff changeset
336 process uses no time except when you do spelling correction.
Dave Love <fx@gnu.org>
parents:
diff changeset
337
Dave Love <fx@gnu.org>
parents:
diff changeset
338 @vindex ispell-dictionary
46911
ed736029584b Clarify ispell use of multiple dictionaries.
Richard M. Stallman <rms@gnu.org>
parents: 45636
diff changeset
339 Ispell uses two dictionaries together for spell checking: the
ed736029584b Clarify ispell use of multiple dictionaries.
Richard M. Stallman <rms@gnu.org>
parents: 45636
diff changeset
340 standard dictionary and your private dictionary. The variable
ed736029584b Clarify ispell use of multiple dictionaries.
Richard M. Stallman <rms@gnu.org>
parents: 45636
diff changeset
341 @code{ispell-dictionary} specifies the file name to use for the
ed736029584b Clarify ispell use of multiple dictionaries.
Richard M. Stallman <rms@gnu.org>
parents: 45636
diff changeset
342 standard dictionary; a value of @code{nil} selects the default
ed736029584b Clarify ispell use of multiple dictionaries.
Richard M. Stallman <rms@gnu.org>
parents: 45636
diff changeset
343 dictionary. The command @kbd{M-x ispell-change-dictionary} sets this
ed736029584b Clarify ispell use of multiple dictionaries.
Richard M. Stallman <rms@gnu.org>
parents: 45636
diff changeset
344 variable and then restarts the Ispell subprocess, so that it will use
ed736029584b Clarify ispell use of multiple dictionaries.
Richard M. Stallman <rms@gnu.org>
parents: 45636
diff changeset
345 a different standard dictionary.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
346
45636
58de4f15ebf6 (Spelling): Document ispell-complete-word-dict.
Eli Zaretskii <eliz@gnu.org>
parents: 38954
diff changeset
347 @vindex ispell-complete-word-dict
46911
ed736029584b Clarify ispell use of multiple dictionaries.
Richard M. Stallman <rms@gnu.org>
parents: 45636
diff changeset
348 Ispell uses a separate dictionary for word completion. The variable
ed736029584b Clarify ispell use of multiple dictionaries.
Richard M. Stallman <rms@gnu.org>
parents: 45636
diff changeset
349 @code{ispell-complete-word-dict} specifies the file name of this
ed736029584b Clarify ispell use of multiple dictionaries.
Richard M. Stallman <rms@gnu.org>
parents: 45636
diff changeset
350 dictionary. The completion dictionary must be different because it
56652
3c48a5084fb5 (Spelling): Fix typo.
Luc Teirlinck <teirllm@auburn.edu>
parents: 54975
diff changeset
351 cannot use root and affix information. For some languages
46911
ed736029584b Clarify ispell use of multiple dictionaries.
Richard M. Stallman <rms@gnu.org>
parents: 45636
diff changeset
352 there is a spell checking dictionary but no word completion
ed736029584b Clarify ispell use of multiple dictionaries.
Richard M. Stallman <rms@gnu.org>
parents: 45636
diff changeset
353 dictionary.
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 52241
diff changeset
354
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 52241
diff changeset
355 @ignore
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 52241
diff changeset
356 arch-tag: 3359a443-96ed-448f-9f05-c8111ba8eac0
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 52241
diff changeset
357 @end ignore