annotate man/new-users-guide/edit.texi @ 2420:ad56e5a6d09f

[xemacs-hg @ 2004-12-06 03:46:06 by ben] (none) README.packages: Document use of --package-prefix. Fix error in specifying standard package location. make-docfile.c: Use QXE_PATH_MAX. info.el: Correct doc string giving example package path. menubar-items.el: Move Prefix Rectangle command up one level. xemacs/packages.texi: Add long form of Lisp Reference Manual to links. Add links pointing to Lisp Reference Manual for more detailed package discussion. lispref/range-tables.texi: Document range-table changes. internals/internals.texi: Update history section. elhash.c, elhash.h, profile.c: Create inchash_eq() to allow direct incrementing of hash-table entry. Use in profile.c to try to reduce profiling overhead. Increase initial size of profile hash tables to reduce profiling overhead. buffer.c, device-msw.c, dialog-msw.c, dired-msw.c, editfns.c, event-msw.c, events.c, glyphs-msw.c, keymap.c, objects-msw.c, process-nt.c, syswindows.h, text.c, text.h, unexnt.c: Rename xetcs* -> qxetcs* for consistency with qxestr*. Rename ei*_c(_*) -> ei*_ascii(_*) since they work with ASCII-only strings not "C strings", whatever those are. This is the last place where "c" was incorrectly being used for "ascii". dialog-msw.c, dumper.c, event-msw.c, fileio.c, glyphs-gtk.c, glyphs-x.c, nt.c, process-nt.c, realpath.c, sysdep.c, sysfile.h, unexcw.c, unexnext.c, unexnt.c: Try to avoid differences in systems that do or do not include final null byte in PATH_MAX. Create PATH_MAX_INTERNAL and PATH_MAX_EXTERNAL and use them everywhere. Rewrite code in dumper.c to avoid use of PATH_MAX. When necessary in nt.c, use _MAX_PATH instead of MAX_PATH to be consistent with other places. text.c: Code to short-circuit when binary or Unicode was not working due to EOL wrapping. Fix this code to work when either no EOL autodetection or no CR's or LF's in the text. lisp.h, rangetab.c, rangetab.h, regex.c, search.c: Implement different types of ranges (open/closed start and end). Change default to be start-closed, end-open.
author ben
date Mon, 06 Dec 2004 03:46:07 +0000
parents abe6d1db359e
children e43d0da85762
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 @comment node-name, next, previous, up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 @node Edit, Customization Basics, Windows and Menus, Top
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 @chapter Basic Editing Commands
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 @kindex C-h t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 @findex help-with-tutorial
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 This chapter will introduce you to some basic editing commands. You
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 can also learn the basic editing commands by typing @kbd{Control-h t}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 (@code{help-with-tutorial} OR by selecting @b{Emacs Tutorial} from the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 @b{Help} menu on the menu bar. Most of the Emacs commands will use the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 @key{CONTROL} key or the @key{META} key. The following abbreviations
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 will be used for the @key{CONTROL} and @key{META} key in this manual:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 @item C-<chr>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 This means that you should hold down the @key{CONTROL} key while typing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 @kbd{<chr>}. For example, if the command is @kbd{C-g}, you should hold
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 the @key{CONTROL} key and type @key{g}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 @item M-<chr>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 This means that you should hold down the @kbd{META} key while typing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 @kbd{<chr>}. If there is no @kbd{META} key on your keyboard, use the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 @kbd{ESC} key instead. For example, if the command is @kbd{M-x}, then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 type @kbd{ESC}, release it and type @kbd{x}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 The following abbreviations will be used for some other keys:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 @table @key
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 @item SPC
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 Space bar.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 @item RET
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 Return key.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 @item LFD
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 Linefeed key.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 @item TAB
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 Tab.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 @item ESC
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 Escape.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 @item SFT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 Shift.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 @comment node-name, next, previous, up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 * Insert:: Insert text in Emacs by simply typing at
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 the cursor position.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 * Cursor Position:: Moving Around the cursor in the buffer,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 * Erase:: Different commands for erasing text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 * Numeric Argument:: Giving Numeric Arguments to commands
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 * Undo:: Undoing Changes made by mistake
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 @node Insert, Cursor Position, Edit, Edit
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 @section Inserting Text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 @cindex insertion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 @cindex overstrike
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 To insert printing characters into the text you are editing, just
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 type them. Emacs will automatically insert the characters that you type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 into the buffer at the cursor. The cursor moves forward, but if you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 prefer to have text characters replace (overwrite) existing text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 characters, you can enable the @b{Overstrike} option from the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 @b{Options} menu in the menu bar.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 @kindex DEL
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 @cindex deletion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 To @dfn{delete} text you have just inserted, use @key{DEL}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 @key{DEL} deletes the character @var{before} the cursor (not the one
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 that the cursor is on top of or under; that is the character @var{after}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 the cursor). The cursor and all characters after it move backwards.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 Therefore, if you type a printing character and then type @key{DEL},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 they cancel out.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 @kindex RET
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 @cindex newline
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 @findex auto-fill-mode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 To end a line and start typing a new one, type @key{RET}. This
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 inserts a newline character in the buffer. If point is in the middle of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 a line, @key{RET} splits the line. Typing @key{DEL} when the cursor is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 at the beginning of a line rubs out the newline before the line, thus
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 joining the line with the preceding line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 Emacs automatically splits lines when they become too long, if you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 turn on a special mode called @dfn{Auto Fill} mode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 @xref{Filling,,,xemacs,XEmacs User's Manual}, for information on using Auto Fill
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 mode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 @comment node-name, next, previous, up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 @node Cursor Position, Erase, Insert, Edit
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 @section Moving Around
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 @cindex cursor control
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 @cindex cursor position
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 The following commands will allow you to move the cursor around the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 screen. The actual function names corresponding to these commands are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 given in parenthesis. You can also invoke these commands by typing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 @kbd{M-x <function name>}. You can do this for any command in XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 @kindex C-a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 @kindex C-e
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 @kindex C-fx
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 @kindex C-b
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 @kindex C-n
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 @kindex C-p
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 @kindex C-v
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 @kindex M-v
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 @kindex C-t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 @kindex M->
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 @kindex M-<
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 @findex beginning-of-line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 @findex end-of-line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 @findex forward-char
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 @findex backward-char
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 @findex next-line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 @findex previous-line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 @findex transpose-chars
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 @findex beginning-of-buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 @findex end-of-buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 @findex goto-char
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 @findex goto-line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 @item C-b
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 Move the cursor backward one character (@code{backward-char}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 @item C-f
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 Move the cursor forward one character (@code{forward-char}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 @item C-p
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 Move the cursor up one line vertically (@code{previous-line}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 @item C-n
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 Move the cursor down one line vertically (@code{next-line}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 @item C-a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 Move the cursor to the beginning of the line (@code{beginning-of-line}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 @item C-e
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 Move the cursor to the end of the line (@code{end-of-line}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 @item M-f
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136 @findex forward-word
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 Move the cursor forward one word (@code{forward-word}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 @item M-b
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 @findex backward-word
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
140 Move the cursor backward one word (@code{backward-word}).
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 @item M-<
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 Move the cursor to the top of the buffer (@code{beginning-of-buffer}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 @item M->
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144 Move the cursor to the end of the buffer (@code{end-of-buffer}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 @item M-x goto-char RET <number> RET
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 To enable this command type @kbd{M-x goto-char}, and hit @key{RETURN}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 key. In the @dfn{echo area} you will see:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 Goto char:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 You should then type in a number right after the colon
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155 and hit the @kbd{RETURN} key again. After reading a number @var{n} this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156 command will move the cursor to character number @var{n}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157 Position 1 is the beginning of the buffer. For example, if you type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 @kbd{M-x goto-char RET 200 RET}, then the cursor will move to the 200th
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 character starting from the beginning of the buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 @item M-x goto-line RET <number> RET
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 @cindex goto-line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 To enable this command type @kbd{M-x goto-line}, and hit the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 @key{RETURN} key. After you see @kbd{Goto line:} in the @dfn{echo area},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 type in a number @var{n} and hit @key{RETURN} key again. This command will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 position the cursor on the nth line starting from the beginning of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 @item M-x what-line RET
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 This command will display the current line number in the echo area.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 @comment node-name, next, previous, up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 @node Erase, Numeric Argument, Cursor Position, Edit
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 @section Erasing Text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 @cindex erasing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 @cindex deleting
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180 @kindex C-d
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 @kindex C-k
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 @kindex M-d
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 @kindex M-DEL
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 @kindex M-k
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 @kindex M-z
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 @findex delete-backward-char
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 @findex delete-char
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 @findex kill-line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 @findex kill-word
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 @findex backward-kill-word
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 @findex kill-sentence
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 @findex zap-to-char
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 @item @key{DEL}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 If you press @key{DEL} i.e. the @dfn{delete} key, it will delete the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 character before the cursor (@code{delete-backward-char}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 @item C-d
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 This will delete the character after the cursor (@code{delete-char}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 @item C-k
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201 Kill to the end of the line (@code{kill-line}). If you kill the line by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 mistake you can @dfn{yank} or @samp{paste} it back by typing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203 @kbd{C-y}. @xref{Moving Text}, for more information on yanking.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204 @item M-d
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 Kill forward to the end of the next word (@code{kill-word}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 @item M-@key{DEL}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 Kill back to the beginning of the previous word
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 (@code{backward-kill-word}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 @item M-k
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210 Kill to the end of current sentence (@code{kill-sentence}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 @item M-z @var{char}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212 Kill up to next occurrence of @var{char} (@code{zap-to-char}). To use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 this command type @kbd{M-z}. You will see the following statement in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 echo area :
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
215
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
216 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 Zap to char:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220 Type any char and press the @key{RET} key. For example, if you type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 @samp{p} then the entire text starting from the position of the cursor
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 until the first occurrence of @samp{p} is killed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226 @comment node-name, next, previous, up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 @node Numeric Argument, Undo, Erase, Edit
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228 @section Giving Numeric Arguments
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229 @cindex numeric argument
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230 @cindex digit argument
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231 @cindex negative argument
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232 @kindex C-u
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 @kindex M-@t{-}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 Any Emacs command can be given a @dfn{numeric argument}. Some commands
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 interpret the argument as a repetition count. For example, if you want
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 to move forward ten characters, you could type @kbd{C-f} ten
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 times. However, a more efficient way to do this would be to give an
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 argument of ten to the key @kbd{C-f} (the command @code{forward-char}, move
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 forward one character). Negative arguments are also allowed. Often they tell
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 a command to move or act backwards. For example, if you want to move
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242 down ten lines, type the following:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 C-u 10 C-n RET
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 After you press @key{RET} key, the cursor will move ten lines
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 downward. You can also type:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 M-10 C-n RET
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253 Both @kbd{C-u} and @kbd{M-} allow you to give numeric arguments. If you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 want to move ten lines backward, you can also give negative arguments, like:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 C-u -10 C-n RET
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 OR you could also type:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 M--10 C-n RET
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263 @noindent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 You can obviously use @kbd{C-b} to move backward rather than giving
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 negative arguments to @kbd{C-n}. @xref{Numeric Arguments,,,xemacs,XEmacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 User's Manual}, for more information on numeric arguments.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268 @comment node-name, next, previous, up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 @node Undo, , Numeric Argument, Edit
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270 @section Undoing Changes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271 @cindex undo
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272 @cindex mistakes, correcting
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274 When you are editing a buffer, you might type something by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 mistake. Emacs allows you to undo all changes you make to a buffer (but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276 not more than 8000 characters). Each buffer in Emacs keeps a record of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 the changes made to it individually, so the undo command applies to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278 current buffer. There are two undo commands:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 @table @kbd
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 @kindex C-x u
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282 @item C-x u
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 Undo one batch of changes (usually, one command's worth).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 (@code{undo}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285 @item C-_
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 The same as above, but this command might not be obvious to type on some
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 keyboards so it might be better to use the above command.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 @xref{Undoing Changes,,,xemacs,XEmacs User's Manual}, for more information on
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 undoing changes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301