aboutsummaryrefslogtreecommitdiffstats
path: root/etc/tutorials
diff options
context:
space:
mode:
authorChong Yidong2012-01-10 16:27:22 +0800
committerChong Yidong2012-01-10 16:27:22 +0800
commit107ddb9783a3a5f988eff426e795c477b0294a4a (patch)
tree9bba9cf0245fdf358cdeff0111cd72f1079b7981 /etc/tutorials
parent27e428e758036e68bffe737a5d361e2b426857a7 (diff)
downloademacs-107ddb9783a3a5f988eff426e795c477b0294a4a.tar.gz
emacs-107ddb9783a3a5f988eff426e795c477b0294a4a.zip
Update English tutorial.
* etc/tutorials/TUTORIAL: Don't give instructions for old-style X scrollbars. Use DEL terminology instead of DelBack. Improve description of graphical continuation lines and mode-line. Promote use of C-/ and C-SPC. Remove discussion of flow control.
Diffstat (limited to 'etc/tutorials')
-rw-r--r--etc/tutorials/TUTORIAL357
1 files changed, 168 insertions, 189 deletions
diff --git a/etc/tutorials/TUTORIAL b/etc/tutorials/TUTORIAL
index 7713aba0140..c41b5d1127e 100644
--- a/etc/tutorials/TUTORIAL
+++ b/etc/tutorials/TUTORIAL
@@ -217,21 +217,10 @@ screenful. For example, C-u 8 C-v scrolls the screen by 8 lines.
217This should have scrolled the screen up by 8 lines. If you would like 217This should have scrolled the screen up by 8 lines. If you would like
218to scroll it down again, you can give an argument to M-v. 218to scroll it down again, you can give an argument to M-v.
219 219
220If you are using a windowed display, such as X or MS-Windows, there 220If you are using a graphical display, such as X or MS-Windows, there
221should be a tall rectangular area called a scroll bar on one side of 221should be a tall rectangular area called a scroll bar on one side of
222the Emacs window. (There are other tall rectangles on either side of 222the Emacs window. You can scroll the text by clicking the mouse in
223the Emacs display. These "fringes" are used for displaying 223the scroll bar.
224continuation characters and other symbols. The scroll bar appears on
225only one side, and is the outermost column on that side.)
226You can scroll the text by clicking the mouse in the scroll bar.
227
228>> Try pressing the middle button at the top of the highlighted area
229 within the scroll bar. This should scroll the text to a position
230 determined by how high or low you click.
231
232>> Try moving the mouse up and down, while holding the middle button
233 pressed down. You'll see that the text scrolls up and down as
234 you move the mouse.
235 224
236If your mouse has a wheel button, you can also use this to scroll. 225If your mouse has a wheel button, you can also use this to scroll.
237 226
@@ -247,8 +236,8 @@ You can also use C-g to discard a numeric argument or the beginning of
247a command that you do not want to finish. 236a command that you do not want to finish.
248 237
249>> Type C-u 100 to make a numeric argument of 100, then type C-g. 238>> Type C-u 100 to make a numeric argument of 100, then type C-g.
250 Now type C-f. It should move just one character, 239 Now type C-f. It should move just one character, because you
251 because you canceled the argument with C-g. 240 canceled the argument with C-g.
252 241
253If you have typed an <ESC> by mistake, you can get rid of it with a C-g. 242If you have typed an <ESC> by mistake, you can get rid of it with a C-g.
254 243
@@ -274,9 +263,9 @@ disabled command, answer the question with "n".
274* WINDOWS 263* WINDOWS
275--------- 264---------
276 265
277Emacs can have several windows, each displaying its own text. We will 266Emacs can have several "windows", each displaying its own text. We
278explain later on how to use multiple windows. Right now we want to 267will explain later on how to use multiple windows. Right now we want
279explain how to get rid of extra windows and go back to basic 268to explain how to get rid of extra windows and go back to basic
280one-window editing. It is simple: 269one-window editing. It is simple:
281 270
282 C-x 1 One window (i.e., kill all other windows). 271 C-x 1 One window (i.e., kill all other windows).
@@ -286,9 +275,9 @@ which contains the cursor, to occupy the full screen. It deletes all
286other windows. 275other windows.
287 276
288>> Move the cursor to this line and type C-u 0 C-l. 277>> Move the cursor to this line and type C-u 0 C-l.
289>> Type CONTROL-h k CONTROL-f. 278>> Type C-h k C-f.
290 See how this window shrinks, while a new one appears 279 See how this window shrinks, while a new one appears
291 to display documentation on the CONTROL-f command. 280 to display documentation on the C-f command.
292 281
293>> Type C-x 1 and see the documentation listing window disappear. 282>> Type C-x 1 and see the documentation listing window disappear.
294 283
@@ -302,39 +291,36 @@ These commands are two, three or four characters long.
302* INSERTING AND DELETING 291* INSERTING AND DELETING
303------------------------ 292------------------------
304 293
305If you want to insert text, just type the text. Characters which you 294If you want to insert text, just type the text. Ordinary characters,
306can see, such as A, 7, *, etc. are taken by Emacs as text and inserted 295like A, 7, *, etc., are inserted as you type them. To insert a
307immediately. Type <Return> (the carriage-return key) to insert a 296Newline character, type <Return> (this is the key on the keyboard
308Newline character. 297which is sometimes labeled "Enter").
309
310You can delete the last character you typed by typing <Delback>.
311<Delback> is a key on the keyboard--the same one you normally use,
312outside Emacs, for deleting the last character you typed. It is
313normally a large key a couple of lines up from the <Return> key, and
314it is usually labeled "Delete", "Del" or "Backspace".
315 298
316If the large key there is labeled "Backspace", then that's the one you 299To delete <DEL> the character immediately before the current cursor
317use for <Delback>. There may also be another key labeled "Delete" 300position, type <DEL>. This is the key on the keyboard usually labeled
318somewhere else, but that's not <Delback>. 301"Backspace"--the same one you normally use, outside Emacs, to delete
302the last character typed.
319 303
320More generally, <Delback> deletes the character immediately before the 304There may also be another key on your keyboard labeled <Delete>, but
321current cursor position. 305that's not the one we refer to as <DEL>.
322 306
323>> Do this now--type a few characters, then delete them 307>> Do this now--type a few characters, then delete them by
324 by typing <Delback> a few times. Don't worry about this file 308 typing <DEL> a few times. Don't worry about this file
325 being changed; you will not alter the master tutorial. This is 309 being changed; you will not alter the master tutorial.
326 your personal copy of it. 310 This is your personal copy of it.
327 311
328When a line of text gets too big for one line on the screen, the line 312When a line of text gets too big for one line on the screen, the line
329of text is "continued" onto a second screen line. A backslash ("\") 313of text is "continued" onto a second screen line. If you're using a
330(or, if you're using a windowed display, a little curved arrow) at the 314graphical display, little curved arrows appear in the narrow spaces on
331right margin (actually, in the right "fringe") indicates a line which 315each side of the text area (the left and right "fringes"), to indicate
332has been continued. 316where a line has been continued. If you're using a text terminal, the
317continued line is indicated by a backslash ("\") on the rightmost
318screen column.
333 319
334>> Insert text until you reach the right margin, and keep on inserting. 320>> Insert text until you reach the right margin, and keep on inserting.
335 You'll see a continuation line appear. 321 You'll see a continuation line appear.
336 322
337>> Use <Delback>s to delete the text until the line fits on one screen 323>> Use <DEL>s to delete the text until the line fits on one screen
338 line again. The continuation line goes away. 324 line again. The continuation line goes away.
339 325
340You can delete a Newline character just like any other character. 326You can delete a Newline character just like any other character.
@@ -342,7 +328,7 @@ Deleting the Newline character between two lines merges them into
342one line. If the resulting combined line is too long to fit in the 328one line. If the resulting combined line is too long to fit in the
343screen width, it will be displayed with a continuation line. 329screen width, it will be displayed with a continuation line.
344 330
345>> Move the cursor to the beginning of a line and type <Delback>. This 331>> Move the cursor to the beginning of a line and type <DEL>. This
346 merges that line with the previous line. 332 merges that line with the previous line.
347 333
348>> Type <Return> to reinsert the Newline you deleted. 334>> Type <Return> to reinsert the Newline you deleted.
@@ -357,24 +343,26 @@ You've now learned the most basic way of typing something in
357Emacs and correcting errors. You can delete by words or lines 343Emacs and correcting errors. You can delete by words or lines
358as well. Here is a summary of the delete operations: 344as well. Here is a summary of the delete operations:
359 345
360 <Delback> Delete the character just before the cursor 346 <DEL> Delete the character just before the cursor
361 C-d Delete the next character after the cursor 347 C-d Delete the next character after the cursor
362 348
363 M-<Delback> Kill the word immediately before the cursor 349 M-<DEL> Kill the word immediately before the cursor
364 M-d Kill the next word after the cursor 350 M-d Kill the next word after the cursor
365 351
366 C-k Kill from the cursor position to end of line 352 C-k Kill from the cursor position to end of line
367 M-k Kill to the end of the current sentence 353 M-k Kill to the end of the current sentence
368 354
369Notice that <Delback> and C-d vs M-<Delback> and M-d extend the parallel 355Notice that <DEL> and C-d vs M-<DEL> and M-d extend the parallel
370started by C-f and M-f (well, <Delback> is not really a control 356started by C-f and M-f (well, <DEL> is not really a control character,
371character, but let's not worry about that). C-k and M-k are like C-e 357but let's not worry about that). C-k and M-k are like C-e and M-e,
372and M-e, sort of, in that lines are paired with sentences. 358sort of, in that lines are paired with sentences.
373 359
374You can also kill any part of the text with one uniform method. Move 360You can also kill a segment of text with one uniform method. Move to
375to one end of that part, and type C-@ or C-<SPC> (either one). (<SPC> 361one end of that part, and type C-<SPC>. (<SPC> is the Space bar.)
376is the Space bar.) Move to the other end of that part, and type C-w. 362Next, move the cursor to the other end of the text you intend to kill.
377That kills all the text between the two positions. 363As you do this, Emacs highlights the text between the cursor and the
364position where you typed C-<SPC>. Finally, type C-w. This kills all
365the text between the two positions.
378 366
379>> Move the cursor to the Y at the start of the previous paragraph. 367>> Move the cursor to the Y at the start of the previous paragraph.
380>> Type C-<SPC>. Emacs should display a message "Mark set" 368>> Type C-<SPC>. Emacs should display a message "Mark set"
@@ -391,10 +379,10 @@ Reinsertion of killed text is called "yanking". Generally, the
391commands that can remove a lot of text kill the text (they are set up so 379commands that can remove a lot of text kill the text (they are set up so
392that you can yank the text), while the commands that remove just one 380that you can yank the text), while the commands that remove just one
393character, or only remove blank lines and spaces, do deletion (so you 381character, or only remove blank lines and spaces, do deletion (so you
394cannot yank that text). <Delback> and C-d do deletion in the simplest 382cannot yank that text). <DEL> and C-d do deletion in the simplest
395case, with no argument. When given an argument, they kill instead. 383case, with no argument. When given an argument, they kill instead.
396 384
397>> Move the cursor to the beginning of a line which is not empty. 385>> Move the cursor to the beginning of a line which is not empty.
398 Then type C-k to kill the text on that line. 386 Then type C-k to kill the text on that line.
399>> Type C-k a second time. You'll see that it kills the Newline 387>> Type C-k a second time. You'll see that it kills the Newline
400 which follows that line. 388 which follows that line.
@@ -405,13 +393,13 @@ treats a numeric argument specially: it kills that many lines AND
405their contents. This is not mere repetition. C-u 2 C-k kills two 393their contents. This is not mere repetition. C-u 2 C-k kills two
406lines and their newlines; typing C-k twice would not do that. 394lines and their newlines; typing C-k twice would not do that.
407 395
408Bringing back killed text is called "yanking". (Think of it as 396Reinserting killed text is called "yanking". (Think of it as yanking
409yanking back, or pulling back, some text that was taken away.) You 397back, or pulling back, some text that was taken away.) You can yank
410can yank the killed text either at the same place where it was killed, 398the killed text either at the same place where it was killed, or at
411or at some other place in the text you are editing, or even in a 399some other place in the text you are editing, or even in a different
412different file. You can yank the same text several times; that makes 400file. You can yank the same text several times; that makes multiple
413multiple copies of it. Some other editors call killing and yanking 401copies of it. Some other editors call killing and yanking "cutting"
414"cutting" and "pasting" (see the Glossary in the Emacs manual). 402and "pasting" (see the Glossary in the Emacs manual).
415 403
416The command for yanking is C-y. It reinserts the last killed text, 404The command for yanking is C-y. It reinserts the last killed text,
417at the current cursor position. 405at the current cursor position.
@@ -454,27 +442,25 @@ recent kill).
454------ 442------
455 443
456If you make a change to the text, and then decide that it was a 444If you make a change to the text, and then decide that it was a
457mistake, you can undo the change with the undo command, C-x u. 445mistake, you can undo the change with the undo command, C-/.
458 446
459Normally, C-x u undoes the changes made by one command; if you repeat 447Normally, C-/ undoes the changes made by one command; if you repeat
460the C-x u several times in a row, each repetition undoes one 448C-/ several times in a row, each repetition undoes one more command.
461additional command.
462 449
463But there are two exceptions: commands that do not change the text do 450But there are two exceptions: commands that do not change the text
464not count (this includes cursor motion commands and scrolling 451don't count (this includes cursor motion commands and scrolling
465commands), and self-inserting characters are usually handled in groups 452commands), and self-inserting characters are usually handled in groups
466of up to 20. (This is to reduce the number of C-x u's you have to 453of up to 20. (This is to reduce the number of C-/'s you have to type
467type to undo insertion of text.) 454to undo insertion of text.)
468 455
469>> Kill this line with C-k, then type C-x u and it should reappear. 456>> Kill this line with C-k, then type C-/ and it should reappear.
470 457
471C-_ is an alternative undo command; it works just the same as C-x u, 458C-_ is an alternative undo command; it works exactly the same as C-/.
472but it is easier to type several times in a row. The disadvantage of 459On some text terminals, typing C-/ actually sends C-_ to Emacs.
473C-_ is that on some keyboards it is not obvious how to type it. That 460Alternatively, C-x u also works exactly like C-/, but is a little less
474is why we provide C-x u as well. On some terminals, you can type C-_ 461convenient to type.
475by typing / while holding down CONTROL.
476 462
477A numeric argument to C-_ or C-x u acts as a repeat count. 463A numeric argument to C-/, C-_, or C-x u acts as a repeat count.
478 464
479You can undo deletion of text just as you can undo killing of text. 465You can undo deletion of text just as you can undo killing of text.
480The distinction between killing something and deleting it affects 466The distinction between killing something and deleting it affects
@@ -485,9 +471,9 @@ whether you can yank it with C-y; it makes no difference for undo.
485------- 471-------
486 472
487In order to make the text you edit permanent, you must put it in a 473In order to make the text you edit permanent, you must put it in a
488file. Otherwise, it will go away when your invocation of Emacs goes 474file. Otherwise, it will go away when you exit Emacs. In order to
489away. In order to put your text in a file, you must "find" the file 475put your text in a file, you must "find" the file before you enter the
490before you enter the text. (This is also called "visiting" the file.) 476text. (This is also called "visiting" the file.)
491 477
492Finding a file means that you see the contents of the file within 478Finding a file means that you see the contents of the file within
493Emacs. In many ways, it is as if you were editing the file itself. 479Emacs. In many ways, it is as if you were editing the file itself.
@@ -498,17 +484,16 @@ you save, Emacs leaves the original file under a changed name in case
498you later decide that your changes were a mistake. 484you later decide that your changes were a mistake.
499 485
500If you look near the bottom of the screen you will see a line that 486If you look near the bottom of the screen you will see a line that
501begins with dashes, and starts with "--:--- TUTORIAL" or something 487begins with dashes, and starts with " -:--- TUTORIAL" or something
502like that. This part of the screen normally shows the name of the 488like that. This part of the screen normally shows the name of the
503file that you are visiting. Right now, you are visiting a file called 489file that you are visiting. Right now, you are visiting your personal
504"TUTORIAL" which is your personal scratch copy of the Emacs tutorial. 490copy of the Emacs tutorial, which is called "TUTORIAL". When you find
505When you find a file with Emacs, that file's name will appear in that 491a file with Emacs, that file's name will appear in that precise spot.
506precise spot.
507 492
508One special thing about the command for finding a file is that you 493One special thing about the command for finding a file is that you
509have to say what file name you want. We say the command "reads an 494have to say what file name you want. We say the command "reads an
510argument from the terminal" (in this case, the argument is the name of 495argument" (in this case, the argument is the name of the file). After
511the file). After you type the command 496you type the command
512 497
513 C-x C-f Find a file 498 C-x C-f Find a file
514 499
@@ -525,13 +510,12 @@ you can cancel the command with C-g.
525 minibuffer. So you do not find any file. 510 minibuffer. So you do not find any file.
526 511
527When you have finished entering the file name, type <Return> to 512When you have finished entering the file name, type <Return> to
528terminate it. The C-x C-f command goes to work, and finds the file 513terminate it. The minibuffer disappears, and the C-x C-f command goes
529you chose. The minibuffer disappears when the C-x C-f command is 514to work to find the file you chose.
530finished.
531 515
532In a little while the file contents appear on the screen, and you can 516The file contents now appear on the screen, and you can edit the
533edit the contents. When you wish to make your changes permanent, 517contents. When you wish to make your changes permanent, type the
534type the command 518command
535 519
536 C-x C-s Save the file 520 C-x C-s Save the file
537 521
@@ -544,8 +528,9 @@ When saving is finished, Emacs displays the name of the file written.
544You should save fairly often, so that you will not lose very much 528You should save fairly often, so that you will not lose very much
545work if the system should crash (see the section "Auto Save" below). 529work if the system should crash (see the section "Auto Save" below).
546 530
547>> Type C-x C-s, saving your copy of the tutorial. 531>> Type C-x C-s TUTORIAL <Return>.
548 This should show "Wrote ...TUTORIAL" at the bottom of the screen. 532 This should save this tutorial to a file named TUTORIAL, and show
533 "Wrote ...TUTORIAL" at the bottom of the screen.
549 534
550You can find an existing file, to view it or edit it. You can also 535You can find an existing file, to view it or edit it. You can also
551find a file which does not already exist. This is the way to create a 536find a file which does not already exist. This is the way to create a
@@ -563,14 +548,9 @@ If you find a second file with C-x C-f, the first file remains
563inside Emacs. You can switch back to it by finding it again with 548inside Emacs. You can switch back to it by finding it again with
564C-x C-f. This way you can get quite a number of files inside Emacs. 549C-x C-f. This way you can get quite a number of files inside Emacs.
565 550
566>> Create a file named "foo" by typing C-x C-f foo <Return>.
567 Then insert some text, edit it, and save "foo" by typing C-x C-s.
568 Finally, type C-x C-f TUTORIAL <Return>
569 to come back to the tutorial.
570
571Emacs stores each file's text inside an object called a "buffer". 551Emacs stores each file's text inside an object called a "buffer".
572Finding a file makes a new buffer inside Emacs. To see a list of the 552Finding a file makes a new buffer inside Emacs. To see a list of the
573buffers that currently exist in your Emacs job, type 553buffers that currently exist, type
574 554
575 C-x C-b List buffers 555 C-x C-b List buffers
576 556
@@ -589,22 +569,24 @@ that corresponds to a file, you can do it by visiting the file again
589with C-x C-f. But there is an easier way: use the C-x b command. 569with C-x C-f. But there is an easier way: use the C-x b command.
590In that command, you have to type the buffer's name. 570In that command, you have to type the buffer's name.
591 571
592>> Type C-x b foo <Return> to go back to the buffer "foo" which holds 572>> Create a file named "foo" by typing C-x C-f foo <Return>.
593 the text of the file "foo". Then type C-x b TUTORIAL <Return> 573 Then type C-x b TUTORIAL <Return> to come back to this tutorial.
594 to come back to this tutorial.
595 574
596Most of the time, the buffer's name is the same as the file name 575Most of the time, the buffer's name is the same as the file name
597(without the file directory part). However, this is not always true. 576(without the file directory part). However, this is not always true.
598The buffer list you make with C-x C-b always shows you the name of 577The buffer list you make with C-x C-b shows you both the buffer name
599every buffer. 578and the file name of every buffer.
600 579
601ANY text you see in an Emacs window is always part of some buffer. 580ANY text you see in an Emacs window is always part of some buffer.
602Some buffers do not correspond to files. For example, the buffer 581Some buffers do not correspond to files. The buffer named
603named "*Buffer List*" does not have any file. It is the buffer which 582"*Buffer List*", which contains the buffer list that you made with
604contains the buffer list that you made with C-x C-b. The buffer named 583C-x C-b, does not have any file. This TUTORIAL buffer initially did
605"*Messages*" also does not correspond to any file; it contains the 584not have a file, but now it does, because in the previous section you
606messages that have appeared on the bottom line during your Emacs 585typed C-x C-s and saved it to a file.
607session. 586
587The buffer named "*Messages*" also does not correspond to any file.
588This buffer contains the messages that have appeared on the bottom
589line during your Emacs session.
608 590
609>> Type C-x b *Messages* <Return> to look at the buffer of messages. 591>> Type C-x b *Messages* <Return> to look at the buffer of messages.
610 Then type C-x b TUTORIAL <Return> to come back to this tutorial. 592 Then type C-x b TUTORIAL <Return> to come back to this tutorial.
@@ -646,23 +628,21 @@ session--this is the command C-x C-c. (Do not worry about losing
646changes you have made; C-x C-c offers to save each changed file before 628changes you have made; C-x C-c offers to save each changed file before
647it kills Emacs.) 629it kills Emacs.)
648 630
649If you are using a graphical display that supports multiple 631If you are using a graphical display, you don't need any special
650applications in parallel, you don't need any special command to move 632command to move from Emacs to another application. You can do this
651from Emacs to another application. You can do this with the mouse or 633with the mouse or with window manager commands. However, if you're
652with window manager commands. However, if you're using a text 634using a text terminal which can only show one application at a time,
653terminal which can only show one application at a time, you need to 635you need to "suspend" Emacs to move to any other program.
654"suspend" Emacs to move to any other program.
655 636
656C-z is the command to exit Emacs *temporarily*--so that you can go 637C-z is the command to exit Emacs *temporarily*--so that you can go
657back to the same Emacs session afterward. When Emacs is running on a 638back to the same Emacs session afterward. When Emacs is running on a
658text terminal, C-z "suspends" Emacs; that is, it returns to the shell 639text terminal, C-z "suspends" Emacs; that is, it returns to the shell
659but does not destroy the Emacs. In the most common shells, you can 640but does not destroy the Emacs job. In the most common shells, you
660resume Emacs with the `fg' command or with `%emacs'. 641can resume Emacs with the `fg' command or with `%emacs'.
661 642
662The time to use C-x C-c is when you are about to log out. It's also 643The time to use C-x C-c is when you are about to log out. It's also
663the right thing to use to exit an Emacs invoked under mail handling 644the right thing to use to exit an Emacs invoked under mail handling
664programs and other miscellaneous utilities, since they may not know 645programs and other miscellaneous utilities.
665how to cope with suspension of Emacs.
666 646
667There are many C-x commands. Here is a list of the ones you have learned: 647There are many C-x commands. Here is a list of the ones you have learned:
668 648
@@ -683,7 +663,7 @@ bottom of the screen with M-x and you should type the name of the
683command; in this case, "replace-string". Just type "repl s<TAB>" and 663command; in this case, "replace-string". Just type "repl s<TAB>" and
684Emacs will complete the name. (<TAB> is the Tab key, usually found 664Emacs will complete the name. (<TAB> is the Tab key, usually found
685above the CapsLock or Shift key near the left edge of the keyboard.) 665above the CapsLock or Shift key near the left edge of the keyboard.)
686End the command name with <Return>. 666Submit the command name with <Return>.
687 667
688The replace-string command requires two arguments--the string to be 668The replace-string command requires two arguments--the string to be
689replaced, and the string to replace it with. You must end each 669replaced, and the string to replace it with. You must end each
@@ -729,18 +709,18 @@ shows them to you at the bottom of the screen in an area called the
729The line immediately above the echo area is called the "mode line". 709The line immediately above the echo area is called the "mode line".
730The mode line says something like this: 710The mode line says something like this:
731 711
732--:**- TUTORIAL 63% L749 (Fundamental)----------------------- 712 -:**- TUTORIAL 63% L749 (Fundamental)
733 713
734This line gives useful information about the status of Emacs and 714This line gives useful information about the status of Emacs and
735the text you are editing. 715the text you are editing.
736 716
737You already know what the filename means--it is the file you have 717You already know what the filename means--it is the file you have
738found. NN% indicates your current position in the text; it means that 718found. NN% indicates your current position in the buffer text; it
739NN percent of the text is above the top of the screen. If the top of 719means that NN percent of the buffer is above the top of the screen.
740the file is on the screen, it will say "Top" instead of " 0%". If the 720If the top of the buffer is on the screen, it will say "Top" instead
741bottom of the text is on the screen, it will say "Bot". If you are 721of " 0%". If the bottom of the buffer is on the screen, it will say
742looking at text so small that all of it fits on the screen, the mode 722"Bot". If you are looking at a buffer so small that all of it fits on
743line says "All". 723the screen, the mode line says "All".
744 724
745The L and digits indicate position in another way: they give the 725The L and digits indicate position in another way: they give the
746current line number of point. 726current line number of point.
@@ -783,7 +763,7 @@ differently.
783 763
784To view documentation on your current major mode, type C-h m. 764To view documentation on your current major mode, type C-h m.
785 765
786>> Use C-u C-v once or more to bring this line near the top of screen. 766>> Type C-l C-l to bring this line to the top of screen.
787>> Type C-h m, to see how Text mode differs from Fundamental mode. 767>> Type C-h m, to see how Text mode differs from Fundamental mode.
788>> Type C-x 1 to remove the documentation from the screen. 768>> Type C-x 1 to remove the documentation from the screen.
789 769
@@ -829,10 +809,10 @@ that paragraph.
829* SEARCHING 809* SEARCHING
830----------- 810-----------
831 811
832Emacs can do searches for strings (these are groups of contiguous 812Emacs can do searches for strings (a "string" is a group of contiguous
833characters or words) either forward through the text or backward 813characters) either forward through the text or backward through it.
834through it. Searching for a string is a cursor motion command; 814Searching for a string is a cursor motion command; it moves the cursor
835it moves the cursor to the next place where that string appears. 815to the next place where that string appears.
836 816
837The Emacs search command is "incremental". This means that the 817The Emacs search command is "incremental". This means that the
838search happens while you type in the string to search for. 818search happens while you type in the string to search for.
@@ -850,7 +830,7 @@ you want to search for. <Return> terminates a search.
850 character to notice what happens to the cursor. 830 character to notice what happens to the cursor.
851 Now you have searched for "cursor", once. 831 Now you have searched for "cursor", once.
852>> Type C-s again, to search for the next occurrence of "cursor". 832>> Type C-s again, to search for the next occurrence of "cursor".
853>> Now type <Delback> four times and see how the cursor moves. 833>> Now type <DEL> four times and see how the cursor moves.
854>> Type <Return> to terminate the search. 834>> Type <Return> to terminate the search.
855 835
856Did you see what happened? Emacs, in an incremental search, tries to 836Did you see what happened? Emacs, in an incremental search, tries to
@@ -859,27 +839,23 @@ go to the next occurrence of 'cursor' just type C-s again. If no such
859occurrence exists, Emacs beeps and tells you the search is currently 839occurrence exists, Emacs beeps and tells you the search is currently
860"failing". C-g would also terminate the search. 840"failing". C-g would also terminate the search.
861 841
862(Note that on some systems, typing C-s will freeze the screen and you 842If you are in the middle of an incremental search and type <DEL>, this
863will see no further output from Emacs. This indicates that an 843the search "retreats" to an earlier location. If you type <DEL> just
864operating system "feature" called "flow control" is intercepting the 844after you had typed C-s to advance to the next occurrence of a search
865C-s and not letting it get through to Emacs. To unfreeze the screen, 845string, the <DEL> moves the cursor back to an earlier occurrence. If
866type C-q.) 846there are no earlier occurrences, the <DEL> erases the last character
867 847in the search string. For instance, suppose you have typed "c", to
868If you are in the middle of an incremental search and type <Delback>, 848search for the first occurrence of "c". Now if you type "u", the
869you'll notice that the last character in the search string is erased 849cursor will move to the first occurrence of "cu". Now type <DEL>.
870and the search backs up to the last place of the search. For 850This erases the "u" from the search string, and the cursor moves back
871instance, suppose you have typed "c", to search for the first 851to the first occurrence of "c".
872occurrence of "c". Now if you type "u", the cursor will move
873to the first occurrence of "cu". Now type <Delback>. This erases
874the "u" from the search string, and the cursor moves back to
875the first occurrence of "c".
876 852
877If you are in the middle of a search and type a control or meta 853If you are in the middle of a search and type a control or meta
878character (with a few exceptions--characters that are special in 854character (with a few exceptions--characters that are special in a
879a search, such as C-s and C-r), the search is terminated. 855search, such as C-s and C-r), the search is terminated.
880 856
881The C-s starts a search that looks for any occurrence of the search 857C-s starts a search that looks for any occurrence of the search string
882string AFTER the current cursor position. If you want to search for 858AFTER the current cursor position. If you want to search for
883something earlier in the text, type C-r instead. Everything that we 859something earlier in the text, type C-r instead. Everything that we
884have said about C-s also applies to C-r, except that the direction of 860have said about C-s also applies to C-r, except that the direction of
885the search is reversed. 861the search is reversed.
@@ -888,17 +864,17 @@ the search is reversed.
888* MULTIPLE WINDOWS 864* MULTIPLE WINDOWS
889------------------ 865------------------
890 866
891One of the nice features of Emacs is that you can display more than one 867One of the nice features of Emacs is that you can display more than
892window on the screen at the same time. (Note that Emacs uses the term 868one window on the screen at the same time. (Note that Emacs uses the
893"frames"--described in the next section--for what some other 869term "frames"--described in the next section--for what some other
894applications call "windows". The Emacs manual contains a Glossary of 870applications call "windows". The Emacs manual contains a Glossary of
895Emacs terms.) 871Emacs terms.)
896 872
897>> Move the cursor to this line and type C-u 0 C-l (that's CONTROL-L, not 873>> Move the cursor to this line and type C-l C-l.
898 CONTROL-1).
899 874
900>> Now type C-x 2 which splits the screen into two windows. 875>> Now type C-x 2 which splits the screen into two windows.
901 Both windows display this tutorial. The cursor stays in the top window. 876 Both windows display this tutorial. The editing cursor stays in
877 the top window.
902 878
903>> Type C-M-v to scroll the bottom window. 879>> Type C-M-v to scroll the bottom window.
904 (If you do not have a real META key, type <ESC> C-v.) 880 (If you do not have a real META key, type <ESC> C-v.)
@@ -910,23 +886,24 @@ Emacs terms.)
910>> Type C-x o again to move the cursor back to the top window. 886>> Type C-x o again to move the cursor back to the top window.
911 The cursor in the top window is just where it was before. 887 The cursor in the top window is just where it was before.
912 888
913You can keep using C-x o to switch between the windows. Each 889You can keep using C-x o to switch between the windows. The "selected
914window has its own cursor position, but only one window actually 890window", where most editing takes place, is the one with a prominent
915shows the cursor. All the ordinary editing commands apply to the 891cursor which blinks when you are not typing. The other windows have
916window that the cursor is in. We call this the "selected window". 892their own cursor positions; if you are running Emacs in a graphical
893display, those cursors are drawn as unblinking hollow boxes.
917 894
918The command C-M-v is very useful when you are editing text in one 895The command C-M-v is very useful when you are editing text in one
919window and using the other window just for reference. You can keep 896window and using the other window just for reference. Without leaving
920the cursor always in the window where you are editing, and advance 897the selected window, you can scroll the other window with C-M-v.
921through the other window sequentially with C-M-v.
922 898
923C-M-v is an example of a CONTROL-META character. If you have a real 899C-M-v is an example of a CONTROL-META character. If you have a META
924META key, you can type C-M-v by holding down both CONTROL and META while 900(or Alt) key, you can type C-M-v by holding down both CONTROL and META
925typing v. It does not matter whether CONTROL or META "comes first," 901while typing v. It does not matter whether CONTROL or META "comes
926because both of these keys act by modifying the characters you type. 902first," as both of these keys act by modifying the characters you
903type.
927 904
928If you do not have a real META key, and you use <ESC> instead, the 905If you do not have a META key, and you use <ESC> instead, the order
929order does matter: you must type <ESC> followed by CONTROL-v, because 906does matter: you must type <ESC> followed by CONTROL-v, because
930CONTROL-<ESC> v will not work. This is because <ESC> is a character 907CONTROL-<ESC> v will not work. This is because <ESC> is a character
931in its own right, not a modifier key. 908in its own right, not a modifier key.
932 909
@@ -953,10 +930,12 @@ Here is another way to use two windows to display two different things:
953* MULTIPLE FRAMES 930* MULTIPLE FRAMES
954------------------ 931------------------
955 932
956Emacs can also create multiple "frames" (unless you are using a 933Emacs can also create multiple "frames". A frame is what we call one
957text-only terminal). A frame is what we call one collection of 934collection of windows, together with its menus, scroll bars, echo
958windows, together with its menus, scroll bars, echo area, etc. 935area, etc. On graphical displays, what Emacs calls a "frame" is what
959(Some other applications call a frame a "window".) 936most other applications call a "window". Multiple graphical frames
937can be shown on the screen at the same time. On a text terminal, only
938one frame can be shown at a time.
960 939
961>> Type M-x make-frame <Return>. 940>> Type M-x make-frame <Return>.
962 See a new frame appear on your screen. 941 See a new frame appear on your screen.
@@ -967,10 +946,10 @@ There is nothing special about the first frame.
967>> Type M-x delete-frame <Return>. 946>> Type M-x delete-frame <Return>.
968 This removes the selected frame. 947 This removes the selected frame.
969 948
970You can also remove a frame by using the normal method provided by 949You can also remove a frame by using the normal method provided by the
971your window manager (often clicking a button with an "X" at a top 950graphical system (often clicking a button with an "X" at a top corner
972corner of the frame). No information is lost when you close a frame 951of the frame). If you remove the Emacs job's last frame this way,
973(or window), it is simply removed from sight and can be restored later. 952that exits Emacs.
974 953
975 954
976* RECURSIVE EDITING LEVELS 955* RECURSIVE EDITING LEVELS
@@ -1035,11 +1014,11 @@ To get more information about a command, use C-h k instead of C-h c.
1035 1014
1036>> Type C-h k C-p. 1015>> Type C-h k C-p.
1037 1016
1038This displays the documentation of the function, as well as its 1017This displays the documentation of the function, as well as its name,
1039name, in an Emacs window. When you are finished reading the 1018in an Emacs window. When you are finished reading the output, type
1040output, type C-x 1 to get rid of the help text. You do not have 1019C-x 1 to get rid of that window. You do not have to do this right
1041to do this right away. You can do some editing while referring 1020away. You can do some editing while referring to the help text, and
1042to the help text, and then type C-x 1. 1021then type C-x 1.
1043 1022
1044Here are some other useful C-h options: 1023Here are some other useful C-h options:
1045 1024