Mercurial > emacs
annotate man/basic.texi @ 70086:c12e24e779ab
Comment changes.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 18 Apr 2006 21:05:45 +0000 |
parents | 4bb94c09a47d |
children | ddc3087f4c41 c5406394f567 |
rev | line source |
---|---|
25829 | 1 @c This is part of the Emacs manual. |
64890
3723093a21fd
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
62483
diff
changeset
|
2 @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, |
68639
dc2d5a6655a3
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
68505
diff
changeset
|
3 @c 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. |
25829 | 4 @c See file emacs.texi for copying conditions. |
5 @node Basic, Minibuffer, Exiting, Top | |
6 @chapter Basic Editing Commands | |
7 | |
8 @kindex C-h t | |
9 @findex help-with-tutorial | |
10 We now give the basics of how to enter text, make corrections, and | |
11 save the text in a file. If this material is new to you, you might | |
12 learn it more easily by running the Emacs learn-by-doing tutorial. To | |
13 use the tutorial, run Emacs and type @kbd{Control-h t} | |
14 (@code{help-with-tutorial}). | |
15 | |
16 To clear the screen and redisplay, type @kbd{C-l} (@code{recenter}). | |
17 | |
18 @menu | |
19 | |
20 * Inserting Text:: Inserting text by simply typing it. | |
21 * Moving Point:: How to move the cursor to the place where you want to | |
22 change something. | |
23 * Erasing:: Deleting and killing text. | |
68505
d2c4afd6b173
(Basic Undo): Renamed from Undo. Most of text moved to new Undo node.
Richard M. Stallman <rms@gnu.org>
parents:
68464
diff
changeset
|
24 * Basic Undo:: Undoing recent changes in the text. |
25829 | 25 * Files: Basic Files. Visiting, creating, and saving files. |
26 * Help: Basic Help. Asking what a character does. | |
27 * Blank Lines:: Commands to make or delete blank lines. | |
28 * Continuation Lines:: Lines too wide for the screen. | |
29 * Position Info:: What page, line, row, or column is point on? | |
30 * Arguments:: Numeric arguments for repeating a command. | |
31 * Repeating:: A short-cut for repeating the previous command. | |
32 @end menu | |
33 | |
34 @node Inserting Text | |
35 @section Inserting Text | |
36 | |
37 @cindex insertion | |
38 @cindex graphic characters | |
39 To insert printing characters into the text you are editing, just type | |
40 them. This inserts the characters you type into the buffer at the | |
41 cursor (that is, at @dfn{point}; @pxref{Point}). The cursor moves | |
42 forward, and any text after the cursor moves forward too. If the text | |
43 in the buffer is @samp{FOOBAR}, with the cursor before the @samp{B}, | |
44 then if you type @kbd{XX}, you get @samp{FOOXXBAR}, with the cursor | |
45 still before the @samp{B}. | |
46 | |
36724
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
47 To @dfn{delete} text you have just inserted, use the large key |
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
48 labeled @key{DEL}, @key{BACKSPACE} or @key{DELETE} which is a short |
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
49 distance above the @key{RET} or @key{ENTER} key. This is the key you |
36789
f71fe44b07ea
Simplify the discussion of DEL. Refer to `DEL Gets Help' node
Richard M. Stallman <rms@gnu.org>
parents:
36724
diff
changeset
|
50 normally use, outside Emacs, for erasing the last character that you |
37988 | 51 typed. Regardless of the label on that key, Emacs thinks of it as |
52 @key{DEL}, and that's what we call it in this manual. | |
36724
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
53 |
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
54 The @key{DEL} key deletes the character @emph{before} the cursor. |
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
55 As a consequence, the cursor and all the characters after it move |
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
56 backwards. If you type a printing character and then type @key{DEL}, |
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
57 they cancel out. |
25829 | 58 |
36789
f71fe44b07ea
Simplify the discussion of DEL. Refer to `DEL Gets Help' node
Richard M. Stallman <rms@gnu.org>
parents:
36724
diff
changeset
|
59 On most computers, Emacs recognizes automatically which key ought to |
f71fe44b07ea
Simplify the discussion of DEL. Refer to `DEL Gets Help' node
Richard M. Stallman <rms@gnu.org>
parents:
36724
diff
changeset
|
60 be @key{DEL}, and sets it up that way. But in some cases, especially |
f71fe44b07ea
Simplify the discussion of DEL. Refer to `DEL Gets Help' node
Richard M. Stallman <rms@gnu.org>
parents:
36724
diff
changeset
|
61 with text-only terminals, you will need to tell Emacs which key to use |
f71fe44b07ea
Simplify the discussion of DEL. Refer to `DEL Gets Help' node
Richard M. Stallman <rms@gnu.org>
parents:
36724
diff
changeset
|
62 for that purpose. If the large key not far above the @key{RET} or |
f71fe44b07ea
Simplify the discussion of DEL. Refer to `DEL Gets Help' node
Richard M. Stallman <rms@gnu.org>
parents:
36724
diff
changeset
|
63 @key{ENTER} key doesn't delete backwards, you need to do this. |
38767
5889c45fd6ad
Change the name of the "DEL Doesn't Delete" node to "DEL Does Not Delete",
Eli Zaretskii <eliz@gnu.org>
parents:
38738
diff
changeset
|
64 @xref{DEL Does Not Delete}, for an explanation of how. |
36789
f71fe44b07ea
Simplify the discussion of DEL. Refer to `DEL Gets Help' node
Richard M. Stallman <rms@gnu.org>
parents:
36724
diff
changeset
|
65 |
68190
fa9bfcab4414
(Inserting Text): Minor cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
67918
diff
changeset
|
66 Most PC keyboards have both a @key{BACKSPACE} key not far above |
37356
c9bd237ce092
Minor clarification of case where both BACKSPACE and DELETE are
Richard M. Stallman <rms@gnu.org>
parents:
37152
diff
changeset
|
67 @key{RET} or @key{ENTER}, and a @key{DELETE} key elsewhere. On these |
c9bd237ce092
Minor clarification of case where both BACKSPACE and DELETE are
Richard M. Stallman <rms@gnu.org>
parents:
37152
diff
changeset
|
68 keyboards, Emacs supports when possible the usual convention that the |
c9bd237ce092
Minor clarification of case where both BACKSPACE and DELETE are
Richard M. Stallman <rms@gnu.org>
parents:
37152
diff
changeset
|
69 @key{BACKSPACE} key deletes backwards (it is @key{DEL}), while the |
c9bd237ce092
Minor clarification of case where both BACKSPACE and DELETE are
Richard M. Stallman <rms@gnu.org>
parents:
37152
diff
changeset
|
70 @key{DELETE} key deletes ``forwards,'' deleting the character after |
c9bd237ce092
Minor clarification of case where both BACKSPACE and DELETE are
Richard M. Stallman <rms@gnu.org>
parents:
37152
diff
changeset
|
71 point, the one underneath the cursor, like @kbd{C-d} (see below). |
36724
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
72 |
25829 | 73 @kindex RET |
74 @cindex newline | |
75 To end a line and start typing a new one, type @key{RET}. This | |
76 inserts a newline character in the buffer. If point is in the middle of | |
59947
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
77 a line, the effect is to split the line. Typing @key{DEL} when the cursor is |
25829 | 78 at the beginning of a line deletes the preceding newline, thus joining |
79 the line with the preceding line. | |
80 | |
81 Emacs can split lines automatically when they become too long, if you | |
82 turn on a special minor mode called @dfn{Auto Fill} mode. | |
68464
79464a6167f5
* basic.texi (Continuation Lines, Inserting Text): Mention
Chong Yidong <cyd@stupidchicken.com>
parents:
68452
diff
changeset
|
83 @xref{Filling}, for how to use Auto Fill mode and other modes for |
79464a6167f5
* basic.texi (Continuation Lines, Inserting Text): Mention
Chong Yidong <cyd@stupidchicken.com>
parents:
68452
diff
changeset
|
84 @dfn{filling} text. |
25829 | 85 |
86 If you prefer to have text characters replace (overwrite) existing | |
87 text rather than shove it to the right, you can enable Overwrite mode, | |
88 a minor mode. @xref{Minor Modes}. | |
89 | |
90 @cindex quoting | |
91 @kindex C-q | |
92 @findex quoted-insert | |
93 Direct insertion works for printing characters and @key{SPC}, but other | |
94 characters act as editing commands and do not insert themselves. If you | |
95 need to insert a control character or a character whose code is above 200 | |
96 octal, you must @dfn{quote} it by typing the character @kbd{Control-q} | |
97 (@code{quoted-insert}) first. (This character's name is normally written | |
98 @kbd{C-q} for short.) There are two ways to use @kbd{C-q}:@refill | |
99 | |
100 @itemize @bullet | |
101 @item | |
102 @kbd{C-q} followed by any non-graphic character (even @kbd{C-g}) | |
103 inserts that character. | |
104 | |
105 @item | |
106 @kbd{C-q} followed by a sequence of octal digits inserts the character | |
107 with the specified octal character code. You can use any number of | |
37152 | 108 octal digits; any non-digit terminates the sequence. If the |
109 terminating character is @key{RET}, it serves only to terminate the | |
110 sequence. Any other non-digit terminates the sequence and then acts | |
111 as normal input---thus, @kbd{C-q 1 0 1 B} inserts @samp{AB}. | |
112 | |
113 The use of octal sequences is disabled in ordinary non-binary | |
114 Overwrite mode, to give you a convenient way to insert a digit instead | |
115 of overwriting with it. | |
25829 | 116 @end itemize |
117 | |
33552
82d0163f6fb7
Say "ISO 8859" instead of "ISO Latin", to cover non-Latin ISO-8859
Eli Zaretskii <eliz@gnu.org>
parents:
33518
diff
changeset
|
118 @cindex 8-bit character codes |
25829 | 119 @noindent |
33518 | 120 When multibyte characters are enabled, if you specify a code in the |
36140
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
121 range 0200 through 0377 octal, @kbd{C-q} assumes that you intend to |
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
122 use some ISO 8859-@var{n} character set, and converts the specified |
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
123 code to the corresponding Emacs character code. @xref{Enabling |
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
124 Multibyte}. You select @emph{which} of the ISO 8859 character sets to |
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
125 use through your choice of language environment (@pxref{Language |
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
126 Environments}). |
25829 | 127 |
128 @vindex read-quoted-char-radix | |
129 To use decimal or hexadecimal instead of octal, set the variable | |
130 @code{read-quoted-char-radix} to 10 or 16. If the radix is greater than | |
131 10, some letters starting with @kbd{a} serve as part of a character | |
132 code, just like digits. | |
133 | |
134 A numeric argument to @kbd{C-q} specifies how many copies of the | |
135 quoted character should be inserted (@pxref{Arguments}). | |
136 | |
137 @findex newline | |
138 @findex self-insert | |
139 Customization information: @key{DEL} in most modes runs the command | |
140 @code{delete-backward-char}; @key{RET} runs the command @code{newline}, and | |
141 self-inserting printing characters run the command @code{self-insert}, | |
142 which inserts whatever character was typed to invoke it. Some major modes | |
143 rebind @key{DEL} to other commands. | |
144 | |
145 @node Moving Point | |
146 @section Changing the Location of Point | |
147 | |
148 @cindex arrow keys | |
149 @cindex moving point | |
150 @cindex movement | |
151 @cindex cursor motion | |
152 @cindex moving the cursor | |
153 To do more than insert characters, you have to know how to move point | |
154 (@pxref{Point}). The simplest way to do this is with arrow keys, or by | |
155 clicking the left mouse button where you want to move to. | |
156 | |
157 There are also control and meta characters for cursor motion. Some | |
68452 | 158 are equivalent to the arrow keys (it is faster to use these control |
159 keys than move your hand over to the arrow keys). Others do more | |
160 sophisticated things. | |
25829 | 161 |
162 @kindex C-a | |
163 @kindex C-e | |
164 @kindex C-f | |
165 @kindex C-b | |
166 @kindex C-n | |
167 @kindex C-p | |
168 @kindex M-> | |
169 @kindex M-< | |
170 @kindex M-r | |
36724
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
171 @kindex LEFT |
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
172 @kindex RIGHT |
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
173 @kindex UP |
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
174 @kindex DOWN |
62193
598f5ebd4f94
Various typo and grammar fixes.
Luc Teirlinck <teirllm@auburn.edu>
parents:
61100
diff
changeset
|
175 @findex move-beginning-of-line |
59140
13368da050f1
(Moving Point): C-e now runs move-end-of-line.
Richard M. Stallman <rms@gnu.org>
parents:
52979
diff
changeset
|
176 @findex move-end-of-line |
25829 | 177 @findex forward-char |
178 @findex backward-char | |
179 @findex next-line | |
180 @findex previous-line | |
181 @findex beginning-of-buffer | |
182 @findex end-of-buffer | |
183 @findex goto-char | |
184 @findex goto-line | |
185 @findex move-to-window-line | |
186 @table @kbd | |
187 @item C-a | |
62193
598f5ebd4f94
Various typo and grammar fixes.
Luc Teirlinck <teirllm@auburn.edu>
parents:
61100
diff
changeset
|
188 Move to the beginning of the line (@code{move-beginning-of-line}). |
25829 | 189 @item C-e |
59140
13368da050f1
(Moving Point): C-e now runs move-end-of-line.
Richard M. Stallman <rms@gnu.org>
parents:
52979
diff
changeset
|
190 Move to the end of the line (@code{move-end-of-line}). |
25829 | 191 @item C-f |
36724
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
192 Move forward one character (@code{forward-char}). The right-arrow key |
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
193 does the same thing. |
25829 | 194 @item C-b |
36724
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
195 Move backward one character (@code{backward-char}). The left-arrow |
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
196 key has the same effect. |
25829 | 197 @item M-f |
198 Move forward one word (@code{forward-word}). | |
199 @item M-b | |
200 Move backward one word (@code{backward-word}). | |
201 @item C-n | |
202 Move down one line, vertically (@code{next-line}). This command | |
203 attempts to keep the horizontal position unchanged, so if you start in | |
36724
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
204 the middle of one line, you end in the middle of the next. The |
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
205 down-arrow key does the same thing. |
25829 | 206 @item C-p |
36724
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
207 Move up one line, vertically (@code{previous-line}). The up-arrow key |
36651
f16f21a469b1
(Moving Point): Mention C-v and M-v, and the arrow keys.
Eli Zaretskii <eliz@gnu.org>
parents:
36263
diff
changeset
|
208 has the same effect. |
25829 | 209 @item M-r |
210 Move point to left margin, vertically centered in the window | |
211 (@code{move-to-window-line}). Text does not move on the screen. | |
212 | |
213 A numeric argument says which screen line to place point on. It counts | |
214 screen lines down from the top of the window (zero for the top line). A | |
215 negative argument counts lines from the bottom (@minus{}1 for the bottom | |
216 line). | |
217 @item M-< | |
218 Move to the top of the buffer (@code{beginning-of-buffer}). With | |
219 numeric argument @var{n}, move to @var{n}/10 of the way from the top. | |
220 @xref{Arguments}, for more information on numeric arguments.@refill | |
221 @item M-> | |
222 Move to the end of the buffer (@code{end-of-buffer}). | |
36724
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
223 @item C-v |
59947
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
224 @itemx @key{PAGEDOWN} |
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
225 @itemx @key{PRIOR} |
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
226 Scroll the display one screen forward, and move point if necessary to |
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
227 put it on the screen (@code{scroll-up}). This doesn't always move |
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
228 point, but it is commonly used to do so. If your keyboard has a |
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
229 @key{PAGEDOWN} or @key{PRIOR} key, it does the same thing. |
36724
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
230 |
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
231 Scrolling commands are further described in @ref{Scrolling}. |
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
232 @item M-v |
59947
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
233 @itemx @key{PAGEUP} |
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
234 @itemx @key{NEXT} |
36724
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
235 Scroll one screen backward, and move point if necessary to put it on |
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
236 the screen (@code{scroll-down}). This doesn't always move point, but |
59947
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
237 it is commonly used to do so. If your keyboard has a @key{PAGEUP} or |
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
238 @key{NEXT} key, it does the same thing. |
25829 | 239 @item M-x goto-char |
240 Read a number @var{n} and move point to buffer position @var{n}. | |
241 Position 1 is the beginning of the buffer. | |
60788
98fb3a23b966
(Moving Point): Add M-g M-g binding.
Richard M. Stallman <rms@gnu.org>
parents:
60102
diff
changeset
|
242 @item M-g M-g |
62338
9d25647627a1
(Moving Point): Mention `M-g g' binding for goto-line.
Luc Teirlinck <teirllm@auburn.edu>
parents:
62207
diff
changeset
|
243 @itemx M-g g |
60788
98fb3a23b966
(Moving Point): Add M-g M-g binding.
Richard M. Stallman <rms@gnu.org>
parents:
60102
diff
changeset
|
244 @itemx M-x goto-line |
62483
8daca9735e20
(Moving Point): Mention default for `goto-line'.
Luc Teirlinck <teirllm@auburn.edu>
parents:
62338
diff
changeset
|
245 Read a number @var{n} and move point to the beginning of line number |
8daca9735e20
(Moving Point): Mention default for `goto-line'.
Luc Teirlinck <teirllm@auburn.edu>
parents:
62338
diff
changeset
|
246 @var{n}. Line 1 is the beginning of the buffer. If point is on or |
8daca9735e20
(Moving Point): Mention default for `goto-line'.
Luc Teirlinck <teirllm@auburn.edu>
parents:
62338
diff
changeset
|
247 just after a number, then that is the default for @var{n}, if you just |
8daca9735e20
(Moving Point): Mention default for `goto-line'.
Luc Teirlinck <teirllm@auburn.edu>
parents:
62338
diff
changeset
|
248 press @key{RET} with an empty minibuffer. |
25829 | 249 @item C-x C-n |
250 @findex set-goal-column | |
251 @kindex C-x C-n | |
252 Use the current column of point as the @dfn{semipermanent goal column} for | |
253 @kbd{C-n} and @kbd{C-p} (@code{set-goal-column}). Henceforth, those | |
254 commands always move to this column in each line moved into, or as | |
255 close as possible given the contents of the line. This goal column remains | |
256 in effect until canceled. | |
257 @item C-u C-x C-n | |
258 Cancel the goal column. Henceforth, @kbd{C-n} and @kbd{C-p} once | |
259 again try to stick to a fixed horizontal position, as usual. | |
260 @end table | |
261 | |
262 @vindex track-eol | |
263 If you set the variable @code{track-eol} to a non-@code{nil} value, | |
38172 | 264 then @kbd{C-n} and @kbd{C-p}, when starting at the end of the line, move |
25829 | 265 to the end of another line. Normally, @code{track-eol} is @code{nil}. |
266 @xref{Variables}, for how to set variables such as @code{track-eol}. | |
267 | |
268 @vindex next-line-add-newlines | |
62193
598f5ebd4f94
Various typo and grammar fixes.
Luc Teirlinck <teirllm@auburn.edu>
parents:
61100
diff
changeset
|
269 @kbd{C-n} normally stops at the end of the buffer when you use it on |
59947
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
270 the last line of the buffer. But if you set the variable |
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
271 @code{next-line-add-newlines} to a non-@code{nil} value, @kbd{C-n} on |
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
272 the last line of a buffer creates an additional line at the end and |
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
273 moves down onto it. |
25829 | 274 |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46040
diff
changeset
|
275 @node Erasing |
25829 | 276 @section Erasing Text |
277 | |
278 @table @kbd | |
279 @item @key{DEL} | |
280 Delete the character before point (@code{delete-backward-char}). | |
281 @item C-d | |
282 Delete the character after point (@code{delete-char}). | |
36724
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
283 @item @key{DELETE} |
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
284 @itemx @key{BACKSPACE} |
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
285 One of these keys, whichever is the large key above the @key{RET} or |
68452 | 286 @key{ENTER} key, deletes the character before point---it is @key{DEL}. |
287 If @key{BACKSPACE} is @key{DEL}, and your keyboard also has @key{DELETE}, | |
36724
c3461a4e8d2e
Clarify BACKSPACE vs DELETE. Mention delete-key-deletes-forward-mode.
Richard M. Stallman <rms@gnu.org>
parents:
36654
diff
changeset
|
288 then @key{DELETE} deletes forwards, like @kbd{C-d}. |
25829 | 289 @item C-k |
290 Kill to the end of the line (@code{kill-line}). | |
291 @item M-d | |
292 Kill forward to the end of the next word (@code{kill-word}). | |
293 @item M-@key{DEL} | |
294 Kill back to the beginning of the previous word | |
295 (@code{backward-kill-word}). | |
296 @end table | |
297 | |
298 @cindex killing characters and lines | |
299 @cindex deleting characters and lines | |
300 @cindex erasing characters and lines | |
301 You already know about the @key{DEL} key which deletes the character | |
302 before point (that is, before the cursor). Another key, @kbd{Control-d} | |
303 (@kbd{C-d} for short), deletes the character after point (that is, the | |
304 character that the cursor is on). This shifts the rest of the text on | |
305 the line to the left. If you type @kbd{C-d} at the end of a line, it | |
306 joins together that line and the next line. | |
307 | |
308 To erase a larger amount of text, use the @kbd{C-k} key, which kills a | |
309 line at a time. If you type @kbd{C-k} at the beginning or middle of a | |
310 line, it kills all the text up to the end of the line. If you type | |
311 @kbd{C-k} at the end of a line, it joins that line and the next line. | |
312 | |
313 @xref{Killing}, for more flexible ways of killing text. | |
314 | |
68505
d2c4afd6b173
(Basic Undo): Renamed from Undo. Most of text moved to new Undo node.
Richard M. Stallman <rms@gnu.org>
parents:
68464
diff
changeset
|
315 @node Basic Undo |
25829 | 316 @section Undoing Changes |
317 | |
68505
d2c4afd6b173
(Basic Undo): Renamed from Undo. Most of text moved to new Undo node.
Richard M. Stallman <rms@gnu.org>
parents:
68464
diff
changeset
|
318 Emacs records a list of changes made in the buffer text, so you can |
d2c4afd6b173
(Basic Undo): Renamed from Undo. Most of text moved to new Undo node.
Richard M. Stallman <rms@gnu.org>
parents:
68464
diff
changeset
|
319 you can undo all the recent changes, as far as the records go. |
d2c4afd6b173
(Basic Undo): Renamed from Undo. Most of text moved to new Undo node.
Richard M. Stallman <rms@gnu.org>
parents:
68464
diff
changeset
|
320 Usually each editing command makes a separate entry in the undo |
d2c4afd6b173
(Basic Undo): Renamed from Undo. Most of text moved to new Undo node.
Richard M. Stallman <rms@gnu.org>
parents:
68464
diff
changeset
|
321 records, but sometimes an entry covers just part of a command, and |
d2c4afd6b173
(Basic Undo): Renamed from Undo. Most of text moved to new Undo node.
Richard M. Stallman <rms@gnu.org>
parents:
68464
diff
changeset
|
322 very simple commands may be grouped. |
25829 | 323 |
324 @table @kbd | |
325 @item C-x u | |
68505
d2c4afd6b173
(Basic Undo): Renamed from Undo. Most of text moved to new Undo node.
Richard M. Stallman <rms@gnu.org>
parents:
68464
diff
changeset
|
326 Undo one entry of the undo records---usually, one command worth |
d2c4afd6b173
(Basic Undo): Renamed from Undo. Most of text moved to new Undo node.
Richard M. Stallman <rms@gnu.org>
parents:
68464
diff
changeset
|
327 (@code{undo}). |
25829 | 328 @item C-_ |
59947
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
329 @itemx C-/ |
25829 | 330 The same. |
331 @end table | |
332 | |
59947
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
333 The command @kbd{C-x u} (or @kbd{C-_} or @kbd{C-/}) is how you undo. |
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
334 The first time you give this command, it undoes the last change. |
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
335 Point moves back to where it was before the command that made the |
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
336 change. |
25829 | 337 |
68505
d2c4afd6b173
(Basic Undo): Renamed from Undo. Most of text moved to new Undo node.
Richard M. Stallman <rms@gnu.org>
parents:
68464
diff
changeset
|
338 Consecutive repetitions of @kbd{C-x u} (or its aliases) undo earlier |
d2c4afd6b173
(Basic Undo): Renamed from Undo. Most of text moved to new Undo node.
Richard M. Stallman <rms@gnu.org>
parents:
68464
diff
changeset
|
339 and earlier changes, back to the limit of the undo information |
d2c4afd6b173
(Basic Undo): Renamed from Undo. Most of text moved to new Undo node.
Richard M. Stallman <rms@gnu.org>
parents:
68464
diff
changeset
|
340 available. If all recorded changes have already been undone, the undo |
d2c4afd6b173
(Basic Undo): Renamed from Undo. Most of text moved to new Undo node.
Richard M. Stallman <rms@gnu.org>
parents:
68464
diff
changeset
|
341 command displays an error message and does nothing. |
68452 | 342 |
343 The undo command applies only to changes in the buffer; you can't | |
344 use it to undo mere cursor motion. However, some cursor motion | |
345 commands set the mark, so if you use these commands from time to time, | |
346 you can move back to the neighborhoods you have moved through by | |
347 popping the mark ring (@pxref{Mark Ring}). | |
25829 | 348 |
349 @node Basic Files | |
350 @section Files | |
351 | |
352 The commands described above are sufficient for creating and altering | |
353 text in an Emacs buffer; the more advanced Emacs commands just make | |
68452 | 354 things easier. However, to keep any text permanently you must put it in a |
25829 | 355 @dfn{file}. Files are named units of text which are stored by the |
356 operating system for you to retrieve later by name. To look at or use | |
357 the contents of a file in any way, including editing the file with | |
358 Emacs, you must specify the file name. | |
359 | |
68452 | 360 Consider a file named @file{test.emacs}. (We can assume it is in |
361 your home directory.) In Emacs, to begin editing this file, type | |
25829 | 362 |
363 @example | |
68452 | 364 C-x C-f test.emacs @key{RET} |
25829 | 365 @end example |
366 | |
367 @noindent | |
368 Here the file name is given as an @dfn{argument} to the command @kbd{C-x | |
369 C-f} (@code{find-file}). That command uses the @dfn{minibuffer} to | |
370 read the argument, and you type @key{RET} to terminate the argument | |
371 (@pxref{Minibuffer}).@refill | |
372 | |
373 Emacs obeys the command by @dfn{visiting} the file: creating a buffer, | |
374 copying the contents of the file into the buffer, and then displaying | |
375 the buffer for you to edit. If you alter the text, you can @dfn{save} | |
376 the new text in the file by typing @kbd{C-x C-s} (@code{save-buffer}). | |
377 This makes the changes permanent by copying the altered buffer contents | |
68452 | 378 back into the file @file{test.emacs}. Until you save, the changes |
379 exist only inside Emacs, and the file @file{test.emacs} is unaltered. | |
25829 | 380 |
381 To create a file, just visit the file with @kbd{C-x C-f} as if it | |
382 already existed. This creates an empty buffer in which you can insert | |
383 the text you want to put in the file. The file is actually created when | |
384 you save this buffer with @kbd{C-x C-s}. | |
385 | |
386 Of course, there is a lot more to learn about using files. @xref{Files}. | |
387 | |
388 @node Basic Help | |
389 @section Help | |
390 | |
391 @cindex getting help with keys | |
392 If you forget what a key does, you can find out with the Help | |
393 character, which is @kbd{C-h} (or @key{F1}, which is an alias for | |
394 @kbd{C-h}). Type @kbd{C-h k} followed by the key you want to know | |
395 about; for example, @kbd{C-h k C-n} tells you all about what @kbd{C-n} | |
396 does. @kbd{C-h} is a prefix key; @kbd{C-h k} is just one of its | |
397 subcommands (the command @code{describe-key}). The other subcommands of | |
398 @kbd{C-h} provide different kinds of help. Type @kbd{C-h} twice to get | |
399 a description of all the help facilities. @xref{Help}.@refill | |
400 | |
401 @node Blank Lines | |
402 @section Blank Lines | |
403 | |
404 @cindex inserting blank lines | |
405 @cindex deleting blank lines | |
406 Here are special commands and techniques for putting in and taking out | |
407 blank lines. | |
408 | |
409 @table @kbd | |
410 @item C-o | |
411 Insert one or more blank lines after the cursor (@code{open-line}). | |
412 @item C-x C-o | |
413 Delete all but one of many consecutive blank lines | |
414 (@code{delete-blank-lines}). | |
415 @end table | |
416 | |
417 @kindex C-o | |
418 @kindex C-x C-o | |
419 @cindex blank lines | |
420 @findex open-line | |
421 @findex delete-blank-lines | |
422 When you want to insert a new line of text before an existing line, you | |
423 can do it by typing the new line of text, followed by @key{RET}. | |
424 However, it may be easier to see what you are doing if you first make a | |
425 blank line and then insert the desired text into it. This is easy to do | |
426 using the key @kbd{C-o} (@code{open-line}), which inserts a newline | |
427 after point but leaves point in front of the newline. After @kbd{C-o}, | |
428 type the text for the new line. @kbd{C-o F O O} has the same effect as | |
429 @w{@kbd{F O O @key{RET}}}, except for the final location of point. | |
430 | |
431 You can make several blank lines by typing @kbd{C-o} several times, or | |
432 by giving it a numeric argument to tell it how many blank lines to make. | |
62193
598f5ebd4f94
Various typo and grammar fixes.
Luc Teirlinck <teirllm@auburn.edu>
parents:
61100
diff
changeset
|
433 @xref{Arguments}, for how. If you have a fill prefix, the @kbd{C-o} |
25829 | 434 command inserts the fill prefix on the new line, when you use it at the |
435 beginning of a line. @xref{Fill Prefix}. | |
436 | |
437 The easy way to get rid of extra blank lines is with the command | |
438 @kbd{C-x C-o} (@code{delete-blank-lines}). @kbd{C-x C-o} in a run of | |
439 several blank lines deletes all but one of them. @kbd{C-x C-o} on a | |
440 solitary blank line deletes that blank line. When point is on a | |
441 nonblank line, @kbd{C-x C-o} deletes any blank lines following that | |
442 nonblank line. | |
443 | |
444 @node Continuation Lines | |
445 @section Continuation Lines | |
446 | |
447 @cindex continuation line | |
448 @cindex wrapping | |
449 @cindex line wrapping | |
42902
f83cc0d82951
(Continuation Lines): Add index entries for the fringe usage.
Eli Zaretskii <eliz@gnu.org>
parents:
42364
diff
changeset
|
450 @cindex fringes, and continuation lines |
25829 | 451 If you add too many characters to one line without breaking it with |
36140
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
452 @key{RET}, the line grows to occupy two (or more) lines on the screen. |
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
453 On graphical displays, Emacs indicates line wrapping with small bent |
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
454 arrows in the fringes to the left and right of the window. On |
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
455 text-only terminals, Emacs displays a @samp{\} character at the right |
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
456 margin of a screen line if it is not the last in its text line. This |
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
457 @samp{\} character says that the following screen line is not really a |
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
458 distinct line in the text, just a @dfn{continuation} of a line too |
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
459 long to fit the screen. Continuation is also called @dfn{line |
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
460 wrapping}. |
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
461 |
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
462 When line wrapping occurs before a character that is wider than one |
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
463 column, some columns at the end of the previous screen line may be |
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
464 ``empty.'' In this case, Emacs displays additional @samp{\} |
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
465 characters in the ``empty'' columns, just before the @samp{\} |
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
466 character that indicates continuation. |
25829 | 467 |
68464
79464a6167f5
* basic.texi (Continuation Lines, Inserting Text): Mention
Chong Yidong <cyd@stupidchicken.com>
parents:
68452
diff
changeset
|
468 Continued lines can be rather difficult to read, since each line is |
79464a6167f5
* basic.texi (Continuation Lines, Inserting Text): Mention
Chong Yidong <cyd@stupidchicken.com>
parents:
68452
diff
changeset
|
469 typically broken in the middle of a word. You can have Emacs insert a |
79464a6167f5
* basic.texi (Continuation Lines, Inserting Text): Mention
Chong Yidong <cyd@stupidchicken.com>
parents:
68452
diff
changeset
|
470 newline automatically when a line gets too long, by using Auto Fill |
79464a6167f5
* basic.texi (Continuation Lines, Inserting Text): Mention
Chong Yidong <cyd@stupidchicken.com>
parents:
68452
diff
changeset
|
471 mode. Another approach, intermediate between continued lines and Auto |
79464a6167f5
* basic.texi (Continuation Lines, Inserting Text): Mention
Chong Yidong <cyd@stupidchicken.com>
parents:
68452
diff
changeset
|
472 Fill mode, is Long Lines mode, which ensures that wrapping only occurs |
79464a6167f5
* basic.texi (Continuation Lines, Inserting Text): Mention
Chong Yidong <cyd@stupidchicken.com>
parents:
68452
diff
changeset
|
473 in the spaces between words. @xref{Filling}. |
25829 | 474 |
475 @cindex truncation | |
42902
f83cc0d82951
(Continuation Lines): Add index entries for the fringe usage.
Eli Zaretskii <eliz@gnu.org>
parents:
42364
diff
changeset
|
476 @cindex line truncation, and fringes |
68464
79464a6167f5
* basic.texi (Continuation Lines, Inserting Text): Mention
Chong Yidong <cyd@stupidchicken.com>
parents:
68452
diff
changeset
|
477 Emacs can also display long lines by @dfn{truncation}. This means |
79464a6167f5
* basic.texi (Continuation Lines, Inserting Text): Mention
Chong Yidong <cyd@stupidchicken.com>
parents:
68452
diff
changeset
|
478 that all the characters that do not fit in the width of the screen or |
79464a6167f5
* basic.texi (Continuation Lines, Inserting Text): Mention
Chong Yidong <cyd@stupidchicken.com>
parents:
68452
diff
changeset
|
479 window do not appear at all. @samp{$} in the last column or a small |
79464a6167f5
* basic.texi (Continuation Lines, Inserting Text): Mention
Chong Yidong <cyd@stupidchicken.com>
parents:
68452
diff
changeset
|
480 straight arrow in the fringe to the right of the window indicates a |
79464a6167f5
* basic.texi (Continuation Lines, Inserting Text): Mention
Chong Yidong <cyd@stupidchicken.com>
parents:
68452
diff
changeset
|
481 truncated line. |
25829 | 482 |
60102
8555807a4582
(Continuation Lines): Simplify description of truncation,
Richard M. Stallman <rms@gnu.org>
parents:
59959
diff
changeset
|
483 @xref{Display Custom}, for more information about line truncation, |
8555807a4582
(Continuation Lines): Simplify description of truncation,
Richard M. Stallman <rms@gnu.org>
parents:
59959
diff
changeset
|
484 and other variables that affect how text is displayed. |
25829 | 485 |
486 @node Position Info | |
487 @section Cursor Position Information | |
488 | |
489 Here are commands to get information about the size and position of | |
490 parts of the buffer, and to count lines. | |
491 | |
492 @table @kbd | |
493 @item M-x what-page | |
36140
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
494 Display the page number of point, and the line number within the page. |
25829 | 495 @item M-x what-line |
36140
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
496 Display the line number of point in the buffer. |
25829 | 497 @item M-x line-number-mode |
27220
dddb1bca9704
Reference column-number-mode, hl-line-mode, blink-cursor-mode.
Dave Love <fx@gnu.org>
parents:
25829
diff
changeset
|
498 @itemx M-x column-number-mode |
dddb1bca9704
Reference column-number-mode, hl-line-mode, blink-cursor-mode.
Dave Love <fx@gnu.org>
parents:
25829
diff
changeset
|
499 Toggle automatic display of current line number or column number. |
dddb1bca9704
Reference column-number-mode, hl-line-mode, blink-cursor-mode.
Dave Love <fx@gnu.org>
parents:
25829
diff
changeset
|
500 @xref{Optional Mode Line}. |
25829 | 501 @item M-= |
36140
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
502 Display the number of lines in the current region (@code{count-lines-region}). |
25829 | 503 @xref{Mark}, for information about the region. |
504 @item C-x = | |
36140
af4e219e9947
Miscellaneous clarifications.
Richard M. Stallman <rms@gnu.org>
parents:
35923
diff
changeset
|
505 Display the character code of character after point, character position of |
25829 | 506 point, and column of point (@code{what-cursor-position}). |
27220
dddb1bca9704
Reference column-number-mode, hl-line-mode, blink-cursor-mode.
Dave Love <fx@gnu.org>
parents:
25829
diff
changeset
|
507 @item M-x hl-line-mode |
38660
65fd4c8a6447
(Position Info): Add a cross-reference to where hl-line-mode is described.
Eli Zaretskii <eliz@gnu.org>
parents:
38541
diff
changeset
|
508 Enable or disable highlighting of the current line. @xref{Cursor |
65fd4c8a6447
(Position Info): Add a cross-reference to where hl-line-mode is described.
Eli Zaretskii <eliz@gnu.org>
parents:
38541
diff
changeset
|
509 Display}. |
52462
b118cda42fa3
(Position Info): Mention `size-indication-mode'.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
510 @item M-x size-indication-mode |
b118cda42fa3
(Position Info): Mention `size-indication-mode'.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
511 Toggle automatic display of the size of the buffer. |
b118cda42fa3
(Position Info): Mention `size-indication-mode'.
Lute Kamstra <lute@gnu.org>
parents:
52401
diff
changeset
|
512 @xref{Optional Mode Line}. |
25829 | 513 @end table |
514 | |
515 @findex what-page | |
516 @findex what-line | |
517 @cindex line number commands | |
518 @cindex location of point | |
519 @cindex cursor location | |
520 @cindex point location | |
62338
9d25647627a1
(Moving Point): Mention `M-g g' binding for goto-line.
Luc Teirlinck <teirllm@auburn.edu>
parents:
62207
diff
changeset
|
521 @kbd{M-x what-line} computes the current line number and displays it |
9d25647627a1
(Moving Point): Mention `M-g g' binding for goto-line.
Luc Teirlinck <teirllm@auburn.edu>
parents:
62207
diff
changeset
|
522 in the echo area. You can also see the current line number in the |
9d25647627a1
(Moving Point): Mention `M-g g' binding for goto-line.
Luc Teirlinck <teirllm@auburn.edu>
parents:
62207
diff
changeset
|
523 mode line; see @ref{Mode Line}. If you narrow the buffer, then the |
9d25647627a1
(Moving Point): Mention `M-g g' binding for goto-line.
Luc Teirlinck <teirllm@auburn.edu>
parents:
62207
diff
changeset
|
524 line number in the mode line is relative to the accessible portion |
9d25647627a1
(Moving Point): Mention `M-g g' binding for goto-line.
Luc Teirlinck <teirllm@auburn.edu>
parents:
62207
diff
changeset
|
525 (@pxref{Narrowing}). By contrast, @code{what-line} shows both the |
9d25647627a1
(Moving Point): Mention `M-g g' binding for goto-line.
Luc Teirlinck <teirllm@auburn.edu>
parents:
62207
diff
changeset
|
526 line number relative to the narrowed region and the line number |
9d25647627a1
(Moving Point): Mention `M-g g' binding for goto-line.
Luc Teirlinck <teirllm@auburn.edu>
parents:
62207
diff
changeset
|
527 relative to the whole buffer. |
25829 | 528 |
37152 | 529 @kbd{M-x what-page} counts pages from the beginning of the file, and |
38870
d44abb4e68b2
Don't use "print" for displaying a message.
Richard M. Stallman <rms@gnu.org>
parents:
38767
diff
changeset
|
530 counts lines within the page, showing both numbers in the echo area. |
d44abb4e68b2
Don't use "print" for displaying a message.
Richard M. Stallman <rms@gnu.org>
parents:
38767
diff
changeset
|
531 @xref{Pages}. |
25829 | 532 |
533 @kindex M-= | |
534 @findex count-lines-region | |
535 While on this subject, we might as well mention @kbd{M-=} (@code{count-lines-region}), | |
38870
d44abb4e68b2
Don't use "print" for displaying a message.
Richard M. Stallman <rms@gnu.org>
parents:
38767
diff
changeset
|
536 which displays the number of lines in the region (@pxref{Mark}). |
25829 | 537 @xref{Pages}, for the command @kbd{C-x l} which counts the lines in the |
538 current page. | |
539 | |
540 @kindex C-x = | |
541 @findex what-cursor-position | |
46040
3c219fd68a91
Update info on C-u C-x =.
Richard M. Stallman <rms@gnu.org>
parents:
45721
diff
changeset
|
542 The command @kbd{C-x =} (@code{what-cursor-position}) shows what |
3c219fd68a91
Update info on C-u C-x =.
Richard M. Stallman <rms@gnu.org>
parents:
45721
diff
changeset
|
543 column the cursor is in, and other miscellaneous information about |
3c219fd68a91
Update info on C-u C-x =.
Richard M. Stallman <rms@gnu.org>
parents:
45721
diff
changeset
|
544 point and the character after it. It displays a line in the echo area |
3c219fd68a91
Update info on C-u C-x =.
Richard M. Stallman <rms@gnu.org>
parents:
45721
diff
changeset
|
545 that looks like this: |
25829 | 546 |
547 @smallexample | |
67040
4c99ea8adc42
(Position Info): Update examples of the output.
Juri Linkov <juri@jurta.org>
parents:
66061
diff
changeset
|
548 Char: c (99, #o143, #x63) point=28062 of 36168 (78%) column=53 |
25829 | 549 @end smallexample |
550 | |
551 The four values after @samp{Char:} describe the character that follows | |
552 point, first by showing it and then by giving its character code in | |
67040
4c99ea8adc42
(Position Info): Update examples of the output.
Juri Linkov <juri@jurta.org>
parents:
66061
diff
changeset
|
553 decimal, octal and hex. For a non-@acronym{ASCII} multibyte character, these are |
66051
ef089f655621
(Position Info): Describe the case that Emacs shows
Kenichi Handa <handa@m17n.org>
parents:
64890
diff
changeset
|
554 followed by @samp{file} and the character's representation, in hex, in |
25829 | 555 the buffer's coding system, if that coding system encodes the character |
556 safely and with a single byte (@pxref{Coding Systems}). If the | |
66051
ef089f655621
(Position Info): Describe the case that Emacs shows
Kenichi Handa <handa@m17n.org>
parents:
64890
diff
changeset
|
557 character's encoding is longer than one byte, Emacs shows @samp{file ...}. |
ef089f655621
(Position Info): Describe the case that Emacs shows
Kenichi Handa <handa@m17n.org>
parents:
64890
diff
changeset
|
558 |
ef089f655621
(Position Info): Describe the case that Emacs shows
Kenichi Handa <handa@m17n.org>
parents:
64890
diff
changeset
|
559 However, if the character displayed is in the range 0200 through |
66061
7fb814227358
(Position Info): Fix previous change.
Kenichi Handa <handa@m17n.org>
parents:
66051
diff
changeset
|
560 0377 octal, it may actually stand for an invalid UTF-8 byte read from |
7fb814227358
(Position Info): Fix previous change.
Kenichi Handa <handa@m17n.org>
parents:
66051
diff
changeset
|
561 a file. In Emacs, that byte is represented as a sequence of 8-bit |
7fb814227358
(Position Info): Fix previous change.
Kenichi Handa <handa@m17n.org>
parents:
66051
diff
changeset
|
562 characters, but all of them together display as the original invalid |
7fb814227358
(Position Info): Fix previous change.
Kenichi Handa <handa@m17n.org>
parents:
66051
diff
changeset
|
563 byte, in octal code. In this case, @kbd{C-x =} shows @samp{part of |
7fb814227358
(Position Info): Fix previous change.
Kenichi Handa <handa@m17n.org>
parents:
66051
diff
changeset
|
564 display ...} instead of @samp{file}. |
25829 | 565 |
566 @samp{point=} is followed by the position of point expressed as a character | |
567 count. The front of the buffer counts as position 1, one character later | |
568 as 2, and so on. The next, larger, number is the total number of characters | |
569 in the buffer. Afterward in parentheses comes the position expressed as a | |
570 percentage of the total size. | |
571 | |
67040
4c99ea8adc42
(Position Info): Update examples of the output.
Juri Linkov <juri@jurta.org>
parents:
66061
diff
changeset
|
572 @samp{column=} is followed by the horizontal position of point, in |
25829 | 573 columns from the left edge of the window. |
574 | |
575 If the buffer has been narrowed, making some of the text at the | |
38870
d44abb4e68b2
Don't use "print" for displaying a message.
Richard M. Stallman <rms@gnu.org>
parents:
38767
diff
changeset
|
576 beginning and the end temporarily inaccessible, @kbd{C-x =} displays |
25829 | 577 additional text describing the currently accessible range. For example, it |
578 might display this: | |
579 | |
580 @smallexample | |
67040
4c99ea8adc42
(Position Info): Update examples of the output.
Juri Linkov <juri@jurta.org>
parents:
66061
diff
changeset
|
581 Char: C (67, #o103, #x43) point=252 of 889 (28%) <231-599> column=0 |
25829 | 582 @end smallexample |
583 | |
584 @noindent | |
585 where the two extra numbers give the smallest and largest character | |
586 position that point is allowed to assume. The characters between those | |
587 two positions are the accessible ones. @xref{Narrowing}. | |
588 | |
589 If point is at the end of the buffer (or the end of the accessible | |
590 part), the @w{@kbd{C-x =}} output does not describe a character after | |
591 point. The output might look like this: | |
592 | |
593 @smallexample | |
67040
4c99ea8adc42
(Position Info): Update examples of the output.
Juri Linkov <juri@jurta.org>
parents:
66061
diff
changeset
|
594 point=36169 of 36168 (EOB) column=0 |
25829 | 595 @end smallexample |
596 | |
44875
cc99f1248f49
(Position Info): Add text properties to the example. Add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
43468
diff
changeset
|
597 @cindex character set of character at point |
45313
39adae4ad3df
(Position Info): Add an index entry for font at point.
Eli Zaretskii <eliz@gnu.org>
parents:
44875
diff
changeset
|
598 @cindex font of character at point |
44875
cc99f1248f49
(Position Info): Add text properties to the example. Add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
43468
diff
changeset
|
599 @cindex text properties at point |
62193
598f5ebd4f94
Various typo and grammar fixes.
Luc Teirlinck <teirllm@auburn.edu>
parents:
61100
diff
changeset
|
600 @w{@kbd{C-u C-x =}} displays the following additional information about a |
61066
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
601 character. |
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
602 |
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
603 @itemize @bullet |
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
604 @item |
61100
9d57acce20e8
(Position Info): Minor cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
61066
diff
changeset
|
605 The character set name, and the codes that identify the character |
61066
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
606 within that character set; @acronym{ASCII} characters are identified |
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
607 as belonging to the @code{ascii} character set. |
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
608 |
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
609 @item |
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
610 The character's syntax and categories. |
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
611 |
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
612 @item |
61100
9d57acce20e8
(Position Info): Minor cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
61066
diff
changeset
|
613 The character's encodings, both internally in the buffer, and externally |
9d57acce20e8
(Position Info): Minor cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
61066
diff
changeset
|
614 if you were to save the file. |
61066
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
615 |
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
616 @item |
61100
9d57acce20e8
(Position Info): Minor cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
61066
diff
changeset
|
617 What to type to input the character in the current input method |
9d57acce20e8
(Position Info): Minor cleanup.
Richard M. Stallman <rms@gnu.org>
parents:
61066
diff
changeset
|
618 (if it supports the character). |
61066
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
619 |
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
620 @item |
68685
4bb94c09a47d
(Position Info): "Graphical displays", rather than window systems.
Richard M. Stallman <rms@gnu.org>
parents:
68639
diff
changeset
|
621 If you are running Emacs on a graphical display, the font name and |
4bb94c09a47d
(Position Info): "Graphical displays", rather than window systems.
Richard M. Stallman <rms@gnu.org>
parents:
68639
diff
changeset
|
622 glyph code for the character. If you are running Emacs on a text-only |
4bb94c09a47d
(Position Info): "Graphical displays", rather than window systems.
Richard M. Stallman <rms@gnu.org>
parents:
68639
diff
changeset
|
623 terminal, the code(s) sent to the terminal. |
61066
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
624 |
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
625 @item |
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
626 The character's text properties (@pxref{Text Properties,,, |
46040
3c219fd68a91
Update info on C-u C-x =.
Richard M. Stallman <rms@gnu.org>
parents:
45721
diff
changeset
|
627 elisp, the Emacs Lisp Reference Manual}), and any overlays containing it |
3c219fd68a91
Update info on C-u C-x =.
Richard M. Stallman <rms@gnu.org>
parents:
45721
diff
changeset
|
628 (@pxref{Overlays,,, elisp, the same manual}). |
61066
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
629 @end itemize |
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
630 |
42364
c66f34e7d2cd
Update C-u C-x = output format.
Richard M. Stallman <rms@gnu.org>
parents:
39287
diff
changeset
|
631 Here's an example showing the Latin-1 character A with grave accent, |
61066
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
632 in a buffer whose coding system is @code{iso-latin-1}, whose |
42364
c66f34e7d2cd
Update C-u C-x = output format.
Richard M. Stallman <rms@gnu.org>
parents:
39287
diff
changeset
|
633 terminal coding system is @code{iso-latin-1} (so the terminal actually |
44875
cc99f1248f49
(Position Info): Add text properties to the example. Add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
43468
diff
changeset
|
634 displays the character as @samp{@`A}), and which has font-lock-mode |
cc99f1248f49
(Position Info): Add text properties to the example. Add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
43468
diff
changeset
|
635 (@pxref{Font Lock}) enabled: |
25829 | 636 |
37152 | 637 @smallexample |
67040
4c99ea8adc42
(Position Info): Update examples of the output.
Juri Linkov <juri@jurta.org>
parents:
66061
diff
changeset
|
638 character: @`A (2240, #o4300, #x8c0, U+00C0) |
67918
c14267a3323d
(Position Info): Update example.
Juri Linkov <juri@jurta.org>
parents:
67040
diff
changeset
|
639 charset: latin-iso8859-1 |
61066
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
640 (Right-Hand Part of Latin Alphabet 1@dots{} |
67918
c14267a3323d
(Position Info): Update example.
Juri Linkov <juri@jurta.org>
parents:
67040
diff
changeset
|
641 code point: #x40 |
61066
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
642 syntax: w which means: word |
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
643 category: l:Latin |
67918
c14267a3323d
(Position Info): Update example.
Juri Linkov <juri@jurta.org>
parents:
67040
diff
changeset
|
644 to input: type "`A" with latin-1-prefix |
67040
4c99ea8adc42
(Position Info): Update examples of the output.
Juri Linkov <juri@jurta.org>
parents:
66061
diff
changeset
|
645 buffer code: #x81 #xC0 |
67918
c14267a3323d
(Position Info): Update example.
Juri Linkov <juri@jurta.org>
parents:
67040
diff
changeset
|
646 file code: #xC0 (encoded by coding system iso-latin-1) |
67040
4c99ea8adc42
(Position Info): Update examples of the output.
Juri Linkov <juri@jurta.org>
parents:
66061
diff
changeset
|
647 display: terminal code #xC0 |
44875
cc99f1248f49
(Position Info): Add text properties to the example. Add index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
43468
diff
changeset
|
648 |
61066
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
649 There are text properties here: |
bf195b369bc1
(Position Info): Update the description about the
Kenichi Handa <handa@m17n.org>
parents:
60788
diff
changeset
|
650 fontified t |
37152 | 651 @end smallexample |
25829 | 652 |
653 @node Arguments | |
654 @section Numeric Arguments | |
655 @cindex numeric arguments | |
656 @cindex prefix arguments | |
36263
11db0318031d
Remove redundant index entries.
Eli Zaretskii <eliz@gnu.org>
parents:
36209
diff
changeset
|
657 @cindex arguments to commands |
25829 | 658 |
659 In mathematics and computer usage, the word @dfn{argument} means | |
660 ``data provided to a function or operation.'' You can give any Emacs | |
661 command a @dfn{numeric argument} (also called a @dfn{prefix argument}). | |
662 Some commands interpret the argument as a repetition count. For | |
663 example, @kbd{C-f} with an argument of ten moves forward ten characters | |
664 instead of one. With these commands, no argument is equivalent to an | |
665 argument of one. Negative arguments tell most such commands to move or | |
666 act in the opposite direction. | |
667 | |
668 @kindex M-1 | |
669 @kindex M-@t{-} | |
670 @findex digit-argument | |
671 @findex negative-argument | |
59947
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
672 If your terminal keyboard has a @key{META} key (labeled @key{ALT} on |
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
673 PC keyboards), the easiest way to specify a numeric argument is to |
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
674 type digits and/or a minus sign while holding down the @key{META} key. |
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
675 For example, |
38729
7d62f0684e99
(Arguments): Say explicitly that M-- is -1. Fix spacing in an @example.
Eli Zaretskii <eliz@gnu.org>
parents:
38660
diff
changeset
|
676 |
25829 | 677 @example |
678 M-5 C-n | |
679 @end example | |
38729
7d62f0684e99
(Arguments): Say explicitly that M-- is -1. Fix spacing in an @example.
Eli Zaretskii <eliz@gnu.org>
parents:
38660
diff
changeset
|
680 |
25829 | 681 @noindent |
682 would move down five lines. The characters @kbd{Meta-1}, @kbd{Meta-2}, | |
683 and so on, as well as @kbd{Meta--}, do this because they are keys bound | |
684 to commands (@code{digit-argument} and @code{negative-argument}) that | |
38729
7d62f0684e99
(Arguments): Say explicitly that M-- is -1. Fix spacing in an @example.
Eli Zaretskii <eliz@gnu.org>
parents:
38660
diff
changeset
|
685 are defined to contribute to an argument for the next command. |
7d62f0684e99
(Arguments): Say explicitly that M-- is -1. Fix spacing in an @example.
Eli Zaretskii <eliz@gnu.org>
parents:
38660
diff
changeset
|
686 @kbd{Meta--} without digits normally means @minus{}1. Digits and |
7d62f0684e99
(Arguments): Say explicitly that M-- is -1. Fix spacing in an @example.
Eli Zaretskii <eliz@gnu.org>
parents:
38660
diff
changeset
|
687 @kbd{-} modified with Control, or Control and Meta, also specify numeric |
7d62f0684e99
(Arguments): Say explicitly that M-- is -1. Fix spacing in an @example.
Eli Zaretskii <eliz@gnu.org>
parents:
38660
diff
changeset
|
688 arguments. |
25829 | 689 |
690 @kindex C-u | |
691 @findex universal-argument | |
692 Another way of specifying an argument is to use the @kbd{C-u} | |
693 (@code{universal-argument}) command followed by the digits of the | |
694 argument. With @kbd{C-u}, you can type the argument digits without | |
695 holding down modifier keys; @kbd{C-u} works on all terminals. To type a | |
696 negative argument, type a minus sign after @kbd{C-u}. Just a minus sign | |
697 without digits normally means @minus{}1. | |
698 | |
68452 | 699 @kbd{C-u} without digits or minus sign has the special meaning of |
700 ``four times'': it multiplies the argument for the next command by | |
701 four. @kbd{C-u C-u} multiplies it by sixteen. Thus, @kbd{C-u C-u | |
702 C-f} moves forward sixteen characters. This is a good way to move | |
703 forward ``fast,'' since it moves about 1/5 of a line in the usual size | |
704 screen. Other useful combinations are @kbd{C-u C-n}, @kbd{C-u C-u | |
705 C-n} (move down a good fraction of a screen), @kbd{C-u C-u C-o} (make | |
706 ``a lot'' of blank lines), and @kbd{C-u C-k} (kill four lines).@refill | |
25829 | 707 |
708 Some commands care only about whether there is an argument, and not about | |
709 its value. For example, the command @kbd{M-q} (@code{fill-paragraph}) with | |
710 no argument fills text; with an argument, it justifies the text as well. | |
711 (@xref{Filling}, for more information on @kbd{M-q}.) Plain @kbd{C-u} is a | |
712 handy way of providing an argument for such commands. | |
713 | |
714 Some commands use the value of the argument as a repeat count, but do | |
715 something peculiar when there is no argument. For example, the command | |
716 @kbd{C-k} (@code{kill-line}) with argument @var{n} kills @var{n} lines, | |
717 including their terminating newlines. But @kbd{C-k} with no argument is | |
718 special: it kills the text up to the next newline, or, if point is right at | |
719 the end of the line, it kills the newline itself. Thus, two @kbd{C-k} | |
720 commands with no arguments can kill a nonblank line, just like @kbd{C-k} | |
721 with an argument of one. (@xref{Killing}, for more information on | |
722 @kbd{C-k}.)@refill | |
723 | |
724 A few commands treat a plain @kbd{C-u} differently from an ordinary | |
725 argument. A few others may treat an argument of just a minus sign | |
726 differently from an argument of @minus{}1. These unusual cases are | |
59947
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
727 described when they come up; they are always for reasons of |
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
728 convenience of use of the individual command, and they are documented |
801aa21b27e9
(Inserting Text): Cleanup wording.
Richard M. Stallman <rms@gnu.org>
parents:
59883
diff
changeset
|
729 in the command's documentation string. |
25829 | 730 |
731 You can use a numeric argument to insert multiple copies of a | |
732 character. This is straightforward unless the character is a digit; for | |
733 example, @kbd{C-u 6 4 a} inserts 64 copies of the character @samp{a}. | |
734 But this does not work for inserting digits; @kbd{C-u 6 4 1} specifies | |
735 an argument of 641, rather than inserting anything. To separate the | |
736 digit to insert from the argument, type another @kbd{C-u}; for example, | |
737 @kbd{C-u 6 4 C-u 1} does insert 64 copies of the character @samp{1}. | |
738 | |
739 We use the term ``prefix argument'' as well as ``numeric argument'' to | |
740 emphasize that you type the argument before the command, and to | |
741 distinguish these arguments from minibuffer arguments that come after | |
742 the command. | |
743 | |
744 @node Repeating | |
745 @section Repeating a Command | |
746 @cindex repeating a command | |
747 | |
38738 | 748 Many simple commands, such as those invoked with a single key or |
749 with @kbd{M-x @var{command-name} @key{RET}}, can be repeated by | |
750 invoking them with a numeric argument that serves as a repeat count | |
751 (@pxref{Arguments}). However, if the command you want to repeat | |
752 prompts for some input, or uses a numeric argument in another way, | |
753 repetition using a numeric argument might be problematical. | |
38541
2540b694650b
(Repeating): Mention the numeric argument as another form of repetition,
Eli Zaretskii <eliz@gnu.org>
parents:
38172
diff
changeset
|
754 |
25829 | 755 @kindex C-x z |
756 @findex repeat | |
757 The command @kbd{C-x z} (@code{repeat}) provides another way to repeat | |
758 an Emacs command many times. This command repeats the previous Emacs | |
759 command, whatever that was. Repeating a command uses the same arguments | |
760 that were used before; it does not read new arguments each time. | |
761 | |
762 To repeat the command more than once, type additional @kbd{z}'s: each | |
763 @kbd{z} repeats the command one more time. Repetition ends when you | |
764 type a character other than @kbd{z}, or press a mouse button. | |
765 | |
766 For example, suppose you type @kbd{C-u 2 0 C-d} to delete 20 | |
767 characters. You can repeat that command (including its argument) three | |
768 additional times, to delete a total of 80 characters, by typing @kbd{C-x | |
769 z z z}. The first @kbd{C-x z} repeats the command once, and each | |
770 subsequent @kbd{z} repeats it once again. | |
771 | |
52401 | 772 @ignore |
773 arch-tag: cda8952a-c439-41c1-aecf-4bc0d6482956 | |
774 @end ignore |