annotate man/fixit.texi @ 74405:8289a04178f1

*** empty log message ***
author Kim F. Storm <storm@cua.dk>
date Mon, 04 Dec 2006 12:26:35 +0000
parents 3b538a92087b
children 4ad431d8e164 a8190f7e546e
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.
64890
3723093a21fd Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 62691
diff changeset
2 @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2002, 2003,
68639
dc2d5a6655a3 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 68508
diff changeset
3 @c 2004, 2005, 2006 Free Software Foundation, Inc.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
4 @c See file emacs.texi for copying conditions.
52241
0b4e04022bd6 (Fixit): Update `Next' pointer.
Luc Teirlinck <teirllm@auburn.edu>
parents: 49600
diff changeset
5 @node Fixit, Keyboard Macros, Search, Top
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
6 @chapter Commands for Fixing Typos
Dave Love <fx@gnu.org>
parents:
diff changeset
7 @cindex typos, fixing
Dave Love <fx@gnu.org>
parents:
diff changeset
8 @cindex mistakes, correcting
Dave Love <fx@gnu.org>
parents:
diff changeset
9
Dave Love <fx@gnu.org>
parents:
diff changeset
10 In this chapter we describe the commands that are especially useful for
Dave Love <fx@gnu.org>
parents:
diff changeset
11 the times when you catch a mistake in your text just after you have made
Dave Love <fx@gnu.org>
parents:
diff changeset
12 it, or change your mind while composing text on the fly.
Dave Love <fx@gnu.org>
parents:
diff changeset
13
Dave Love <fx@gnu.org>
parents:
diff changeset
14 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
15 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
16 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
17 @code{query-replace}), or several consecutive self-inserting
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
18 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
19 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
20 available. @xref{Undo}, for more information.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
21
Dave Love <fx@gnu.org>
parents:
diff changeset
22 @menu
68508
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
23 * Undo:: The Undo commands.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
24 * Kill Errors:: Commands to kill a batch of recently entered text.
Dave Love <fx@gnu.org>
parents:
diff changeset
25 * Transpose:: Exchanging two characters, words, lines, lists...
Dave Love <fx@gnu.org>
parents:
diff changeset
26 * Fixing Case:: Correcting case of last word entered.
Dave Love <fx@gnu.org>
parents:
diff changeset
27 * Spelling:: Apply spelling checker to a word, or a whole file.
Dave Love <fx@gnu.org>
parents:
diff changeset
28 @end menu
Dave Love <fx@gnu.org>
parents:
diff changeset
29
68508
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
30 @node Undo
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
31 @section Undo
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
32 @cindex undo
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
33 @cindex changes, undoing
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
34
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
35 The @dfn{undo} commands undo recent changes in the buffer's text.
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
36 Each buffer records changes individually, and the undo command always
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
37 applies to the current buffer. You can undo all the changes in a
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
38 buffer for as far as back these records go. Usually each editing
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
39 command makes a separate entry in the undo records, but some commands
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
40 such as @code{query-replace} divide their changes into multiple
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
41 entries for flexibility in undoing. Meanwhile, self-inserting
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
42 characters are usually grouped to make undoing less tedious.
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
43
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
44 @table @kbd
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
45 @item C-x u
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
46 @itemx C-_
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
47 @itemx C-/
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
48 Undo one entry in the current buffer's undo records (@code{undo}).
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
49 @end table
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
50
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
51 @kindex C-x u
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
52 @kindex C-_
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
53 @kindex C-/
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
54 @findex undo
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
55 To begin to undo, type the command @kbd{C-x u} (or its aliases,
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
56 @kbd{C-_} or @kbd{C-/}). This undoes the most recent change in the
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
57 buffer, and moves point back to where it was before that change.
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
58
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
59 Consecutive repetitions of @kbd{C-x u} (or its aliases) undo earlier
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
60 and earlier changes in the current buffer, back to the limit of the
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
61 current buffer's undo records. If all the recorded changes have
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
62 already been undone, the undo command just signals an error.
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
63
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
64 If you notice that a buffer has been modified accidentally, the
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
65 easiest way to recover is to type @kbd{C-_} repeatedly until the stars
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
66 disappear from the front of the mode line. At this time, all the
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
67 modifications you made have been canceled. Whenever an undo command
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
68 makes the stars disappear from the mode line, it means that the buffer
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
69 contents are the same as they were when the file was last read in or
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
70 saved.
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
71
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
72 If you do not remember whether you changed the buffer deliberately,
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
73 type @kbd{C-_} once. When you see the last change you made undone, you
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
74 will see whether it was an intentional change. If it was an accident,
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
75 leave it undone. If it was deliberate, redo the change as described
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
76 below.
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
77
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
78 @findex undo-only
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
79 Any command other than an undo command breaks the sequence of undo
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
80 commands. Starting from that moment, the previous undo commands
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
81 become ordinary changes that you can undo. Thus, to redo changes you
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
82 have undone, type @kbd{C-f} or any other command that will harmlessly
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
83 break the sequence of undoing, then type undo commands again. On the
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
84 other hand, if you want to resume undoing, without redoing previous
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
85 undo commands, use @kbd{M-x undo-only}. This is like @code{undo}, but
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
86 will not redo changes you have just undone.
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
87
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
88 @cindex selective undo
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
89 @kindex C-u C-x u
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
90 Ordinary undo applies to all changes made in the current buffer. You
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
91 can also perform @dfn{selective undo}, limited to the region.
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
92
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
93 To do this, specify the region you want, then run the @code{undo}
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
94 command with a prefix argument (the value does not matter): @kbd{C-u
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
95 C-x u} or @kbd{C-u C-_}. This undoes the most recent change in the
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
96 region. To undo further changes in the same region, repeat the
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
97 @code{undo} command (no prefix argument is needed). In Transient Mark
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
98 mode (@pxref{Transient Mark}), any use of @code{undo} when there is an
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
99 active region performs selective undo; you do not need a prefix
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
100 argument.
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
101
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
102 Some specialized buffers do not make undo records. Buffers
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
103 whose names start with spaces never do; these buffers are used
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
104 internally by Emacs and its extensions to hold text that users don't
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
105 normally look at or edit.
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
106
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
107 @vindex undo-limit
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
108 @vindex undo-strong-limit
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
109 @vindex undo-outer-limit
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
110 @cindex undo limit
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
111 When the undo records for a buffer becomes too large, Emacs
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
112 discards the oldest undo records from time to time (during garbage
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
113 collection). You can specify how much undo records to keep by
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
114 setting three variables: @code{undo-limit}, @code{undo-strong-limit},
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
115 and @code{undo-outer-limit}. Their values are expressed in units of
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
116 bytes of space.
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
117
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
118 The variable @code{undo-limit} sets a soft limit: Emacs keeps undo
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
119 data for enough commands to reach this size, and perhaps exceed it,
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
120 but does not keep data for any earlier commands beyond that. Its
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
121 default value is 20000. The variable @code{undo-strong-limit} sets a
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
122 stricter limit: a previous command (not the most recent one) which
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
123 pushes the size past this amount is itself forgotten. The default
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
124 value of @code{undo-strong-limit} is 30000.
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
125
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
126 Regardless of the values of those variables, the most recent change
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
127 is never discarded unless it gets bigger than @code{undo-outer-limit}
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
128 (normally 3,000,000). At that point, Emacs discards the undo data and
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
129 warns you about it. This is the only situation in which you cannot
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
130 undo the last command. If this happens, you can increase the value of
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
131 @code{undo-outer-limit} to make it even less likely to happen in the
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
132 future. But if you didn't expect the command to create such large
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
133 undo data, then it is probably a bug and you should report it.
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
134 @xref{Bugs,, Reporting Bugs}.
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
135
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
136 The reason the @code{undo} command has three key bindings, @kbd{C-x
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
137 u}, @kbd{C-_} and @kbd{C-/}, is that it is worthy of a
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
138 single-character key, but @kbd{C-x u} is more straightforward for
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
139 beginners to remember and type. Meanwhile, @kbd{C--} on a text-only
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
140 terminal is really @kbd{C-_}, which makes it a natural and easily
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
141 typed binding for undoing.
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
142
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
143 @node Kill Errors
Dave Love <fx@gnu.org>
parents:
diff changeset
144 @section Killing Your Mistakes
Dave Love <fx@gnu.org>
parents:
diff changeset
145
Dave Love <fx@gnu.org>
parents:
diff changeset
146 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
147 @item @key{DEL}
Dave Love <fx@gnu.org>
parents:
diff changeset
148 Delete last character (@code{delete-backward-char}).
Dave Love <fx@gnu.org>
parents:
diff changeset
149 @item M-@key{DEL}
Dave Love <fx@gnu.org>
parents:
diff changeset
150 Kill last word (@code{backward-kill-word}).
Dave Love <fx@gnu.org>
parents:
diff changeset
151 @item C-x @key{DEL}
Dave Love <fx@gnu.org>
parents:
diff changeset
152 Kill to beginning of sentence (@code{backward-kill-sentence}).
Dave Love <fx@gnu.org>
parents:
diff changeset
153 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
154
Dave Love <fx@gnu.org>
parents:
diff changeset
155 The @key{DEL} character (@code{delete-backward-char}) is the most
Dave Love <fx@gnu.org>
parents:
diff changeset
156 important correction command. It deletes the character before point.
Dave Love <fx@gnu.org>
parents:
diff changeset
157 When @key{DEL} follows a self-inserting character command, you can think
68508
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
158 of it as canceling that command. However, avoid the confusion of thinking
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
159 of @key{DEL} as a general way to cancel a command!
Dave Love <fx@gnu.org>
parents:
diff changeset
160
Dave Love <fx@gnu.org>
parents:
diff changeset
161 When your mistake is longer than a couple of characters, it might be
Dave Love <fx@gnu.org>
parents:
diff changeset
162 more convenient to use @kbd{M-@key{DEL}} or @kbd{C-x @key{DEL}}.
Dave Love <fx@gnu.org>
parents:
diff changeset
163 @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
164 @key{DEL}} kills back to the start of the last sentence. @kbd{C-x
Dave Love <fx@gnu.org>
parents:
diff changeset
165 @key{DEL}} is particularly useful when you change your mind about the
Dave Love <fx@gnu.org>
parents:
diff changeset
166 phrasing of the text you are writing. @kbd{M-@key{DEL}} and @kbd{C-x
Dave Love <fx@gnu.org>
parents:
diff changeset
167 @key{DEL}} save the killed text for @kbd{C-y} and @kbd{M-y} to
Dave Love <fx@gnu.org>
parents:
diff changeset
168 retrieve. @xref{Yanking}.@refill
Dave Love <fx@gnu.org>
parents:
diff changeset
169
Dave Love <fx@gnu.org>
parents:
diff changeset
170 @kbd{M-@key{DEL}} is often useful even when you have typed only a few
Dave Love <fx@gnu.org>
parents:
diff changeset
171 characters wrong, if you know you are confused in your typing and aren't
Dave Love <fx@gnu.org>
parents:
diff changeset
172 sure exactly what you typed. At such a time, you cannot correct with
Dave Love <fx@gnu.org>
parents:
diff changeset
173 @key{DEL} except by looking at the screen to see what you did. Often it
Dave Love <fx@gnu.org>
parents:
diff changeset
174 requires less thought to kill the whole word and start again.
Dave Love <fx@gnu.org>
parents:
diff changeset
175
Dave Love <fx@gnu.org>
parents:
diff changeset
176 @node Transpose
Dave Love <fx@gnu.org>
parents:
diff changeset
177 @section Transposing Text
Dave Love <fx@gnu.org>
parents:
diff changeset
178
Dave Love <fx@gnu.org>
parents:
diff changeset
179 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
180 @item C-t
Dave Love <fx@gnu.org>
parents:
diff changeset
181 Transpose two characters (@code{transpose-chars}).
Dave Love <fx@gnu.org>
parents:
diff changeset
182 @item M-t
Dave Love <fx@gnu.org>
parents:
diff changeset
183 Transpose two words (@code{transpose-words}).
Dave Love <fx@gnu.org>
parents:
diff changeset
184 @item C-M-t
Dave Love <fx@gnu.org>
parents:
diff changeset
185 Transpose two balanced expressions (@code{transpose-sexps}).
Dave Love <fx@gnu.org>
parents:
diff changeset
186 @item C-x C-t
Dave Love <fx@gnu.org>
parents:
diff changeset
187 Transpose two lines (@code{transpose-lines}).
Dave Love <fx@gnu.org>
parents:
diff changeset
188 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
189
Dave Love <fx@gnu.org>
parents:
diff changeset
190 @kindex C-t
Dave Love <fx@gnu.org>
parents:
diff changeset
191 @findex transpose-chars
Dave Love <fx@gnu.org>
parents:
diff changeset
192 The common error of transposing two characters can be fixed, when they
Dave Love <fx@gnu.org>
parents:
diff changeset
193 are adjacent, with the @kbd{C-t} command (@code{transpose-chars}). Normally,
Dave Love <fx@gnu.org>
parents:
diff changeset
194 @kbd{C-t} transposes the two characters on either side of point. When
Dave Love <fx@gnu.org>
parents:
diff changeset
195 given at the end of a line, rather than transposing the last character of
Dave Love <fx@gnu.org>
parents:
diff changeset
196 the line with the newline, which would be useless, @kbd{C-t} transposes the
Dave Love <fx@gnu.org>
parents:
diff changeset
197 last two characters on the line. So, if you catch your transposition error
Dave Love <fx@gnu.org>
parents:
diff changeset
198 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
199 fast, you must move the cursor back between the two transposed
5c282c7df1cf Minor clarifications.
Richard M. Stallman <rms@gnu.org>
parents: 38745
diff changeset
200 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
201 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
202 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
203 is often the best way. @xref{Search}.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
204
Dave Love <fx@gnu.org>
parents:
diff changeset
205 @kindex C-x C-t
Dave Love <fx@gnu.org>
parents:
diff changeset
206 @findex transpose-lines
Dave Love <fx@gnu.org>
parents:
diff changeset
207 @kindex M-t
Dave Love <fx@gnu.org>
parents:
diff changeset
208 @findex transpose-words
36263
11db0318031d Remove redundant index entries.
Eli Zaretskii <eliz@gnu.org>
parents: 31059
diff changeset
209 @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
210 @c programs.texi, in the "List Commands" node.
11db0318031d Remove redundant index entries.
Eli Zaretskii <eliz@gnu.org>
parents: 31059
diff changeset
211 @c @kindex C-M-t
11db0318031d Remove redundant index entries.
Eli Zaretskii <eliz@gnu.org>
parents: 31059
diff changeset
212 @c @findex transpose-sexps
37120
f863383a5c3e Minor change.
Richard M. Stallman <rms@gnu.org>
parents: 36314
diff changeset
213 @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
214 (@code{transpose-words}). It moves point forward over a word,
f863383a5c3e Minor change.
Richard M. Stallman <rms@gnu.org>
parents: 36314
diff changeset
215 dragging the word preceding or containing point forward as well. The
f863383a5c3e Minor change.
Richard M. Stallman <rms@gnu.org>
parents: 36314
diff changeset
216 punctuation characters between the words do not move. For example,
f863383a5c3e Minor change.
Richard M. Stallman <rms@gnu.org>
parents: 36314
diff changeset
217 @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
218 @samp{@w{BAR FOO,}}.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
219
38204
baa9ae31d281 Say "expression" instead of "sexp". Update xref, Sexps -> Expressions.
Richard M. Stallman <rms@gnu.org>
parents: 38024
diff changeset
220 @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
221 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
222 (@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
223 except as regards what units of text they transpose.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
224
Dave Love <fx@gnu.org>
parents:
diff changeset
225 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
226 tells the transpose command to move the character (word, expression, line)
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
227 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
228 expressions, lines). For example, @kbd{C-u 3 C-t} moves the character before
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
229 point forward across three other characters. It would change
Dave Love <fx@gnu.org>
parents:
diff changeset
230 @samp{f@point{}oobar} into @samp{oobf@point{}ar}. This is equivalent to
Dave Love <fx@gnu.org>
parents:
diff changeset
231 repeating @kbd{C-t} three times. @kbd{C-u - 4 M-t} moves the word
Dave Love <fx@gnu.org>
parents:
diff changeset
232 before point backward across four words. @kbd{C-u - C-M-t} would cancel
Dave Love <fx@gnu.org>
parents:
diff changeset
233 the effect of plain @kbd{C-M-t}.@refill
Dave Love <fx@gnu.org>
parents:
diff changeset
234
Dave Love <fx@gnu.org>
parents:
diff changeset
235 A numeric argument of zero is assigned a special meaning (because
Dave Love <fx@gnu.org>
parents:
diff changeset
236 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
237 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
238 with the one ending after the mark.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
239
Dave Love <fx@gnu.org>
parents:
diff changeset
240 @node Fixing Case
Dave Love <fx@gnu.org>
parents:
diff changeset
241 @section Case Conversion
Dave Love <fx@gnu.org>
parents:
diff changeset
242
Dave Love <fx@gnu.org>
parents:
diff changeset
243 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
244 @item M-- M-l
Dave Love <fx@gnu.org>
parents:
diff changeset
245 Convert last word to lower case. Note @kbd{Meta--} is Meta-minus.
Dave Love <fx@gnu.org>
parents:
diff changeset
246 @item M-- M-u
Dave Love <fx@gnu.org>
parents:
diff changeset
247 Convert last word to all upper case.
Dave Love <fx@gnu.org>
parents:
diff changeset
248 @item M-- M-c
Dave Love <fx@gnu.org>
parents:
diff changeset
249 Convert last word to lower case with capital initial.
Dave Love <fx@gnu.org>
parents:
diff changeset
250 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
251
Dave Love <fx@gnu.org>
parents:
diff changeset
252 @kindex M-@t{-} M-l
Dave Love <fx@gnu.org>
parents:
diff changeset
253 @kindex M-@t{-} M-u
Dave Love <fx@gnu.org>
parents:
diff changeset
254 @kindex M-@t{-} M-c
Dave Love <fx@gnu.org>
parents:
diff changeset
255 A very common error is to type words in the wrong case. Because of this,
Dave Love <fx@gnu.org>
parents:
diff changeset
256 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
257 special feature when used with a negative argument: they do not move the
Dave Love <fx@gnu.org>
parents:
diff changeset
258 cursor. As soon as you see you have mistyped the last word, you can simply
Dave Love <fx@gnu.org>
parents:
diff changeset
259 case-convert it and go on typing. @xref{Case}.@refill
Dave Love <fx@gnu.org>
parents:
diff changeset
260
Dave Love <fx@gnu.org>
parents:
diff changeset
261 @node Spelling
Dave Love <fx@gnu.org>
parents:
diff changeset
262 @section Checking and Correcting Spelling
Dave Love <fx@gnu.org>
parents:
diff changeset
263 @cindex spelling, checking and correcting
Dave Love <fx@gnu.org>
parents:
diff changeset
264 @cindex checking spelling
Dave Love <fx@gnu.org>
parents:
diff changeset
265 @cindex correcting spelling
Dave Love <fx@gnu.org>
parents:
diff changeset
266
Dave Love <fx@gnu.org>
parents:
diff changeset
267 This section describes the commands to check the spelling of a single
Dave Love <fx@gnu.org>
parents:
diff changeset
268 word or of a portion of a buffer. These commands work with the spelling
68508
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
269 checker programs Aspell and Ispell, which are not part of Emacs.
70749
3b538a92087b (Spelling): ifinfo -> ifnottex.
Luc Teirlinck <teirllm@auburn.edu>
parents: 68639
diff changeset
270 @ifnottex
68508
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
271 @xref{Top, Aspell,, aspell, The Aspell Manual}.
70749
3b538a92087b (Spelling): ifinfo -> ifnottex.
Luc Teirlinck <teirllm@auburn.edu>
parents: 68639
diff changeset
272 @end ifnottex
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
273
Dave Love <fx@gnu.org>
parents:
diff changeset
274 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
275 @item M-x flyspell-mode
Dave Love <fx@gnu.org>
parents:
diff changeset
276 Enable Flyspell mode, which highlights all misspelled words.
59887
709df438e565 (Spelling): Fix typo.
Richard M. Stallman <rms@gnu.org>
parents: 56652
diff changeset
277 @item M-x flyspell-prog-mode
47501
c0b4dc1b7414 Describe Flyspell Prog mode.
Richard M. Stallman <rms@gnu.org>
parents: 46911
diff changeset
278 Enable Flyspell mode for comments and strings only.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
279 @item M-$
Dave Love <fx@gnu.org>
parents:
diff changeset
280 Check and correct spelling of the word at point (@code{ispell-word}).
Dave Love <fx@gnu.org>
parents:
diff changeset
281 @item M-@key{TAB}
60242
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
282 @itemx @key{ESC} @key{TAB}
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
283 Complete the word before point based on the spelling dictionary
Dave Love <fx@gnu.org>
parents:
diff changeset
284 (@code{ispell-complete-word}).
31059
b65102a3c19d Document the new operation of the `ispell' command.
Eli Zaretskii <eliz@gnu.org>
parents: 25829
diff changeset
285 @item M-x ispell
b65102a3c19d Document the new operation of the `ispell' command.
Eli Zaretskii <eliz@gnu.org>
parents: 25829
diff changeset
286 Spell-check the active region or the current buffer.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
287 @item M-x ispell-buffer
Dave Love <fx@gnu.org>
parents:
diff changeset
288 Check and correct spelling of each word in the buffer.
Dave Love <fx@gnu.org>
parents:
diff changeset
289 @item M-x ispell-region
Dave Love <fx@gnu.org>
parents:
diff changeset
290 Check and correct spelling of each word in the region.
Dave Love <fx@gnu.org>
parents:
diff changeset
291 @item M-x ispell-message
49600
23a1cea22d13 Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 47501
diff changeset
292 Check and correct spelling of each word in a draft mail message,
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
293 excluding cited material.
Dave Love <fx@gnu.org>
parents:
diff changeset
294 @item M-x ispell-change-dictionary @key{RET} @var{dict} @key{RET}
68508
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
295 Restart the Aspell or Ispell process, using @var{dict} as the dictionary.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
296 @item M-x ispell-kill-ispell
68508
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
297 Kill the Aspell or Ispell subprocess.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
298 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
299
Dave Love <fx@gnu.org>
parents:
diff changeset
300 @cindex Flyspell mode
Dave Love <fx@gnu.org>
parents:
diff changeset
301 @findex flyspell-mode
Dave Love <fx@gnu.org>
parents:
diff changeset
302 Flyspell mode is a fully-automatic way to check spelling as you edit
Dave Love <fx@gnu.org>
parents:
diff changeset
303 in Emacs. It operates by checking words as you change or insert them.
Dave Love <fx@gnu.org>
parents:
diff changeset
304 When it finds a word that it does not recognize, it highlights that
Dave Love <fx@gnu.org>
parents:
diff changeset
305 word. This does not interfere with your editing, but when you see the
Dave Love <fx@gnu.org>
parents:
diff changeset
306 highlighted word, you can move to it and fix it. Type @kbd{M-x
Dave Love <fx@gnu.org>
parents:
diff changeset
307 flyspell-mode} to enable or disable this mode in the current buffer.
Dave Love <fx@gnu.org>
parents:
diff changeset
308
Dave Love <fx@gnu.org>
parents:
diff changeset
309 When Flyspell mode highlights a word as misspelled, you can click on
Dave Love <fx@gnu.org>
parents:
diff changeset
310 it with @kbd{Mouse-2} to display a menu of possible corrections and
Dave Love <fx@gnu.org>
parents:
diff changeset
311 actions. You can also correct the word by editing it manually in any
Dave Love <fx@gnu.org>
parents:
diff changeset
312 way you like.
Dave Love <fx@gnu.org>
parents:
diff changeset
313
47501
c0b4dc1b7414 Describe Flyspell Prog mode.
Richard M. Stallman <rms@gnu.org>
parents: 46911
diff changeset
314 @findex flyspell-prog-mode
c0b4dc1b7414 Describe Flyspell Prog mode.
Richard M. Stallman <rms@gnu.org>
parents: 46911
diff changeset
315 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
316 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
317 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
318 enable or disable this mode in the current buffer.
c0b4dc1b7414 Describe Flyspell Prog mode.
Richard M. Stallman <rms@gnu.org>
parents: 46911
diff changeset
319
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
320 The other Emacs spell-checking features check or look up words when
62691
1193719f830c (Spelling): Delete confusing sentence; flyspell is not enabled by default.
Luc Teirlinck <teirllm@auburn.edu>
parents: 60427
diff changeset
321 you give an explicit command to do so.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
322
Dave Love <fx@gnu.org>
parents:
diff changeset
323 @kindex M-$
Dave Love <fx@gnu.org>
parents:
diff changeset
324 @findex ispell-word
62691
1193719f830c (Spelling): Delete confusing sentence; flyspell is not enabled by default.
Luc Teirlinck <teirllm@auburn.edu>
parents: 60427
diff changeset
325 To check the spelling of the word around or before point, and
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
326 optionally correct it as well, use the command @kbd{M-$}
Dave Love <fx@gnu.org>
parents:
diff changeset
327 (@code{ispell-word}). If the word is not correct, the command offers
Dave Love <fx@gnu.org>
parents:
diff changeset
328 you various alternatives for what to do about it.
Dave Love <fx@gnu.org>
parents:
diff changeset
329
Dave Love <fx@gnu.org>
parents:
diff changeset
330 @findex ispell-buffer
Dave Love <fx@gnu.org>
parents:
diff changeset
331 @findex ispell-region
Dave Love <fx@gnu.org>
parents:
diff changeset
332 To check the entire current buffer, use @kbd{M-x ispell-buffer}. Use
Dave Love <fx@gnu.org>
parents:
diff changeset
333 @kbd{M-x ispell-region} to check just the current region. To check
Dave Love <fx@gnu.org>
parents:
diff changeset
334 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
335 ispell-message}; that command checks the whole buffer, except for
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
336 material that is indented or appears to be cited from other messages.
Dave Love <fx@gnu.org>
parents:
diff changeset
337
31059
b65102a3c19d Document the new operation of the `ispell' command.
Eli Zaretskii <eliz@gnu.org>
parents: 25829
diff changeset
338 @findex ispell
b65102a3c19d Document the new operation of the `ispell' command.
Eli Zaretskii <eliz@gnu.org>
parents: 25829
diff changeset
339 @cindex spell-checking the active region
b65102a3c19d Document the new operation of the `ispell' command.
Eli Zaretskii <eliz@gnu.org>
parents: 25829
diff changeset
340 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
341 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
342 spell-checks the current buffer.
b65102a3c19d Document the new operation of the `ispell' command.
Eli Zaretskii <eliz@gnu.org>
parents: 25829
diff changeset
343
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
344 Each time these commands encounter an incorrect word, they ask you
Dave Love <fx@gnu.org>
parents:
diff changeset
345 what to do. They display a list of alternatives, usually including
Dave Love <fx@gnu.org>
parents:
diff changeset
346 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
347 checked. Then you must type a single-character response. Here are
5c282c7df1cf Minor clarifications.
Richard M. Stallman <rms@gnu.org>
parents: 38745
diff changeset
348 the valid responses:
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
349
Dave Love <fx@gnu.org>
parents:
diff changeset
350 @table @kbd
Dave Love <fx@gnu.org>
parents:
diff changeset
351 @item @key{SPC}
Dave Love <fx@gnu.org>
parents:
diff changeset
352 Skip this word---continue to consider it incorrect, but don't change it
Dave Love <fx@gnu.org>
parents:
diff changeset
353 here.
Dave Love <fx@gnu.org>
parents:
diff changeset
354
Dave Love <fx@gnu.org>
parents:
diff changeset
355 @item r @var{new} @key{RET}
60242
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
356 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
357 string will be rescanned for more spelling errors.)
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
358
Dave Love <fx@gnu.org>
parents:
diff changeset
359 @item R @var{new} @key{RET}
Dave Love <fx@gnu.org>
parents:
diff changeset
360 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
361 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
362 will be rescanned for more spelling errors.)
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
363
Dave Love <fx@gnu.org>
parents:
diff changeset
364 @item @var{digit}
Dave Love <fx@gnu.org>
parents:
diff changeset
365 Replace the word (just this time) with one of the displayed
Dave Love <fx@gnu.org>
parents:
diff changeset
366 near-misses. Each near-miss is listed with a digit; type that digit to
Dave Love <fx@gnu.org>
parents:
diff changeset
367 select it.
Dave Love <fx@gnu.org>
parents:
diff changeset
368
Dave Love <fx@gnu.org>
parents:
diff changeset
369 @item a
Dave Love <fx@gnu.org>
parents:
diff changeset
370 Accept the incorrect word---treat it as correct, but only in this
Dave Love <fx@gnu.org>
parents:
diff changeset
371 editing session.
Dave Love <fx@gnu.org>
parents:
diff changeset
372
Dave Love <fx@gnu.org>
parents:
diff changeset
373 @item A
Dave Love <fx@gnu.org>
parents:
diff changeset
374 Accept the incorrect word---treat it as correct, but only in this
Dave Love <fx@gnu.org>
parents:
diff changeset
375 editing session and for this buffer.
Dave Love <fx@gnu.org>
parents:
diff changeset
376
Dave Love <fx@gnu.org>
parents:
diff changeset
377 @item i
68508
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
378 Insert this word in your private dictionary file so that Aspell or Ispell will
38954
5c282c7df1cf Minor clarifications.
Richard M. Stallman <rms@gnu.org>
parents: 38745
diff changeset
379 consider it correct from now on, even in future sessions.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
380
Dave Love <fx@gnu.org>
parents:
diff changeset
381 @item u
38024
939c227505cd Advise TeX about hyphenation of "dictionary".
Eli Zaretskii <eliz@gnu.org>
parents: 37120
diff changeset
382 Insert the lower-case version of this word in your private dic@-tion@-ary
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
383 file.
Dave Love <fx@gnu.org>
parents:
diff changeset
384
Dave Love <fx@gnu.org>
parents:
diff changeset
385 @item m
Dave Love <fx@gnu.org>
parents:
diff changeset
386 Like @kbd{i}, but you can also specify dictionary completion
Dave Love <fx@gnu.org>
parents:
diff changeset
387 information.
Dave Love <fx@gnu.org>
parents:
diff changeset
388
Dave Love <fx@gnu.org>
parents:
diff changeset
389 @item l @var{word} @key{RET}
Dave Love <fx@gnu.org>
parents:
diff changeset
390 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
391 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
392 the replacement by typing a digit. You can use @samp{*} in @var{word} as a
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
393 wildcard.
Dave Love <fx@gnu.org>
parents:
diff changeset
394
Dave Love <fx@gnu.org>
parents:
diff changeset
395 @item C-g
60242
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
396 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
397 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
398 M-$}.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
399
Dave Love <fx@gnu.org>
parents:
diff changeset
400 @item X
Dave Love <fx@gnu.org>
parents:
diff changeset
401 Same as @kbd{C-g}.
Dave Love <fx@gnu.org>
parents:
diff changeset
402
Dave Love <fx@gnu.org>
parents:
diff changeset
403 @item x
Dave Love <fx@gnu.org>
parents:
diff changeset
404 Quit interactive spell checking and move point back to where it was
Dave Love <fx@gnu.org>
parents:
diff changeset
405 when you started spell checking.
Dave Love <fx@gnu.org>
parents:
diff changeset
406
Dave Love <fx@gnu.org>
parents:
diff changeset
407 @item q
Dave Love <fx@gnu.org>
parents:
diff changeset
408 Quit interactive spell checking and kill the Ispell subprocess.
Dave Love <fx@gnu.org>
parents:
diff changeset
409
Dave Love <fx@gnu.org>
parents:
diff changeset
410 @item C-l
Dave Love <fx@gnu.org>
parents:
diff changeset
411 Refresh the screen.
Dave Love <fx@gnu.org>
parents:
diff changeset
412
Dave Love <fx@gnu.org>
parents:
diff changeset
413 @item C-z
Dave Love <fx@gnu.org>
parents:
diff changeset
414 This key has its normal command meaning (suspend Emacs or iconify this
Dave Love <fx@gnu.org>
parents:
diff changeset
415 frame).
60242
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
416
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
417 @item ?
dcb391059e80 (Fixit): Mention C-/ for undo.
Richard M. Stallman <rms@gnu.org>
parents: 60105
diff changeset
418 Show the list of options.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
419 @end table
Dave Love <fx@gnu.org>
parents:
diff changeset
420
Dave Love <fx@gnu.org>
parents:
diff changeset
421 @findex ispell-complete-word
Dave Love <fx@gnu.org>
parents:
diff changeset
422 The command @code{ispell-complete-word}, which is bound to the key
Dave Love <fx@gnu.org>
parents:
diff changeset
423 @kbd{M-@key{TAB}} in Text mode and related modes, shows a list of
Dave Love <fx@gnu.org>
parents:
diff changeset
424 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
425 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
426 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
427 @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
428 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
429 @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
430 window and type @key{RET}. @xref{Text Mode}.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
431
Dave Love <fx@gnu.org>
parents:
diff changeset
432 @ignore
Dave Love <fx@gnu.org>
parents:
diff changeset
433 @findex reload-ispell
Dave Love <fx@gnu.org>
parents:
diff changeset
434 The first time you use any of the spell checking commands, it starts
Dave Love <fx@gnu.org>
parents:
diff changeset
435 an Ispell subprocess. The first thing the subprocess does is read your
Dave Love <fx@gnu.org>
parents:
diff changeset
436 private dictionary, which defaults to the file @file{~/ispell.words}.
Dave Love <fx@gnu.org>
parents:
diff changeset
437 Words that you ``insert'' with the @kbd{i} command are added to that
Dave Love <fx@gnu.org>
parents:
diff changeset
438 file, but not right away---only at the end of the interactive
Dave Love <fx@gnu.org>
parents:
diff changeset
439 replacement procedure. Use the @kbd{M-x reload-ispell} command to
Dave Love <fx@gnu.org>
parents:
diff changeset
440 reload your private dictionary if you edit the file outside of Ispell.
Dave Love <fx@gnu.org>
parents:
diff changeset
441 @end ignore
Dave Love <fx@gnu.org>
parents:
diff changeset
442
Dave Love <fx@gnu.org>
parents:
diff changeset
443 @cindex @code{ispell} program
Dave Love <fx@gnu.org>
parents:
diff changeset
444 @findex ispell-kill-ispell
68508
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
445 Once started, the Aspell or Ispell subprocess continues to run
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
446 (waiting for something to do), so that subsequent spell checking
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
447 commands complete more quickly. If you want to get rid of the
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
448 process, use @kbd{M-x ispell-kill-ispell}. This is not usually
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
449 necessary, since the process uses no time except when you do spelling
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
450 correction.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
451
Dave Love <fx@gnu.org>
parents:
diff changeset
452 @vindex ispell-dictionary
68508
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
453 Ispell and Aspell use two dictionaries together for spell checking: the
46911
ed736029584b Clarify ispell use of multiple dictionaries.
Richard M. Stallman <rms@gnu.org>
parents: 45636
diff changeset
454 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
455 @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
456 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
457 dictionary. The command @kbd{M-x ispell-change-dictionary} sets this
68508
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
458 variable and then restarts the subprocess, so that it will use
46911
ed736029584b Clarify ispell use of multiple dictionaries.
Richard M. Stallman <rms@gnu.org>
parents: 45636
diff changeset
459 a different standard dictionary.
25829
Dave Love <fx@gnu.org>
parents:
diff changeset
460
45636
58de4f15ebf6 (Spelling): Document ispell-complete-word-dict.
Eli Zaretskii <eliz@gnu.org>
parents: 38954
diff changeset
461 @vindex ispell-complete-word-dict
68508
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
462 Aspell and Ispell use a separate dictionary for word completion.
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
463 The variable @code{ispell-complete-word-dict} specifies the file name
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
464 of this dictionary. The completion dictionary must be different
2186cb97b750 (Undo): New node, mostly copied from basic.texi.
Richard M. Stallman <rms@gnu.org>
parents: 64890
diff changeset
465 because it 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
466 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
467 dictionary.
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 52241
diff changeset
468
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 52241
diff changeset
469 @ignore
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 52241
diff changeset
470 arch-tag: 3359a443-96ed-448f-9f05-c8111ba8eac0
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 52241
diff changeset
471 @end ignore