annotate etc/TUTORIAL @ 86:364816949b59 r20-0b93

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