annotate etc/TUTORIAL @ 450:98528da0b7fc r21-2-40

Import from CVS: tag r21-2-40
author cvs
date Mon, 13 Aug 2007 11:39:20 +0200
parents 3ecd8885ac67
children abac34c62a39
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 Copyright (c) 1985, 1996 Free Software Foundation, Inc. See end for conditions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 You are looking at the Emacs tutorial.
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 Emacs commands generally involve the CONTROL key (sometimes labelled
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 CTRL or CTL) or the META key. On some keyboards, the META key is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 labelled ALT or EDIT or something else (for example, on Sun keyboards,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 the diamond key to the left of the spacebar is META). If you have no
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 META key, you can use ESC instead. Rather than write out META or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 CONTROL each time we want you to prefix a character, we'll use the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 following abbreviations:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 C-<chr> means hold the CONTROL key while typing the character <chr>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 Thus, C-f would be: hold the CONTROL key and type f.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 M-<chr> means hold the META key down while typing <chr>. If there
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 is no META key, type <ESC>, release it, then type the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 character <chr>.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 Important note: to end the Emacs session, type C-x C-c. (Two characters.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 The characters ">>" at the left margin indicate directions for you to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 try using a command. For instance:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 <<Middle of page left blank for didactic purposes. Text continues below.>>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 >> Now type C-v (View next screen) to move to the next screen.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 (go ahead, do it by holding down the control key while typing v).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 From now on, you should do this again whenever you finish
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 reading the screen.
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 Note that there is an overlap of two lines when you move from screen
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 to screen; this provides some continuity so you can continue reading
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 the text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 The first thing that you need to know is how to move around from place
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 to place in the text. You already know how to move forward one screen,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 with C-v. To move backwards one screen, type M-v (hold down the META key
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 and type v, or type <ESC>v if you do not have a META, EDIT, or ALT key).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 >> Try typing M-v and then C-v, a few times.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 * SUMMARY
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 ---------
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 The following commands are useful for viewing screenfuls:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 C-v Move forward one screenful
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 M-v Move backward one screenful
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 C-l Clear screen and redisplay everything
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 putting the text near the cursor at the center.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 (That's control-L, not control-1.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 >> Find the cursor, and note what text is near it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 Then type C-l.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 Find the cursor again and notice that the same text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 is near the cursor now.
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
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 * BASIC CURSOR CONTROL
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 ----------------------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 Moving from screenful to screenful is useful, but how do you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 move to a specific place within the text on the screen?
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 There are several ways you can do this. The most basic way is to use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 the commands C-p, C-b, C-f, and C-n. Each of these commands moves the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 cursor one row or column in a particular direction on the screen.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 Here is a table showing these four commands and shows the directions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 they move:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 Previous line, C-p
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 :
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 :
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 Backward, C-b .... Current cursor position .... Forward, C-f
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 :
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 Next line, C-n
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 >> Move the cursor to the line in the middle of that diagram
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 using C-n or C-p. Then type C-l to see the whole diagram
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 centered in the screen.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 You'll probably find it easy to think of these by letter: P for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 previous, N for next, B for backward and F for forward. These are the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 basic cursor positioning commands, and you'll be using them ALL the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 time, so it would be of great benefit if you learn them now.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 >> Do a few C-n's to bring the cursor down to this line.
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 >> Move into the line with C-f's and then up with C-p's.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 See what C-p does when the cursor is in the middle of the line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 Each of text line ends with a Newline character, which serves to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 separate it from the following line. The last line in your file ought
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 to have a Newline at the end (but Emacs does not require it to have
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 one).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 >> Try to C-b at the beginning of a line. It should move to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 the end of the previous line. This is because it moves back
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 across the Newline character.
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 C-f can move across a Newline just like C-b.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 >> Do a few more C-b's, so you get a feel for where the cursor is.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 Then do C-f's to return to the end of the line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 Then do one more C-f to move to the following line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 When you move past the top or bottom of the screen, the text beyond
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 the edge shifts onto the screen. This is called "scrolling". It
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 enables Emacs to move the cursor to the specified place in the text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 without moving it off the screen.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 >> Try to move the cursor off the bottom of the screen with C-n, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 see what happens.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 If moving by characters is too slow, you can move by words. M-f
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 (Meta-f) moves forward a word and M-b moves back a word.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 >> Type a few M-f's and M-b's.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 When you are in the middle of a word, M-f moves to the end of the word.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 When you are in whitespace between words, M-f moves to the end of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 following word. M-b works likewise in the opposite direction.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 >> Type M-f and M-b a few times, interspersed with C-f's and C-b's
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 so that you can observe the action of M-f and M-b from various
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 places inside and between words.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 Notice the parallel between C-f and C-b on the one hand, and M-f and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 M-b on the other hand. Very often Meta characters are used for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 operations related to the units defined by language (words, sentences,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 paragraphs), while Control characters operate on basic units that are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 independent of what you are editing (characters, lines, etc).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 This parallel applies between lines and sentences: C-a and C-e move to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 the beginning or end of a line, and M-a and M-e move to the beginning
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 or end of a sentence.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 >> Try a couple of C-a's, and then a couple of C-e's.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 Try a couple of M-a's, and then a couple of M-e's.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 See how repeated C-a's do nothing, but repeated M-a's keep moving one
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 more sentence. Although these are not quite analogous, each one seems
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 natural.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144 The location of the cursor in the text is also called "point". To
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 paraphrase, the cursor shows on the screen where point is located in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146 the text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148 Here is a summary of simple cursor-moving operations, including the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 word and sentence moving commands:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 C-f Move forward a character
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152 C-b Move backward a character
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 M-f Move forward a word
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155 M-b Move backward a word
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157 C-n Move to next line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 C-p Move to previous line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160 C-a Move to beginning of line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 C-e Move to end of line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 M-a Move back to beginning of sentence
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 M-e Move forward to end of sentence
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 >> Try all of these commands now a few times for practice.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 These are the most often used commands.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169 Two other important cursor motion commands are M-< (Meta Less-than),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 which moves to the beginning of the whole text, and M-> (Meta
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 Greater-than), which moves to the end of the whole text.
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 On most terminals, the "<" is above the comma, so you must use the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 shift key to type it. On these terminals you must use the shift key
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 to type M-< also; without the shift key, you would be typing M-comma.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177 >> Try M-< now, to move to the beginning of the tutorial.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 Then use C-v repeatedly to move back here.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180 >> Try M-> now, to move to the end of the tutorial.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 Then use M-v repeatedly to move back here.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 You can also move the cursor with the arrow keys, if your terminal has
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 arrow keys. We recommend learning C-b, C-f, C-n and C-p for three
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185 reasons. First, they work on all kinds of terminals. Second, once
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 you gain practice at using Emacs, you will find that typing these CTRL
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 characters is faster than typing the arrow keys (because you do not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 have to move your hands away from touch-typing position). Third, once
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 you form the habit of using these CTRL character commands, you can
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 easily learn to use other advanced cursor motion commands as well.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 Most Emacs commands accept a numeric argument; for most commands, this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 serves as a repeat-count. The way you give a command a repeat count
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 is by typing C-u and then the digits before you type the command. If
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 you have a META (or EDIT or ALT) key, there is another alternative way
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 to enter a numeric argument: type the digits while holding down the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 META key. We recommend learning the C-u method because it works on
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 any terminal.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200 For instance, C-u 8 C-f moves forward eight characters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 >> Try using C-n or C-p with a numeric argument, to move the cursor
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203 to a line near this one with just one command.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 Most commands use the numeric argument as a repeat count. Certain
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206 exceptional commands use it differently. C-v and M-v are among the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 exceptions. When given an argument, they scroll the screen up or down
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 by that many lines, rather than by a screenfuls. For example, C-u 4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 C-v scrolls the screen by 4 lines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
211 >> Try typing C-u 8 C-v now.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
212
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
213 This should have scrolled the screen up by 8 lines. If you would like
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
214 to scroll it down again, you can give an argument to M-v.
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 If you are using the X Window system, there is probably a rectangular
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 area called a scroll bar at the right hand side of the Emacs window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 You can scroll the text by manipulating the scroll bar with the mouse.
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 >> Try pressing the middle button at the top of the highlighted area
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 within the scroll bar. This should scroll the text to a position
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 determined by how high or low you click.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
224 >> Move the mouse to a point in the scroll bar about three lines from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
225 the top, and click the left button a couple of times.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
228 * CURSOR CONTROL WITH AN X TERMINAL
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
229 -----------------------------------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231 If you have an X terminal, you will probably find it easier to use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232 the keys on the keypad to control the cursor. The left, right, up,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233 and down arrow keys move in the expected direction; they function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 exactly like C-b, C-f, C-p, and C-n, but are easier to type and to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 remember. You can also use C-left and C-right to move by words, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 C-up and C-down to move by blocks (e.g. paragraphs, if you're
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 editing text). If you have keys labelled HOME (or BEGIN) and END,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 they will take you to the beginning and end of a line, respectively,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
239 and C-home and C-end will move to the beginning and end of the file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
240 If your keyboard has PgUp and PgDn keys, you can use them to move up
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
241 and down a screenful at a time, like M-v and C-v.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
242
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
243 All of these commands can take numeric arguments, as described above.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
244 You can use a shortcut to enter these arguments: just hold down the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 CONTROL or META key and type the number. For example, to move 12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 words to the right, type C-1 C-2 C-right. Note that it is very easy
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 to type this because you do not have to release the CONTROL key
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 between keystrokes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 * WHEN EMACS IS HUNG
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 --------------------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 If Emacs stops responding to your commands, you can stop it safely by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
255 typing C-g. You can use C-g to stop a command which is taking too
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
256 long to execute.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
257
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
258 You can also use C-g to discard a numeric argument or the beginning of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
259 a command that you do not want to finish.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
260
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 >> Type C-u 100 to make a numeric arg of 100, then type C-g.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 Now type C-f. It should move just one character,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263 because you canceled the argument with C-g.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 If you have typed an <ESC> by mistake, you can get rid of it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 with a C-g.
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
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
269 * DISABLED COMMANDS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270 -------------------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272 Some Emacs commands are "disabled" so that beginning users cannot use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273 them by accident.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 If you type one of the disabled commands, Emacs displays a message
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276 saying what the command was, and asking you whether you want to go
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 ahead and execute the command.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 If you really want to try the command, type Space in answer to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 question. Normally, if you do not want to execute the disabled
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281 command, answer the question with "n".
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 >> Type `C-x n p' (which is a disabled command),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 then type n to answer the question.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 * WINDOWS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 ---------
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 Emacs can have several windows, each displaying its own text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 Note that "window" as used by Emacs does not refer to separate
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 overlapping windows in the window system, but to separate panes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293 within a single X window. (Emacs can also have multiple X
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 windows, or "frames" in Emacs terminology. This is described
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 later.)
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 At this stage it is better not to go into the techniques of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 using multiple windows. But you do need to know how to get
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299 rid of extra windows that may appear to display help or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300 output from certain commands. It is simple:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302 C-x 1 One window (i.e., kill all other windows).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 That is Control-x followed by the digit 1. C-x 1 expands the window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 which contains the cursor, to occupy the full screen. It deletes all
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 other windows.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308 >> Move the cursor to this line and type C-u 0 C-l.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 (Remember that C-l redraws the screen. If you give a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 numeric argument to this command, it means "redraw the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 screen and put the current line that many lines from the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 top of the screen." So C-u 0 C-l means "redraw the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 screen, putting the current line at the top.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316 >> Type Control-x 2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 See how this window shrinks, while a new one appears
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 to display contents of this buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320 >> Type C-x 1 and see the new window disappear.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323 * INSERTING AND DELETING
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 ------------------------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 If you want to insert text, just type the text. Characters which you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327 can see, such as A, 7, *, etc. are taken by Emacs as text and inserted
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 immediately. Type <Return> (the carriage-return key) to insert a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329 Newline character.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331 You can delete the last character you typed by typing <Delete>.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
332 <Delete> is a key on the keyboard, which may be labeled "Del". In
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333 some cases, the "Backspace" key serves as <Delete>, but not always!
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
334
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
335 More generally, <Delete> deletes the character immediately before the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
336 current cursor position.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
337
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
338 >> Do this now--type a few characters, then delete them
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339 by typing <Delete> a few times. Don't worry about this file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340 being changed; you will not alter the master tutorial. This is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
341 your personal copy of it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
342
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343 When a line of text gets too big for one line on the screen, the line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
344 of text is "continued" onto a second screen line. A backslash ("\")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
345 at the right margin indicates a line which has been continued.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347 >> Insert text until you reach the right margin, and keep on inserting.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348 You'll see a continuation line appear.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
350 >> Use <Delete>s to delete the text until the line fits on one screen
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
351 line again. The continuation line goes away.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353 You can delete a Newline character just like any other character.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354 Deleting the Newline character between two lines merges them into
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355 one line. If the resulting combined line is too long to fit in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356 screen width, it will be displayed with a continuation line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
358 >> Move the cursor to the beginning of a line and type <Delete>. This
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 merges that line with the previous line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361 >> Type <Return> to reinsert the Newline you deleted.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363 Remember that most Emacs commands can be given a repeat count;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364 this includes text characters. Repeating a text character inserts
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365 it several times.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 >> Try that now -- type C-u 8 * to insert ********.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
369 You've now learned the most basic way of typing something in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370 Emacs and correcting errors. You can delete by words or lines
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371 as well. Here is a summary of the delete operations:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373 <Delete> delete the character just before the cursor
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374 C-d delete the next character after the cursor
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376 M-<Delete> kill the word immediately before the cursor
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377 M-d kill the next word after the cursor
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379 C-k kill from the cursor position to end of line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 M-k kill to the end of the current sentence
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
382 Notice that <Delete> and C-d vs M-<Delete> and M-d extend the parallel
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
383 started by C-f and M-f (well, <Delete> is not really a control
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
384 character, but let's not worry about that). C-k and M-k are like C-e
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
385 and M-e, sort of, in that lines are opposite sentences.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
386
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
387 When you delete more than one character at a time, Emacs saves the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
388 deleted text so that you can bring it back. Bringing back killed text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
389 is called "yanking". You can yank the killed text either at the same
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
390 place where it was killed, or at some other place in the text. You
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
391 can yank the text several times in order to make multiple copies of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
392 it. The command to yank is C-y.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
393
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
394 Note that the difference between "Killing" and "Deleting" something is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
395 that "Killed" things can be yanked back, and "Deleted" things cannot.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
396 Generally, the commands that can remove a lot of text save the text,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
397 while the commands that delete just one character, or just blank lines
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
398 and spaces, do not save the deleted text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
399
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
400 >> Move the cursor to the beginning of a line which is not empty.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
401 Then type C-k to kill the text on that line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
402 >> Type C-k a second time. You'll see that it kills the Newline
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
403 which follows that line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
404
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
405 Note that a single C-k kills the contents of the line, and a second
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
406 C-k kills the line itself, and make all the other lines move up. C-k
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
407 treats a numeric argument specially: it kills that many lines AND
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
408 their contents. This is not mere repetition. C-u 2 C-k kills two
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
409 lines and their newlines; typing C-k twice would not do that.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
410
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
411 To retrieve the last killed text and put it where the cursor currently
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
412 is, type C-y.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
413
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
414 >> Try it; type C-y to yank the text back.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
415
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
416 Think of C-y as if you were yanking something back that someone took
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
417 away from you. Notice that if you do several C-k's in a row, all of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
418 the killed text is saved together, so that one C-y will yank all of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
419 the lines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
420
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
421 >> Do this now, type C-k several times.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
422
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
423 Now to retrieve that killed text:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
424
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
425 >> Type C-y. Then move the cursor down a few lines and type C-y
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
426 again. You now see how to copy some text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
427
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
428 What do you do if you have some text you want to yank back, and then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
429 you kill something else? C-y would yank the more recent kill. But
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
430 the previous text is not lost. You can get back to it using the M-y
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
431 command. After you have done C-y to get the most recent kill, typing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
432 M-y replaces that yanked text with the previous kill. Typing M-y
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
433 again and again brings in earlier and earlier kills. When you have
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
434 reached the text you are looking for, you do not have to do anything to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
435 keep it. Just go on with your editing, leaving the yanked text where
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
436 it is.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
437
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
438 If you M-y enough times, you come back to the starting point (the most
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
439 recent kill).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
440
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
441 >> Kill a line, move around, kill another line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
442 Then do C-y to get back the second killed line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
443 Then do M-y and it will be replaced by the first killed line.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
444 Do more M-y's and see what you get. Keep doing them until
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
445 the second kill line comes back, and then a few more.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
446 If you like, you can try giving M-y positive and negative
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
447 arguments.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
448
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
449
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
450 * UNDO
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
451 ------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
452
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
453 If you make a change to the text, and then decide that it was a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
454 mistake, you can undo the change with the undo command, C-x u.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
455
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
456 Normally, C-x u undoes the changes made by one command; if you repeat
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
457 the C-x u several times in a row, each repetition undoes one
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
458 additional command.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
459
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
460 But there are two exceptions: commands that do not change the text do
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
461 not count (this includes cursor motion commands and scrolling
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
462 command), and self-inserting characters are usually handled in groups
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
463 of up to 20. (This is to reduce the number of C-x u's you have to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
464 type to undo insertion of text.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
465
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
466 >> Kill this line with C-k, then type C-x u and it should reappear.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
467
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
468 C-_ is an alternative undo command; it works just the same as C-x u,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
469 but it is easier to type several times in a row. The disadvantage of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
470 C-_ is that on some keyboards it is not obvious how to type it. That
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
471 is why we provide C-x u as well. On some terminals, you can type C-_
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
472 by typing / while holding down CTRL.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
473
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
474 A numeric argument to C-_ or C-x u acts as a repeat count.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
475
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
476
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
477 * FILES
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
478 -------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
479
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
480 In order to make the text you edit permanent, you must put it in a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
481 file. Otherwise, it will go away when your invocation of Emacs goes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
482 away. You put your editing in a file by "finding" the file. (This is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
483 also called "visiting" the file.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
484
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
485 Finding a file means that you see the contents of the file within
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
486 Emacs. In many ways, it is as if you were editing the file itself.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
487 However, the changes you make using Emacs do not become permanent
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
488 until you "save" the file. This is so you can avoid leaving a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
489 half-changed file on the system when you do not want to. Even when
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
490 you save, Emacs leaves the original file under a changed name in case
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
491 you later decide that your changes were a mistake.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
492
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
493 If you look near the bottom of the screen you will see a line that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
494 begins and ends with dashes, and contains the string "Emacs:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
495 TUTORIAL". This part of the screen always shows the name of the file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
496 that you are visiting. Right now, you are visiting a file called
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
497 "TUTORIAL" which is your personal scratch copy of the Emacs tutorial.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
498 Whatever file you find, that file's name will appear in that precise
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
499 spot.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
500
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
501 The commands for finding and saving files are unlike the other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
502 commands you have learned in that they consist of two characters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
503 They both start with the character Control-x. There is a whole series
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
504 of commands that start with Control-x; many of them have to do with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
505 files, buffers, and related things. These commands are two, three or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
506 four characters long.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
507
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
508 Another thing about the command for finding a file is that you have
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
509 to say what file name you want. We say the command "reads an argument
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
510 from the terminal" (in this case, the argument is the name of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
511 file). After you type the command
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
512
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
513 C-x C-f Find a file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
514
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
515 Emacs asks you to type the file name. The file name you type appears
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
516 on the bottom line of the screen. The bottom line is called the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
517 minibuffer when it is used for this sort of input. You can use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
518 ordinary Emacs editing commands to edit the file name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
519
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
520 While you are entering the file name (or any minibuffer input),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
521 you can cancel the command with C-g.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
522
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
523 >> Type C-x C-f, then type C-g. This cancels the minibuffer,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
524 and also cancels the C-x C-f command that was using the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
525 minibuffer. So you do not find any file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
526
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
527 When you have finished entering the file name, type <Return> to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
528 terminate it. Then C-x C-f command goes to work, and finds the file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
529 you chose. The minibuffer disappears when the C-x C-f command is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
530 finished.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
531
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
532 In a little while the file contents appear on the screen, and you can
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
533 edit the contents. When you wish to make your changes permanent,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
534 type the command
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
535
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
536 C-x C-s Save the file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
537
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
538 This copies the text within Emacs into the file. The first time you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
539 do this, Emacs renames the original file to a new name so that it is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
540 not lost. The new name is made by adding "~" to the end of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
541 original file's name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
542
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
543 When saving is finished, Emacs prints the name of the file written.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
544 You should save fairly often, so that you will not lose very much
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
545 work if the system should crash.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
546
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
547 >> Type C-x C-s, saving your copy of the tutorial.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
548 This should print "Wrote ...TUTORIAL" at the bottom of the screen.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
549
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
550 NOTE: On some systems, typing C-x C-s will freeze the screen and you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
551 will see no further output from Emacs. This indicates that an
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
552 operating system "feature" called "flow control" is intercepting the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
553 C-s and not letting it get through to Emacs. To unfreeze the screen,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
554 type C-q. Then see the section "Spontaneous Entry to Incremental
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
555 Search" in the Emacs manual for advice on dealing with this "feature".
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
556
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
557 You can find an existing file, to view it or edit it. You can also
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
558 find a file which does not already exist. This is the way to create a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
559 file with Emacs: find the file, which will start out empty, and then
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
560 begin inserting the text for the file. When you ask to "save" the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
561 file, Emacs will really create the file with the text that you have
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
562 inserted. From then on, you can consider yourself to be editing an
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
563 already existing file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
564
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
565
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
566 * BUFFERS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
567 ---------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
568
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
569 If you find a second file with C-x C-f, the first file remains
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
570 inside Emacs. You can switch back to it by finding it again with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
571 C-x C-f. This way you can get quite a number of files inside Emacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
572
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
573 >> Create a file named "foo" by typing C-x C-f foo <Return>.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
574 Then insert some text, edit it, and save "foo" by typing C-x C-s.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
575 Finally, type C-x C-f TUTORIAL <Return>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
576 to come back to the tutorial.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
577
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
578 Emacs stores each file's text inside an object called a "buffer."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
579 Finding a file makes a new buffer inside Emacs. To see a list of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
580 buffers that current exist in your Emacs job, type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
581
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
582 C-x C-b List buffers
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
583
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
584 >> Try C-x C-b now.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
585
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
586 See how each buffer has a name, and it may also have a file name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
587 for the file whose contents it holds. Some buffers do not correspond
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
588 to files. For example, the buffer named "*Buffer List*" does
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
589 not have any file. It is the buffer which contains the buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
590 list that was made by C-x C-b. ANY text you see in an Emacs window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
591 is always part of some buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
592
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
593 >> Type C-x 1 to get rid of the buffer list.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
594
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
595 If you make changes to the text of one file, then find another file,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
596 this does not save the first file. Its changes remain inside Emacs,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
597 in that file's buffer. The creation or editing of the second file's
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
598 buffer has no effect on the first file's buffer. This is very useful,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
599 but it also means that you need a convenient way to save the first
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
600 file's buffer. It would be a nuisance to have to switch back to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
601 it with C-x C-f in order to save it with C-x C-s. So we have
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
602
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
603 C-x s Save some buffers
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
604
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
605 C-x s asks you about each buffer which contains changes that you have
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
606 not saved. It asks you, for each such buffer, whether to save the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
607 buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
608
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
609 >> Insert a line of text, then type C-x s.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
610 It should ask you whether to save the buffer named TUTORIAL.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
611 Answer yes to the question by typing "y".
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
612
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
613 * USING THE MENU
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
614 ----------------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
615
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
616 If you are on an X terminal, you will notice a menubar at the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
617 top of the Emacs screen. You can use this menubar to access all
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
618 the most common Emacs commands, such as "find file". You will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
619 find this easier at first, because you don't need to remember
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
620 the keystrokes necessary to access any particular command. Once
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
621 you are comfortable with Emacs, it will be easy to begin using
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
622 the keyboard commands because each menu item with a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
623 corresponding keyboard command has the command listed next to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
624 it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
625
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
626 Note that there are many items in the menubar that have no exact
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
627 keyboard equivalents. For example, the Buffers menu lists all
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
628 of the available buffers in most-recently used order. You can
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
629 switch to any buffer by simply findings its name in the Buffers
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
630 menu and selecting it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
631
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
632
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
633 * USING THE MOUSE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
634 -----------------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
635
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
636 When running under X, Emacs is fully integrated with the mouse.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
637 You can position the text cursor by clicking the left button at
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
638 the desired location, and you can select text by dragging the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
639 left mouse button across the text you want to select. (Or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
640 alternatively, click the left mouse button at one end of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
641 text, then move to the other end and use Shift-click to select
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
642 the text.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
643
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
644 To kill some selected text, you can use C-w or choose the Cut
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
645 item from the Edit menu. Note that these are *not* equivalent:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
646 C-w only saves the text internally within Emacs (similar to C-k
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
647 as described above), whereas Cut does this and also puts the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
648 text into the X clipboard, where it can be accessed by other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
649 applications.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
650
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
651 To retrieve text from the X clipboard, use the Paste item from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
652 the Edit menu.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
653
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
654 The middle mouse button is commonly used to choose items that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
655 are visible on the screen. For example, if you enter Info (the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
656 on-line Emacs documentation) using C-h i or the Help menu, you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
657 can follow a highlighted link by clicking the middle mouse
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
658 button on it. Similarly, if you are typing a file name in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
659 (e.g. when prompted by "Find File") and you hit TAB to show the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
660 possible completions, you can click the middle mouse button on
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
661 one of the completions to select it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
662
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
663 The right mouse button brings up a popup menu. The contents of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
664 this menu vary depending on what mode you're in, and usually
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
665 contain a few commonly used commands, so they're easier to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
666 access.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
667
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
668 >> Press the right mouse button now.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
669
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
670 You will have to hold the button down in order to keep the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
671 menu up.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
672
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
673
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
674 * EXTENDING THE COMMAND SET
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
675 ---------------------------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
676
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
677 There are many, many more Emacs commands than could possibly be put
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
678 on all the control and meta characters. Emacs gets around this with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
679 the X (eXtend) command. This comes in two flavors:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
680
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
681 C-x Character eXtend. Followed by one character.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
682 M-x Named command eXtend. Followed by a long name.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
683
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
684 These are commands that are generally useful but used less than the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
685 commands you have already learned about. You have already seen two of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
686 them: the file commands C-x C-f to Find and C-x C-s to Save. Another
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
687 example is the command to end the Emacs session--this is the command
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
688 C-x C-c. (Do not worry about losing changes you have made; C-x C-c
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
689 offers to save each changed file before it kills the Emacs.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
690
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
691 C-z is the command to exit Emacs *temporarily*--so that you can go
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
692 back to the same Emacs session afterward.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
693
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
694 On systems which allow it, C-z "suspends" Emacs; that is, it returns
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
695 to the shell but does not destroy the Emacs. In the most common
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
696 shells, you can resume Emacs with the `fg' command or with `%emacs'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
697
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
698 On systems which do not implement suspending, C-z creates a subshell
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
699 running under Emacs to give you the chance to run other programs and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
700 return to Emacs afterward; it does not truly "exit" from Emacs. In
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
701 this case, the shell command `exit' is the usual way to get back to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
702 Emacs from the subshell.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
703
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
704 The time to use C-x C-c is when you are about to log out. It's also
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
705 the right thing to use to exit an Emacs invoked under mail handling
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
706 programs and other miscellaneous utilities, since they may not know
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
707 how to cope with suspension of Emacs. In ordinary circumstances,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
708 though, if you are not about to log out, it is better to suspend Emacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
709 with C-z instead of exiting Emacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
710
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
711 There are many C-x commands. Here is a list of the ones you have learned:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
712
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
713 C-x C-f Find file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
714 C-x C-s Save file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
715 C-x C-b List buffers.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
716 C-x C-c Quit Emacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
717 C-x u Undo.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
718
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
719 Named eXtended commands are commands which are used even less
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
720 frequently, or commands which are used only in certain modes. An
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
721 example is the command replace-string, which globally replaces one
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
722 string with another. When you type M-x, Emacs prompts you at the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
723 bottom of the screen with M-x and you should type the name of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
724 command; in this case, "replace-string". Just type "repl s<TAB>" and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
725 Emacs will complete the name. End the command name with <Return>.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
726
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
727 The replace-string command requires two arguments--the string to be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
728 replaced, and the string to replace it with. You must end each
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
729 argument with <Return>.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
730
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
731 >> Move the cursor to the blank line two lines below this one.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
732 Then type M-x repl s<Return>changed<Return>altered<Return>.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
733
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
734 Notice how this line has changed: you've replaced
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
735 the word c-h-a-n-g-e-d with "altered" wherever it occurred,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
736 after the initial position of the cursor.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
737
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
738
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
739 * AUTO SAVE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
740 -----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
741
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
742 When you have made changes in a file, but you have not saved them yet,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
743 they could be lost if your computer crashes. To protect you from
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
744 this, Emacs periodically writes an "auto save" file for each file that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
745 you are editing. The auto save file name has a # at the beginning and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
746 the end; for example, if your file is named "hello.c", its auto save
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
747 file's name is "#hello.c#". When you save the file in the normal way,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
748 Emacs deletes its auto save file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
749
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
750 If the computer crashes, you can recover your auto-saved editing by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
751 finding the file normally (the file you were editing, not the auto
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
752 save file) and then typing M-x recover file<return>. When it asks for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
753 confirmation, type yes<return> to go ahead and recover the auto-save
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
754 data.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
755
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
756
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
757 * ECHO AREA
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
758 -----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
759
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
760 If Emacs sees that you are typing commands slowly it shows them to you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
761 at the bottom of the screen in an area called the "echo area." The echo
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
762 area contains the bottom line of the screen.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
763
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
764
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
765 * MODELINE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
766 -----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
767
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
768 The line immediately above the echo area it is called the "modeline".
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
769 The mode line says something like this:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
770
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
771 --**-XEmacs: TUTORIAL (Fundamental)--L670--58%----------------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
772
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
773 This line gives useful information about the status of Emacs and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
774 the text you are editing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
775
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
776 You already know what the filename means--it is the file you have
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
777 found. -NN%-- indicates your current position in the text; it means
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
778 that NN percent of the text is above the top of the screen. If the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
779 top of the file is on the screen, it will say --Top-- instead of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
780 --00%--. If the bottom of the text is on the screen, it will say
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
781 --Bot--. If you are looking at text so small that all of it fits on
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
782 the screen, the mode line says --All--.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
783
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
784 The stars near the front mean that you have made changes to the text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
785 Right after you visit or save a file, that part of the mode line shows
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
786 no stars, just dashes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
787
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
788 The part of the mode line inside the parentheses is to tell you what
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
789 editing modes you are in. The default mode is Fundamental which is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
790 what you are using now. It is an example of a "major mode".
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
791
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
792 Emacs has many different major modes. Some of them are meant for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
793 editing different languages and/or kinds of text, such as Lisp mode,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
794 Text mode, etc. At any time one and only one major mode is active,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
795 and its name can always be found in the mode line just where
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
796 "Fundamental" is now.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
797
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
798 Each major mode makes a few commands behave differently. For example,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
799 there are commands for creating comments in a program, and since each
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
800 programming language has a different idea of what a comment should
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
801 look like, each major mode has to insert comments differently. Each
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
802 major mode is the name of an extended command, which is how you can
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
803 switch to that mode. For example, M-x fundamental-mode is a command to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
804 switch to Fundamental mode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
805
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
806 If you are going to be editing English text, such as this file, you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
807 should probably use Text Mode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
808 >> Type M-x text-mode<Return>.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
809
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
810 Don't worry, none of the commands you have learned changes Emacs in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
811 any great way. But you can observe that M-f and M-b now treat
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
812 apostrophes as part of words. Previously, in Fundamental mode,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
813 M-f and M-b treated apostrophes as word-separators.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
814
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
815 Major modes usually make subtle changes like that one: most commands
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
816 do "the same job" in each major mode, but they work a little bit
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
817 differently.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
818
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
819 To view documentation on your current major mode, type C-h m.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
820
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
821 >> Use C-u C-v once or more to bring this line near the top of screen.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
822 >> Type C-h m, to see how Text mode differs from Fundamental mode.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
823 >> Type q to remove the documentation from the screen.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
824
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
825 Major modes are called major because there are also minor modes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
826 Minor modes are alternatives not to the major modes, just minor
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
827 modifications of them. Each minor mode can be turned on or off by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
828 itself, independent of all other minor modes, and independent of your
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
829 major mode. So you can use no minor modes, or one minor mode, or any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
830 combination of several minor modes.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
831
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
832 One minor mode which is very useful, especially for editing English
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
833 text, is Auto Fill mode. When this mode is on, Emacs breaks the line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
834 in between words automatically whenever you insert text and make a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
835 line that is too wide.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
836
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
837 You can turn Auto Fill mode on by doing M-x auto-fill-mode<Return>.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
838 When the mode is on, you can turn it off by doing M-x
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
839 auto-fill-mode<Return>. If the mode is off, this command turns it on,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
840 and if the mode is on, this command turns it off. We say that the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
841 command "toggles the mode".
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
842
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
843 >> Type M-x auto-fill-mode<Return> now. Then insert a line of "asdf "
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
844 over again until you see it divide into two lines. You must put in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
845 spaces between them because Auto Fill breaks lines only at spaces.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
846
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
847 The margin is usually set at 70 characters, but you can change it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
848 with the C-x f command. You should give the margin setting you want
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
849 as a numeric argument.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
850
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
851 >> Type C-x f with an argument of 20. (C-u 2 0 C-x f).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
852 Then type in some text and see Emacs fill lines of 20
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
853 characters with it. Then set the margin back to 70 using
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
854 C-x f again.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
855
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
856 If you makes changes in the middle of a paragraph, Auto Fill mode
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
857 does not re-fill it for you.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
858 To re-fill the paragraph, type M-q (Meta-q) with the cursor inside
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
859 that paragraph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
860
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
861 >> Move the cursor into the previous paragraph and type M-q.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
862
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
863
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
864 * SEARCHING
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
865 -----------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
866
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
867 Emacs can do searches for strings (these are groups of contiguous
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
868 characters or words) either forward through the text or backward
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
869 through it. Searching for a string is a cursor motion command;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
870 it moves the cursor to the next place where that string appears.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
871
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
872 The Emacs search command is different from the search commands
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
873 of most editors, in that it is "incremental". This means that the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
874 search happens while you type in the string to search for.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
875
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
876 The command to initiate a search is C-s for forward search, and C-r
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
877 for reverse search. BUT WAIT! Don't try them now.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
878
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
879 When you type C-s you'll notice that the string "I-search" appears as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
880 a prompt in the echo area. This tells you that Emacs is in what is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
881 called an incremental search waiting for you to type the thing that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
882 you want to search for. <Return> terminates a search.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
883
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
884 >> Now type C-s to start a search. SLOWLY, one letter at a time,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
885 type the word 'cursor', pausing after you type each
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
886 character to notice what happens to the cursor.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
887 Now you have searched for "cursor", once.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
888 >> Type C-s again, to search for the next occurrence of "cursor".
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
889 >> Now type <Delete> four times and see how the cursor moves.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
890 >> Type <RET> to terminate the search.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
891
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
892 Did you see what happened? Emacs, in an incremental search, tries to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
893 go to the occurrence of the string that you've typed out so far,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
894 highlighting it for your convenience. To go to the next occurrence of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
895 'cursor' just type C-s again. If no such occurrence exists Emacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
896 beeps and tells you the search is currently "failing", C-g would also
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
897 terminate the search.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
898
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
899 NOTE: On some systems, typing C-s will freeze the screen and you will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
900 see no further output from Emacs. This indicates that an operating
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
901 system "feature" called "flow control" is intercepting the C-s and not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
902 letting it get through to Emacs. To unfreeze the screen, type C-q.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
903 Then see the section "Spontaneous Entry to Incremental Search" in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
904 Emacs manual for advice on dealing with this "feature".
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
905
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
906 If you are in the middle of an incremental search and type <Delete>,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
907 you'll notice that the last character in the search string is erased
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
908 and the search backs up to the last place of the search. For
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
909 instance, suppose you have typed "c", to search for the first
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
910 occurrence of "c". Now if you type "u", the cursor will move
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
911 to the first occurrence of "cu". Now type <Delete>. This erases
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
912 the "u" from the search string, and the cursor moves back to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
913 the first occurrence of "c".
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
914
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
915 If you are in the middle of a search and type a control or meta
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
916 character (with a few exceptions--characters that are special in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
917 a search, such as C-s and C-r), the search is terminated.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
918
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
919 The C-s starts a search that looks for any occurrence of the search
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
920 string AFTER the current cursor position. If you want to search for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
921 something earlier in the text, type C-r instead. Everything that we
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
922 have said about C-s also applies to C-r, except that the direction of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
923 the search is reversed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
924
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
925
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
926 * MULTIPLE WINDOWS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
927 ------------------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
928
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
929 One of the nice features of Emacs is that you can display more than one
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
930 window on the screen at the same time.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
931
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
932 >> Move the cursor to this line and type C-u 0 C-l.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
933
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
934 >> Now type C-x 2 which splits the screen into two windows.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
935 Both windows display this tutorial. The cursor stays in the top window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
936
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
937 >> Type C-M-v to scroll the bottom window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
938 (If you do not have a real Meta key, type ESC C-v.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
939
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
940 >> Type C-x o ("o" for "other") to move the cursor to the bottom window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
941 >> Use C-v and M-v in the bottom window to scroll it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
942 Keep reading these directions in the top window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
943
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
944 >> Type C-x o again to move the cursor back to the top window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
945 The cursor in the top window is just where it was before.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
946
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
947 You can keep using C-x o to switch between the windows. Each
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
948 window has its own cursor position, but only one window actually
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
949 shows the cursor. All the ordinary editing commands apply to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
950 window that the cursor is in. We call this the "selected window".
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
951
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
952 The command C-M-v is very useful when you are editing text in one
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
953 window and using the other window just for reference. You can keep
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
954 the cursor always in the window where you are editing, and advance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
955 through the other window sequentially with C-M-v.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
956
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
957 C-M-v is an example of a CONTROL-META character. If you have a real
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
958 META key, you can type C-M-v by holding down both CTRL and META while
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
959 typing v. It does not matter whether CTRL or META "comes first,"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
960 because both of these keys act by modifying the characters you type.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
961
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
962 If you do not have a real META key, and you use ESC instead, the order
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
963 does matter: you must type ESC followed by CTRL-v; CTRL-ESC v will not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
964 work. This is because ESC is a character in its own right, not a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
965 modifier key.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
966
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
967 >> Type C-x 1 (in the top window) to get rid of the bottom window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
968
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
969 (If you had typed C-x 1 in the bottom window, that would get rid
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
970 of the top one. Think of this command as "Keep just one
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
971 window--the window I am already in.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
972
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
973 You do not have to display the same buffer in both windows. If you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
974 use C-x C-f to find a file in one window, the other window does not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
975 change. You can find a file in each window independently.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
976
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
977 Here is another way to use two windows to display two different
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
978 things:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
979
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
980 >> Type C-x 4 C-f followed by the name of one of your files.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
981 End with <Return>. See the specified file appear in the bottom
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
982 window. The cursor goes there, too.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
983
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
984 >> Type C-x o to go back to the top window, and C-x 1 to delete
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
985 the bottom window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
986
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
987
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
988 * RECURSIVE EDITING LEVELS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
989 --------------------------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
990
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
991 Sometimes you will get into what is called a "recursive editing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
992 level". This is indicated by square brackets in the mode line,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
993 surrounding the parentheses around the major mode name. For
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
994 example, you might see [(Fundamental)] instead of (Fundamental).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
995
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
996 To get out of the recursive editing level, type ESC ESC ESC. That is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
997 an all-purpose "get out" command. You can also use it for eliminating
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
998 extra windows, and getting out of the minibuffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
999
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1000 >> Type M-x to get into a minibuffer; then type ESC ESC ESC to get out.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1001
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1002 You cannot use C-g to get out of a recursive editing level. This is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1003 because C-g is used for canceling commands and arguments WITHIN the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1004 recursive editing level.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1005
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1006
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1007 * GETTING MORE HELP
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1008 -------------------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1009
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1010 In this tutorial we have tried to supply just enough information to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1011 get you started using Emacs. There is so much available in Emacs that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1012 it would be impossible to explain it all here. However, you may want
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1013 to learn more about Emacs since it has many other useful features.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1014 Emacs provides commands for reading documentation about Emacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1015 commands. These "help" commands all start with the character
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1016 Control-h, which is called "the Help character".
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1017
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1018 To use the Help features, type the C-h character, and then a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1019 character saying what kind of help you want. If you are REALLY lost,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1020 type C-h ? and Emacs will tell you what kinds of help it can give.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1021 If you have typed C-h and decide you do not want any help, just
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1022 type C-g to cancel it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1023
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1024 (Some sites rebind the character C-h. They really should not do this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1025 as a blanket measure, so complain to the system administrator.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1026 Meanwhile, if C-h does not display a message about help at the bottom
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1027 of the screen, try typing M-x help RET instead.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1028
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1029 The most basic HELP feature is C-h c. Type C-h, a c, and a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1030 command character or sequence, and Emacs displays a very brief
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1031 description of the command.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1032
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1033 >> Type C-h c Control-p.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1034 The message should be something like
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1035
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1036 C-p runs the command previous-line
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1037
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1038 This tells you the "name of the function". Function names are used
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1039 mainly for customizing and extending Emacs. But since function names
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1040 are chosen to indicate what the command does, they can serve also as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1041 very brief documentation--sufficient to remind you of commands you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1042 have already learned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1043
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1044 Multi-character commands such as C-x C-s and (if you have no META or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1045 EDIT or ALT key) <ESC>v are also allowed after C-h c.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1046
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1047 To get more information about a command, use C-h k instead of C-h c.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1048
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1049 >> Type C-h k Control-p.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1050
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1051 This displays the documentation of the function, as well as its
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1052 name, in an Emacs window. When you are finished reading the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1053 output, type q to get rid of the help text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1054
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1055 Here are some other useful C-h options:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1056
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1057 C-h f Describe a function. You type in the name of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1058 function.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1059
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1060 >> Try typing C-h f previous-line<Return>.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1061 This prints all the information Emacs has about the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1062 function which implements the C-p command.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1063
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1064 C-h a Hyper Apropos. Type in a keyword and Emacs will list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1065 all the functions and variables whose names contain
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1066 that keyword. The commands that can be invoked with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1067 Meta-x, an asterisk will be displayed to the left.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1068
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1069 >> Type C-h a newline<Return>.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1070
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1071 This displays a list of all functions and variables with "newline" in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1072 their names. Press <Return> or click the middle mouse button to find
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1073 out more about a function or variable. Type `q' to exit hyper-apropos.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1074
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1075
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1076 * CONCLUSION
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1077 ------------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1078
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1079 Remember, to exit Emacs permanently use C-x C-c. To exit to a shell
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1080 temporarily, so that you can come back in, use C-z. (under X, this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1081 iconifies the current Emacs frame.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1082
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1083 This tutorial is meant to be understandable to all new users, so if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1084 you found something unclear, don't sit and blame yourself - complain!
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1085
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1086
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1087 COPYING
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1088 -------
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1089
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1090 This tutorial descends from a long line of Emacs tutorials
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1091 starting with the one written by Stuart Cracraft for the original Emacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1092 Ben Wing updated the tutorial for X Windows. Martin Buchholz and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1093 Hrvoje Niksic added more corrections for XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1094
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1095 This version of the tutorial, like GNU Emacs, is copyrighted, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1096 comes with permission to distribute copies on certain conditions:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1097
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1098 Copyright (c) 1985, 1996 Free Software Foundation
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1099
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1100 Permission is granted to anyone to make or distribute verbatim copies
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1101 of this document as received, in any medium, provided that the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1102 copyright notice and permission notice are preserved,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1103 and that the distributor grants the recipient permission
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1104 for further redistribution as permitted by this notice.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1105
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1106 Permission is granted to distribute modified versions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1107 of this document, or of portions of it,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1108 under the above conditions, provided also that they
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1109 carry prominent notices stating who last altered them.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1110
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1111 The conditions for copying Emacs itself are more complex, but in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1112 same spirit. Please read the file COPYING and then do give copies of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1113 GNU Emacs to your friends. Help stamp out software obstructionism
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1114 ("ownership") by using, writing, and sharing free software!