annotate man/new-users-guide/edit.texi @ 104:cf808b4c4290 r20-1b4

Import from CVS: tag r20-1b4
author cvs
date Mon, 13 Aug 2007 09:16:51 +0200
parents 376386a54a3c
children c9fe270a4101
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 @comment node-name, next, previous, up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 @node Edit, Customization Basics, Windows and Menus, Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 @chapter Basic Editing Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 @kindex C-h t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 @findex help-with-tutorial
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 This chapter will introduce you to some basic editing commands. You
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 can also learn the basic editing commands by typing @kbd{Control-h t}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 (@code{help-with-tutorial} OR by selecting @b{Emacs Tutorial} from the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 @b{Help} menu on the menu bar. Most of the Emacs commands will use the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 @key{CONTROL} key or the @key{META} key. The following abbreviations
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 will be used for the @key{CONTROL} and @key{META} key in this manual:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 @item C-<chr>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 This means that you should hold down the @key{CONTROL} key while typing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 @kbd{<chr>}. For example, if the command is @kbd{C-g}, you should hold
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 the @key{CONTROL} key and type @key{g}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 @item M-<chr>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 This means that you should hold down the @kbd{META} key while typing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 @kbd{<chr>}. If there is no @kbd{META} key on your keyboard, use the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 @kbd{ESC} key instead. For example, if the command is @kbd{M-x}, then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 type @kbd{ESC}, release it and type @kbd{x}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 The following abbreviations will be used for some other keys:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 @table @key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 @item SPC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 Space bar.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 @item RET
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 Return key.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 @item LFD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 Linefeed key.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 @item TAB
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 Tab.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 @item ESC
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 Escape.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 @item SFT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 Shift.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 @comment node-name, next, previous, up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 * Insert:: Insert text in Emacs by simply typing at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 the cursor position.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 * Cursor Position:: Moving Around the cursor in the buffer,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 * Erase:: Different commands for erasing text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 * Numeric Argument:: Giving Numeric Arguments to commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 * Undo:: Undoing Changes made by mistake
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 @node Insert, Cursor Position, Edit, Edit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 @section Inserting Text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 @cindex insertion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 @cindex overstrike
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 To insert printing characters into the text you are editing, just
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 type them. Emacs will automatically insert the characters that you type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 into the buffer at the cursor. The cursor moves forward, but if you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 prefer to have text characters replace (overwrite) existing text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 characters, you can enable the @b{Overstrike} option from the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 @b{Options} menu in the menu bar.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 @kindex DEL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 @cindex deletion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 To @dfn{delete} text you have just inserted, use @key{DEL}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 @key{DEL} deletes the character @var{before} the cursor (not the one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 that the cursor is on top of or under; that is the character @var{after}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 the cursor). The cursor and all characters after it move backwards.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 Therefore, if you type a printing character and then type @key{DEL},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 they cancel out.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 @kindex RET
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 @cindex newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 @findex auto-fill-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 To end a line and start typing a new one, type @key{RET}. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 inserts a newline character in the buffer. If point is in the middle of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 a line, @key{RET} splits the line. Typing @key{DEL} when the cursor is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 at the beginning of a line rubs out the newline before the line, thus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 joining the line with the preceding line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 Emacs automatically splits lines when they become too long, if you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 turn on a special mode called @dfn{Auto Fill} mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 @xref{Filling,,,,XEmacs User's Manual}, for information on using Auto Fill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 @comment node-name, next, previous, up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 @node Cursor Position, Erase, Insert, Edit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 @section Moving Around
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 @cindex cursor control
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 @cindex cursor position
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 The following commands will allow you to move the cursor around the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 screen. The actual function names corresponding to these commands are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 given in parenthesis. You can also invoke these commands by typing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 @kbd{M-x <function name>}. You can do this for any command in XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 @kindex C-a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 @kindex C-e
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 @kindex C-fx
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 @kindex C-b
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 @kindex C-n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 @kindex C-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 @kindex C-v
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 @kindex M-v
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 @kindex C-t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 @kindex M->
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 @kindex M-<
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 @findex beginning-of-line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 @findex end-of-line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 @findex forward-char
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 @findex backward-char
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 @findex next-line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 @findex previous-line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 @findex transpose-chars
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 @findex beginning-of-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 @findex end-of-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 @findex goto-char
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 @findex goto-line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 @item C-b
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 Move the cursor backward one character (@code{backward-char}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 @item C-f
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 Move the cursor forward one character (@code{forward-char}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 @item C-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 Move the cursor up one line vertically (@code{previous-line}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 @item C-n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 Move the cursor down one line vertically (@code{next-line}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 @item C-a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 Move the cursor to the beginning of the line (@code{beginning-of-line}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 @item C-e
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 Move the cursor to the end of the line (@code{end-of-line}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 @item M-f
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 @findex forward-word
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 Move the cursor forward one word (@code{forward-word}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 @item M-b
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 @findex backward-word
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 Move the cursor backword one word (@code{backward-word}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 @item M-<
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 Move the cursor to the top of the buffer (@code{beginning-of-buffer}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 @item M->
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 Move the cursor to the end of the buffer (@code{end-of-buffer}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 @item M-x goto-char RET <number> RET
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 To enable this command type @kbd{M-x goto-char}, and hit @key{RETURN}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 key. In the @dfn{echo area} you will see:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 Goto char:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 You should then type in a number right after the colon
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 and hit the @kbd{RETURN} key again. After reading a number @var{n} this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 command will move the cursor to character number @var{n}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 Position 1 is the beginning of the buffer. For example, if you type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 @kbd{M-x goto-char RET 200 RET}, then the cursor will move to the 200th
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 character starting from the beginning of the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 @item M-x goto-line RET <number> RET
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 @cindex goto-line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 To enable this command type @kbd{M-x goto-line}, and hit the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 @key{RETURN} key. After you see @kbd{Goto line:} in the @dfn{echo area},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 type in a number @var{n} and hit @key{RETURN} key again. This command will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 position the cursor on the nth line starting from the beginning of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 @item M-x what-line RET
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 This command will display the current line number in the echo area.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 @comment node-name, next, previous, up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 @node Erase, Numeric Argument, Cursor Position, Edit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 @section Erasing Text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 @cindex erasing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 @cindex deleting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 @kindex C-d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 @kindex C-k
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 @kindex M-d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 @kindex M-DEL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 @kindex M-k
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 @kindex M-z
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 @findex delete-backward-char
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 @findex delete-char
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 @findex kill-line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 @findex kill-word
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 @findex backward-kill-word
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 @findex kill-sentence
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 @findex zap-to-char
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 @item @key{DEL}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 If you press @key{DEL} i.e. the @dfn{delete} key, it will delete the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 character before the cursor (@code{delete-backward-char}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 @item C-d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 This will delete the character after the cursor (@code{delete-char}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 @item C-k
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 Kill to the end of the line (@code{kill-line}). If you kill the line by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 mistake you can @dfn{yank} or @samp{paste} it back by typing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 @kbd{C-y}. @xref{Moving Text}, for more information on yanking.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 @item M-d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 Kill forward to the end of the next word (@code{kill-word}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 @item M-@key{DEL}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 Kill back to the beginning of the previous word
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (@code{backward-kill-word}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 @item M-k
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 Kill to the end of current sentence (@code{kill-sentence}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 @item M-z @var{char}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 Kill up to next occurrence of @var{char} (@code{zap-to-char}). To use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 this command type @kbd{M-z}. You will see the following statement in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 echo area :
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 Zap to char:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 Type any char and press the @key{RET} key. For example, if you type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 @samp{p} then the entire text starting from the position of the cursor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 until the first occurrence of @samp{p} is killed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 @comment node-name, next, previous, up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 @node Numeric Argument, Undo, Erase, Edit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 @section Giving Numeric Arguments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 @cindex numeric argument
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 @cindex digit argument
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 @cindex negative argument
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 @kindex C-u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 @kindex M-@t{-}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 Any Emacs command can be given a @dfn{numeric argument}. Some commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 interpret the argument as a repetition count. For example, if you want
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 to move forward ten characters, you could type @kbd{C-f} ten
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 times. However, a more efficient way to do this would be to give an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 argument of ten to the key @kbd{C-f} (the command @code{forward-char}, move
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 forward one character). Negative arguments are also allowed. Often they tell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 a command to move or act backwards. For example, if you want to move
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 down ten lines, type the following:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 C-u 10 C-n RET
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 After you press @key{RET} key, the cursor will move ten lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 downward. You can also type:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 M-10 C-n RET
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 Both @kbd{C-u} and @kbd{M-} allow you to give numeric arguments. If you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 want to move ten lines backward, you can also give negative arguments, like:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 C-u -10 C-n RET
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 OR you could also type:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 M--10 C-n RET
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 You can obviously use @kbd{C-b} to move backward rather than giving
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 negative arguments to @kbd{C-n}. @xref{Numeric Arguments,,,,XEmacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 Manual}, for more information on numeric arguments.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 @comment node-name, next, previous, up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 @node Undo, , Numeric Argument, Edit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 @section Undoing Changes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 @cindex undo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 @cindex mistakes, correcting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 When you are editing a buffer, you might type something by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 mistake. Emacs allows you to undo all changes you make to a buffer (but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 not more than 8000 characters). Each buffer in Emacs keeps a record of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 the changes made to it individually, so the undo command applies to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 current buffer. There are two undo commands:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 @kindex C-x u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 @item C-x u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 Undo one batch of changes (usually, one command's worth).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (@code{undo}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 @item C-_
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 The same as above, but this command might not be obvious to type on some
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 keyboards so it might be better to use the above command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 @xref{Undoing Changes,,,,XEmacs User's Manual}, for more information on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 undoing changes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301