diff etc/TUTORIAL @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 376386a54a3c
children 3bb7ccffb0c0
line wrap: on
line diff
--- a/etc/TUTORIAL	Mon Aug 13 09:00:04 2007 +0200
+++ b/etc/TUTORIAL	Mon Aug 13 09:02:59 2007 +0200
@@ -1,5 +1,4 @@
-Copyright (c) 1985, 1994 Free Software Foundation, Inc.
-See end for conditions.
+Copyright (c) 1985, 1996 Free Software Foundation, Inc. See end for conditions.
 
 You are looking at the Emacs tutorial.
 
@@ -38,8 +37,8 @@
 >>  Try typing M-v and then C-v to move back and forth a few times.
 
 
-SUMMARY
--------
+* SUMMARY
+---------
 
 The following commands are useful for viewing screenfuls:
 
@@ -56,8 +55,8 @@
    Find the cursor again and see what text is near it now.
 
 
-BASIC CURSOR CONTROL
---------------------
+* BASIC CURSOR CONTROL
+----------------------
 
 Getting from screenful to screenful is useful, but how do you
 reposition yourself within a given screen to a specific place?
@@ -184,9 +183,20 @@
 Did it scroll the screen up by 8 lines?  If you would like to
 scroll it down you can give an argument to M-v.
 
+If you are using X Windows, there is probably a rectangular area
+called a scroll bar at the right hand side of the Emacs window.  You
+can scroll the text by manipulating the scroll bar with the mouse.
 
-CURSOR CONTROL WITH AN X TERMINAL
----------------------------------
+>> Try pressing the middle button at the top of the highlighted area
+within the scroll bar, then moving the mouse while holding that button
+down.
+
+>> Move the mouse to a point in the scroll bar about three lines from
+the top, and click the left button a couple of times.
+
+
+* CURSOR CONTROL WITH AN X TERMINAL
+-----------------------------------
 
 If you have an X terminal, you will probably find it easier to use
 the keys on the keypad to control the cursor.  The left, right, up,
@@ -208,8 +218,8 @@
 between keystrokes.
 
 
-WHEN EMACS IS HUNG
-------------------
+* WHEN EMACS IS HUNG
+--------------------
 
 If Emacs gets into an infinite (or simply very long) computation which
 you don't want to finish, you can stop it safely by typing C-g.
@@ -221,27 +231,26 @@
    If you have typed an <ESC> by mistake, you can get rid of it
    with a C-g.
 
-If you type <ESC> <ESC>, you get a new window appearing on
-the screen, telling you that M-ESC is a "disabled command"
-and asking whether you really want to execute it.  The command
-M-ESC is marked as disabled because you probably don't want to
-use it until you know more about Emacs, and we expect it would
-confuse you if it were allowed to go ahead and run.  If you really
-want to try the M-ESC command, you could type a Space in answer
-to the question and M-ESC would go ahead.  Normally, if you do
-not want to execute M-ESC, you would type "n" to answer the question.
+If you type <ESC> : then you get a new window appearing on the screen,
+telling you that M-: is a "disabled command" and asking whether you
+really want to execute it.  The command M-: is marked as disabled
+because we expect it would confuse beginners and you probably don't
+want to use it until you know more about Emacs.  If you really want to
+try the M-: command, you could type a Space in answer to the question,
+and M-: would go ahead.  Normally, if you do not want to execute M-:,
+you would type "n" to answer the question.
 
->> Type <ESC> <ESC>, then type n.
+>> Type <ESC> :, then type n.
 
 
-WINDOWS
--------
+* WINDOWS
+---------
 
 Emacs can have several windows, each displaying its own text.
 Note that "window" as used by Emacs does not refer to separate
 overlapping windows in the window system, but to separate panes
 within a single X window. (Emacs can also have multiple X
-windows, or "screens" in Emacs terminology.  This is described
+windows, or "frames" in Emacs terminology.  This is described
 later.)
 
 At this stage it is better not to go into the techniques of
@@ -270,19 +279,23 @@
 >> Type C-x 1 and see the documentation listing window disappear.
 
 
-INSERTING AND DELETING
-----------------------
+* INSERTING AND DELETING
+------------------------
 
 If you want to insert text, just type it.  Characters which you can
 see, such as A, 7, *, etc. are taken by Emacs as text and inserted
 immediately.  Type <Return> (the carriage-return key) to insert a
 Newline character.
 
-You can delete the last character you typed by typing <Rubout>.
-On X terminals, <Rubout> is normally the key labelled BACK SPACE.
+You can delete the last character you typed by typing <Delete>.
+<Delete> is a key on the keyboard, which may be labeled "Del".  In
+some cases, the "Backspace" key serves as <Delete>, but not always!
+
+More generally, <Delete> deletes the character immediately before the
+current cursor position.
 
 >> Do this now, type a few characters and then delete them
-   by typing <Rubout> a few times.  Don't worry about this file
+   by typing <Delete> a few times.  Don't worry about this file
    being changed; you won't affect the master tutorial.  This is just
    a copy of it.
 
@@ -291,10 +304,10 @@
    screen, the line of text is "continued" onto a second screen line.
    The backslash at the right margin indicates a line which has
    been continued.
->> Use <Rubout>s to delete the text until the line fits on one screen
+>> Use <Delete>s to delete the text until the line fits on one screen
    line again.  The continuation line goes away.
 
->> Move the cursor to the beginning of a line and type <Rubout>.  This
+>> Move the cursor to the beginning of a line and type <Delete>.  This
    deletes the newline before the line and merges the line onto
    the previous line.  The resulting line may be too long to fit, in
    which case it has a continuation line.
@@ -309,17 +322,17 @@
 Emacs and correcting errors.  You can delete by words or lines
 as well.  Here is a summary of the delete operations:
 
-	<Rubout>     delete the character just before the cursor
+	<Delete>     delete the character just before the cursor
 	C-d   	     delete the next character after the cursor
 
-	M-<Rubout>   kill the word immediately before the cursor
+	M-<Delete>   kill the word immediately before the cursor
 	M-d	     kill the next word after the cursor
 
 	C-k	     kill from the cursor position to end of line
 	M-k	     kill to the end of the current sentence
 
-Notice that <Rubout> and C-d vs M-<Rubout> and M-d extend the parallel
-started by C-f and M-f (well, <Rubout> isn't really a control
+Notice that <Delete> and C-d vs M-<Delete> and M-d extend the parallel
+started by C-f and M-f (well, <Delete> isn't really a control
 character, but let's not worry about that).  C-k and M-k are like C-e
 and M-e, sort of, in that lines are opposite sentences.
 
@@ -334,7 +347,7 @@
 attack only one character, or nothing but blank lines and spaces, do
 not save.
 
-For instance, type C-n a couple times to postion the cursor
+For instance, type C-n a couple times to position the cursor
 at some line on this screen.
 
 >> Do this now, move the cursor and kill that line with C-k.
@@ -381,8 +394,8 @@
    arguments.
 
 
-UNDO
-----
+* UNDO
+------
 
 Any time you make a change to the text and wish you had not done so,
 you can undo the change (return the text to its previous state)
@@ -406,8 +419,8 @@
 it as many times as the argument says.
 
 
-FILES
------
+* FILES
+-------
 
 In order to make the text you edit permanent, you must put it in a
 file.  Otherwise, it will go away when your invocation of Emacs goes
@@ -468,6 +481,13 @@
    This should print "Wrote .../TUTORIAL" at the bottom of the screen.
    On VMS it will print "Wrote ...[...]TUTORIAL."
 
+NOTE: On some systems, typing C-x C-s will freeze the screen and you
+will see no further output from Emacs.  This indicates that an
+operating system "feature" called "flow control" is intercepting the
+C-s and not letting it get through to Emacs.  To unfreeze the screen,
+type C-q.  Then see the section "Spontaneous Entry to Incremental
+Search" in the Emacs manual for advice on dealing with this "feature".
+
 To make a new file, just find it "as if" it already existed.  Then
 start typing in the text.  When you ask to "save" the file, Emacs
 will really create the file with the text that you have inserted.
@@ -475,8 +495,8 @@
 existing file.
 
 
-BUFFERS
--------
+* BUFFERS
+---------
 
 If you find a second file with C-x C-f, the first file remains
 inside Emacs.  You can switch back to it by finding it again with
@@ -514,8 +534,8 @@
 For each such buffer, C-x s asks you whether to save it.
 
 
-USING THE MENU
---------------
+* USING THE MENU
+----------------
 
 If you are on an X terminal, you will notice a menubar at the
 top of the Emacs screen.  You can use this menubar to access all
@@ -534,8 +554,8 @@
 menu and selecting it.
 
 
-USING THE MOUSE
----------------
+* USING THE MOUSE
+-----------------
 
 When running under X, Emacs is fully integrated with the mouse.
 You can position the text cursor by clicking the left button at
@@ -575,8 +595,8 @@
 menu up.
 
 
-EXTENDING THE COMMAND SET
--------------------------
+* EXTENDING THE COMMAND SET
+---------------------------
 
 There are many, many more Emacs commands than could possibly be put
 on all the control and meta characters.  Emacs gets around this with
@@ -593,21 +613,24 @@
 (Don't worry; it offers to save each changed file before it kills the
 Emacs.)
 
-C-z is the usual way to exit Emacs, because it is always better not to
-kill the Emacs if you are going to do any more editing.  On systems
-which allow it, C-z exits from Emacs to the shell but does not destroy
-the Emacs; if you use the C shell, you can resume Emacs with the `fg'
-command (or, more generally, with `%emacs', which works even if your
-most recent job was some other).  On systems where suspending is not
-possible, C-z creates a subshell running under Emacs to give you the
-chance to run other programs and return to Emacs afterward, but it
-does not truly "exit" from Emacs.  In this case, the shell command
-`exit' is the usual way to get back to Emacs from the subshell.
+C-z is the command to exit Emacs *temporarily*--so that you can go
+back to the same Emacs session afterward.
 
-You would use C-x C-c if you were about to log out.  You would
-also use it to exit an Emacs invoked under mail handling programs
-and other random utilities, since they may not believe you have
-really finished using the Emacs if it continues to exist.
+On systems which allow it, C-z exits from Emacs to the shell but does
+not destroy the Emacs; if you use the C shell, you can resume Emacs
+with the `fg' command (or, more generally, with `%emacs', which works
+even if your most recent job was some other).  On systems which don't
+implement suspending, C-z creates a subshell running under Emacs to
+give you the chance to run other programs and return to Emacs
+afterward; it does not truly "exit" from Emacs.  In this case, the
+shell command `exit' is the usual way to get back to Emacs from the
+subshell.
+
+The time to use C-x C-c is when you are about to log out.  It's also
+the right thing to use to exit an Emacs invoked under mail handling
+programs and other random utilities, since they may not know how to
+cope with suspension of Emacs.  On other occasions, use C-z, and
+resume the Emacs when you have more editing to do.
 
 There are many C-x commands.  The ones you know are:
 
@@ -632,12 +655,30 @@
    Then type M-x repl s<Return>changed<Return>altered<Return>.
 
    Notice how this line has changed: you've replaced
-   the word c-h-a-n-g-e-d with "altered" wherever it occured
+   the word c-h-a-n-g-e-d with "altered" wherever it occurred
    after the cursor.
 
 
-MODE LINE
----------
+* AUTO SAVE
+-----------
+
+When you have made changes in a file, but you have not saved them yet,
+they could be lost if your computer crashes.  To protect you from
+this, Emacs writes "auto save" files periodically.  The auto save file
+name has a # at the beginning and the end; for example, if your file
+is named "hello.c", its auto save file's name is "#hello.c#".  When
+you save the file in the normal way, its auto save file is no longer
+necessary so Emacs deletes it.
+
+If the computer crashes, you can recover your auto-saved editing by
+finding the file normally (the file you were editing, not the auto
+save file) and then typing M-x recover file<return>.  When it asks for
+confirmation, type yes<return> to go ahead and recover the auto-save
+data.
+
+
+* MODE LINE
+-----------
 
 If Emacs sees that you are typing commands slowly it shows them to you
 at the bottom of the screen in an area called the "echo area."  The echo
@@ -670,17 +711,17 @@
 what a comment should look like, each major mode has to insert
 comments differently.  Each major mode is the name of an extended
 command, which is how you get into the mode.  For example,
-M-X fundamental-mode is how to get into Fundamental mode.
+M-x fundamental-mode is how to get into Fundamental mode.
 
 If you are going to be editing English text, such as this file, you
 should probably use Text Mode.
 >> Type M-x text-mode<Return>.
 
 Don't worry, none of the commands you have learned changes Emacs in
-any great way.  But you can now observe that periods are no longer
-part of words when you do M-f or M-b!  Major modes are usually like
-that: commands don't change into completely unrelated things, but they
-work a little bit differently.
+any great way.  But you can observe that apostrophes are now part of
+words when you do M-f or M-b.  Major modes are usually like that:
+commands don't change into completely unrelated things, but they work
+a little bit differently.
 
 To get documentation on your current major mode, type C-h m.
 
@@ -724,8 +765,8 @@
 >> Move the cursor into the previous paragraph and type M-q.
 
 
-SEARCHING
----------
+* SEARCHING
+-----------
 
 Emacs can do searches for strings (these are groups of contiguous
 characters or words) either forward through the file or backward
@@ -739,14 +780,14 @@
 notice that the string "I-search" appears as a prompt in the echo
 area.  This tells you that Emacs is in what is called an incremental
 search waiting for you to type the thing that you want to search for.
-<ESC> terminates a search.
+<RET> terminates a search.
 
 >> Now type C-s to start a search.  SLOWLY, one letter at a time,
    type the word 'cursor', pausing after you type each
    character to notice what happens to the cursor.
 >> Type C-s to find the next occurrence of "cursor".
->> Now type <Rubout> four times and see how the cursor moves.
->> Type <ESC> to terminate the search.
+>> Now type <Delete> four times and see how the cursor moves.
+>> Type <RET> to terminate the search.
 
 Did you see what happened?  Emacs, in an incremental search, tries to
 go to the occurrence of the string that you've typed out so far.  To go
@@ -754,19 +795,26 @@
 occurrence exists Emacs beeps and tells you that it is a failing
 search.  C-g would also terminate the search.
 
-If you are in the middle of an incremental search and type <Rubout>,
+NOTE: On some systems, typing C-s will freeze the screen and you will
+see no further output from Emacs.  This indicates that an operating
+system "feature" called "flow control" is intercepting the C-s and not
+letting it get through to Emacs.  To unfreeze the screen, type C-q.
+Then see the section "Spontaneous Entry to Incremental Search" in the
+Emacs manual for advice on dealing with this "feature".
+
+If you are in the middle of an incremental search and type <Delete>,
 you'll notice that the last character in the search string is erased
 and the search backs up to the last place of the search.  For
 instance, suppose you currently have typed 'cu' and you see that your
-cursor is at the first occurrence of 'cu'.  If you now type <Rubout>,
+cursor is at the first occurrence of 'cu'.  If you now type <Delete>,
 the 'u' on the search line is erased and you'll be repositioned in the
 text to the occurrence of 'c' where the search took you before you
 typed the 'u'.  This provides a useful means for backing up while you
 are searching.
 
-If you are in the middle of a search and happen to type a control
-character (other than a C-s or C-r, which tell Emacs to search for the
-next occurrence of the string), the search is terminated.
+If you are in the middle of a search and type a control or meta
+character (with a few exceptions--characters that are special in
+a search, such as C-s and C-r), the search is terminated.
 
 The C-s starts a search that looks for any occurrence of the search
 string AFTER the current cursor position.  But what if you want to
@@ -775,32 +823,90 @@
 that the direction of the search is reversed.
 
 
-RECURSIVE EDITING LEVELS
-------------------------
+* MULTIPLE WINDOWS
+------------------
+
+One of the nice features of Emacs is that you can display more than one
+window on the screen at the same time.
+
+>> Move the cursor to this line and type C-u 0 C-l.
+
+>> Now type C-x 2 which splits the screen into two windows.
+   Both windows display this tutorial.  The cursor stays in the top window.
+
+>> Type C-M-v to scroll the bottom window.
+   (If you don't have a real Meta key, type ESC C-v.)
+
+>> Type C-x o ("o" for "other") to move the cursor to the bottom window.
+>> Use C-v and M-v in the bottom window to scroll it.
+   Keep reading these directions in the top window.
+
+>> Type C-x o again to move the cursor back to the top window.
+   The cursor is still just where it was in the top window before.
+
+You can keep using C-x o to switch between the windows.  Each
+window has its own cursor position, but only one window actually
+shows the cursor.  All the ordinary editing commands apply to the
+window that the cursor is in.
+
+The command C-M-v is very useful when you are editing text in one
+window and using the other window just for reference.  You can keep
+the cursor always in the window where you are editing, and edit
+there as you advance through the other window.
+
+C-M-v is an example of a CONTROL-META character.  If you have a real
+META key, you can type C-M-v by holding down both CTRL and META while
+typing v.
+
+It doesn't matter whether CTRL or META "comes first," because both of
+these keys act by modifying the characters you type.  But if you don't
+have a real META key, and you use ESC instead, the order does matter:
+you must type ESC followed by CTRL-v; CTRL-ESC v will not work.  This
+is because ESC is a character in its own right, not a modifier key.
+
+>> Type C-x 1 (in the top window) to get rid of the bottom window.
+
+(If you had typed C-x 1 in the bottom window, that would get rid
+of the top one.  Think of this command as "Keep just one
+window--the window I am already in.")
+
+You don't have to display the same buffer in both windows.  If
+you use C-x C-f to find a file in one window, the other window
+doesn't change.  You can pick a file in each window
+independently.
+
+Here is another way to use two windows to display two different
+things:
+
+>> Type C-x 4 C-f followed by the name of one of your files.
+   End with <RETURN>.  See the specified file appear in the bottom
+   window.  The cursor goes there, too.
+
+>> Type C-x o to go back to the top window, and C-x 1 to delete
+   the bottom window.
+
+
+* RECURSIVE EDITING LEVELS
+--------------------------
 
 Sometimes you will get into what is called a "recursive editing
 level".  This is indicated by square brackets in the mode line,
 surrounding the parentheses around the major mode name.  For
 example, you might see [(Fundamental)] instead of (Fundamental).
 
-To get out of the recursive editing level, type
-  M-x top-level<Return>.
+To get out of the recursive editing level, type ESC ESC ESC.  That is
+an all-purpose "get out" command.  You can also use it for eliminating
+extra windows, and getting out of the minibuffer.
 
->> Try that now; it should display "Back to top level"
-   at the bottom of the screen.
-
-In fact, you were ALREADY at top level (not inside a recursive editing
-level) if you have obeyed instructions.  M-x top-level does not care;
-it gets out of any number of recursive editing levels, perhaps zero,
-to get back to top level.
+>> Type M-x to get into a minibuffer; then type ESC ESC ESC to get out.
 
 You can't use C-g to get out of a recursive editing level because C-g
-is used for discarding numeric arguments and partially typed commands
-WITHIN the recursive editing level.
+is used for canceling commands and arguments WITHIN the recursive
+editing level.
 
 
-GETTING MORE HELP
------------------
+* GETTING MORE HELP
+-------------------
 
 In this tutorial we have tried to supply just enough information to
 get you started using Emacs.  There is so much available in Emacs that
@@ -815,7 +921,7 @@
 character saying what kind of help you want.  If you are REALLY lost,
 type C-h ? and Emacs will tell you what kinds of help it can give.
 If you have typed C-h and decide you don't want any help, just
-type C-G to cancel it.
+type C-g to cancel it.
 
 The most basic HELP feature is C-h c.  Type C-h, a c, and a
 command character or sequence, and Emacs displays a very brief
@@ -838,11 +944,11 @@
 
 >> Type C-h k Control-p.
 
-This displays the documentation of the function, as well as its name,
-in an Emacs window.  When you are finished reading the output, type
-C-x 1 to get rid of the help text.  You do not have to do this right
-away.  You can do some editing based on the help text before you type
-C-x 1.
+This displays the documentation of the function, as well as its
+name, in an Emacs window.  When you are finished reading the
+output, type C-x 1 to get rid of the help text.  You do not have
+to do this right away.  You can do some editing while referring
+to the help text and then type C-x 1.
 
 Here are some other useful C-h options:
 
@@ -851,7 +957,7 @@
 
 >> Try typing C-h f previous-line<Return>.
    This prints all the information Emacs has about the
-   function which implements the C-P command.
+   function which implements the C-p command.
 
    C-h a	Command Apropos.  Type in a keyword and Emacs will list
 		all the commands whose names contain that keyword.
@@ -859,14 +965,20 @@
 		For some commands, Command Apropos will also list a one
 		or two character sequence which has the same effect.
 
->> Type C-h a file<Return>.  You will see a list of all M-x commands
-with "file" in their names.  You will also see commands
-like C-x C-f and C-x C-w, listed beside the command names
-find-file and write-file.
+>> Type C-h a file<Return>.
+
+This displays in another window a list of all M-x commands with
+"file" in their names.  You will also see commands like C-x C-f
+and C-x C-w, listed beside the command names find-file and
+write-file.
+
+>> Type C-M-v to scroll the help window.  Do this a few times.
+
+>> Type C-x 1 to delete the help window.
 
 
-CONCLUSION
-----------
+* CONCLUSION
+------------
 
 Remember, to exit Emacs permanently use C-x C-c.  To exit to a shell
 temporarily, so that you can come back in, use C-z. (This does not
@@ -882,13 +994,12 @@
 
 This tutorial descends from a long line of Emacs tutorials
 starting with the one written by Stuart Cracraft for the original Emacs.
-It was last modified September 1994 by Ben Wing, who updated the
-tutorial for X.
+Ben Wing updated the tutorial for X Windows.
 
 This version of the tutorial, like GNU Emacs, is copyrighted, and
 comes with permission to distribute copies on certain conditions:
 
-Copyright (c) 1985, 1994 Free Software Foundation
+Copyright (c) 1985, 1996 Free Software Foundation
 
    Permission is granted to anyone to make or distribute verbatim copies
    of this document as received, in any medium, provided that the