annotate etc/TUTORIAL @ 161:28f395d8dc7a r20-3b7

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