]> code.delx.au - gnu-emacs/blobdiff - etc/TUTORIAL
(gnus-start-news-server): Use expand-file-name, not
[gnu-emacs] / etc / TUTORIAL
index 4ba7627a24ec843481e68654c0b8d3174fe2c5de..4437ecd47b04b112e9bb10652bb357fbe2a564bd 100644 (file)
@@ -59,8 +59,8 @@ move to a specific place within the text on the screen?
 There are several ways you can do this.  The most basic way is to use
 the commands C-p, C-b, C-f, and C-n.  Each of these commands moves the
 cursor one row or column in a particular direction on the screen.
-Here is a table showing these four commands and shows the directions
-they move:
+Here is a table showing these four commands and the directions they
+move:
  
                          Previous line, C-p
                                  :
@@ -179,39 +179,45 @@ to type M-< also; without the shift key, you would be typing M-comma.
 You can also move the cursor with the arrow keys, if your terminal has
 arrow keys.  We recommend learning C-b, C-f, C-n and C-p for three
 reasons.  First, they work on all kinds of terminals.  Second, once
-you gain practice at using Emacs, you will find that typing these CTRL
+you gain practice at using Emacs, you will find that typing these Control
 characters is faster than typing the arrow keys (because you do not
 have to move your hands away from touch-typing position).  Third, once
-you form the habit of using these CTRL character commands, you can
+you form the habit of using these Control character commands, you can
 easily learn to use other advanced cursor motion commands as well.
 
 Most Emacs commands accept a numeric argument; for most commands, this
 serves as a repeat-count.  The way you give a command a repeat count
 is by typing C-u and then the digits before you type the command.  If
-you have a META (or EDIT or ALT) key, there is another alternative way
+you have a META (or EDIT or ALT) key, there is another, alternative way
 to enter a numeric argument: type the digits while holding down the
 META key.  We recommend learning the C-u method because it works on
-any terminal.
+any terminal.  The numeric argument is also called a "prefix argument",
+because you type the argument before the command it applies to.
 
 For instance, C-u 8 C-f moves forward eight characters.
        
 >> Try using C-n or C-p with a numeric argument, to move the cursor
    to a line near this one with just one command.
 
-Most commands use the numeric argument as a repeat count.  Certain
-exceptional commands use it differently.  C-v and M-v are among the
-exceptions.  When given an argument, they scroll the screen up or down
-by that many lines, rather than by a screenfuls.  For example, C-u 4
-C-v scrolls the screen by 4 lines.
+Most commands use the numeric argument as a repeat count, but some
+commands use it in some other way.  Several commands (but none of
+those you have learned so far) use it as a flag--the presence of a
+prefix argument, regardless of its value, makes the command do
+something different.
+
+C-v and M-v are another kind of exception.  When given an argument,
+they scroll the screen up or down by that many lines, rather than by a
+screenful.  For example, C-u 8 C-v scrolls the screen by 8 lines.
 
 >> Try typing C-u 8 C-v now.
 
 This should have scrolled the screen up by 8 lines.  If you would like
 to scroll it down again, you can give an argument to M-v.
 
-If you are using X Windows, there should be a tall rectangular area
-called a scroll bar at the left hand side of the Emacs window.  You
-can scroll the text by clicking the mouse in the scroll bar.
+If you are using a windowed display, such as X11 or MS-Windows, there
+should be a tall rectangular area called a scroll bar at the left hand
+side of the Emacs window.  You can scroll the text by clicking the
+mouse in the scroll bar.
 
 >> Try pressing the middle button at the top of the highlighted area
    within the scroll bar.  This should scroll the text to a position
@@ -254,7 +260,7 @@ If you really want to try the command, type Space in answer to the
 question.  Normally, if you do not want to execute the disabled
 command, answer the question with "n".
 
->> Type <ESC> : (which is a disabled command),
+>> Type C-x C-l (which is a disabled command),
    then type n to answer the question.
 
 
@@ -279,6 +285,12 @@ other windows.
 
 >> Type C-x 1 and see the documentation listing window disappear.
 
+This command is unlike the other commands you have learned in that it
+consists of two characters.  It starts with the character Control-x.
+There is a whole series of commands that start with Control-x; many of
+them have to do with windows, files, buffers, and related things.
+These commands are two, three or four characters long.
+
 
 * INSERTING AND DELETING
 ------------------------
@@ -344,6 +356,19 @@ started by C-f and M-f (well, <Delete> is not 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.
 
+You can also kill any part of the buffer with one uniform method.
+Move to one end of that part, and type C-@ or C-SPC (either one).
+(SPC is the Space bar.)  Move to the other end of that part, and type
+C-w.  That kills all the text between the two positions.
+
+>> Move the cursor to the Y at the start of the previous paragraph.
+>> Type C-SPC.  Emacs should display a message "Mark set"
+   at the bottom of the screen.
+>> Move the cursor to the n in "end", on the second line of the
+   paragraph.
+>> Type C-w.  This will kill the text starting from the Y,
+   and ending just before the n.
+
 When you delete more than one character at a time, Emacs saves the
 deleted text so that you can bring it back.  Bringing back killed text
 is called "yanking".  You can yank the killed text either at the same
@@ -363,7 +388,7 @@ and spaces, do not save the deleted text.
    which follows that line.
 
 Note that a single C-k kills the contents of the line, and a second
-C-k kills the line itself, and make all the other lines move up.  C-k
+C-k kills the line itself, and makes all the other lines move up.  C-k
 treats a numeric argument specially: it kills that many lines AND
 their contents.  This is not mere repetition.  C-u 2 C-k kills two
 lines and their newlines; typing C-k twice would not do that.
@@ -429,7 +454,7 @@ C-_ is an alternative undo command; it works just the same as C-x u,
 but it is easier to type several times in a row.  The disadvantage of
 C-_ is that on some keyboards it is not obvious how to type it.  That
 is why we provide C-x u as well.  On some terminals, you can type C-_
-by typing / while holding down CTRL.
+by typing / while holding down CONTROL.
 
 A numeric argument to C-_ or C-x u acts as a repeat count.
 
@@ -439,8 +464,8 @@ A numeric argument to C-_ or C-x u acts as a repeat count.
 
 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
-away.  You put your editing in a file by "finding" the file.  (This is
-also called "visiting" the file.)
+away.  In order to put your text in a file, you must "find" the file
+before you enter the text.  (This is also called "visiting" the file.)
 
 Finding a file means that you see the contents of the file within
 Emacs.  In many ways, it is as if you were editing the file itself.
@@ -458,17 +483,10 @@ called "TUTORIAL" which is your personal scratch copy of the Emacs
 tutorial.  When you find a file with Emacs, that file's name will
 appear in that precise spot.
 
-The commands for finding and saving files are unlike the other
-commands you have learned in that they consist of two characters.
-They both start with the character Control-x.  There is a whole series
-of commands that start with Control-x; many of them have to do with
-files, buffers, and related things.  These commands are two, three or
-four characters long.
-
-Another thing about the command for finding a file is that you have
-to say what file name you want.  We say the command "reads an argument
-from the terminal" (in this case, the argument is the name of the
-file).  After you type the command
+One special thing about the command for finding a file is that you
+have to say what file name you want.  We say the command "reads an
+argument from the terminal" (in this case, the argument is the name of
+the file).  After you type the command
 
        C-x C-f   Find a file
 
@@ -535,9 +553,9 @@ C-x C-f.  This way you can get quite a number of files inside Emacs.
    Finally, type C-x C-f TUTORIAL <Return>
    to come back to the tutorial.
 
-Emacs stores each file's text inside an object called a "buffer."
+Emacs stores each file's text inside an object called a "buffer".
 Finding a file makes a new buffer inside Emacs.  To see a list of the
-buffers that current exist in your Emacs job, type
+buffers that currently exist in your Emacs job, type
 
        C-x C-b   List buffers
 
@@ -570,6 +588,7 @@ buffer.
    It should ask you whether to save the buffer named TUTORIAL.
    Answer yes to the question by typing "y".
 
+
 * EXTENDING THE COMMAND SET
 ---------------------------
 
@@ -613,6 +632,7 @@ There are many C-x commands.  Here is a list of the ones you have learned:
        C-x C-s         Save file.
        C-x C-b         List buffers.
        C-x C-c         Quit Emacs.
+       C-x 1           Delete all but one window.
        C-x u           Undo.
 
 Named eXtended commands are commands which are used even less
@@ -621,7 +641,9 @@ example is the command replace-string, which globally replaces one
 string with another.  When you type M-x, Emacs prompts you at the
 bottom of the screen with M-x and you should type the name of the
 command; in this case, "replace-string".  Just type "repl s<TAB>" and
-Emacs will complete the name.  End the command name with <Return>.
+Emacs will complete the name.  (<TAB> is the Tab key, usually found
+above the CapsLock or Shift key near the left edge of the keyboard.)
+End the command name with <Return>.
 
 The replace-string command requires two arguments--the string to be
 replaced, and the string to replace it with.  You must end each
@@ -648,23 +670,23 @@ Emacs deletes its auto save file.
 
 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
+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.
 
 
 * ECHO AREA
 -----------
 
-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
-area contains the bottom line of the screen.
+If Emacs sees that you are typing multicharacter commands slowly, it
+shows them to you at the bottom of the screen in an area called the
+"echo area".  The echo area contains the bottom line of the screen.
 
 
 * MODE LINE
 -----------
 
-The line immediately above the echo area it is called the "mode line".
+The line immediately above the echo area is called the "mode line".
 The mode line says something like this:
 
 --:**  TUTORIAL          (Fundamental)--L670--58%----------------
@@ -680,6 +702,9 @@ top of the file is on the screen, it will say --Top-- instead of
 --Bot--.  If you are looking at text so small that all of it fits on
 the screen, the mode line says --All--.
 
+The L and digits indicate position in another way: they give the
+current line number of point.
+
 The stars near the front mean that you have made changes to the text.
 Right after you visit or save a file, that part of the mode line shows
 no stars, just dashes.
@@ -704,9 +729,9 @@ switch to 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>.
+>> Type M-x text mode<Return>.
 
-Don't worry, none of the commands you have learned changes Emacs in
+Don't worry, none of the  Emacs commands you have learned changes in
 any great way.  But you can observe that M-f and M-b now treat
 apostrophes as part of words.  Previously, in Fundamental mode,
 M-f and M-b treated apostrophes as word-separators.
@@ -722,7 +747,7 @@ To view documentation on your current major mode, type C-h m.
 >> Type C-x 1 to remove the documentation from the screen.
 
 Major modes are called major because there are also minor modes.
-Minor modes are alternatives not to the major modes, just minor
+Minor modes are not alternatives to the major modes, just minor
 modifications of them.  Each minor mode can be turned on or off by
 itself, independent of all other minor modes, and independent of your
 major mode.  So you can use no minor modes, or one minor mode, or any
@@ -733,13 +758,13 @@ text, is Auto Fill mode.  When this mode is on, Emacs breaks the line
 in between words automatically whenever you insert text and make a
 line that is too wide.
 
-You can turn Auto Fill mode on by doing M-x auto-fill-mode<Return>.
-When the mode is on, you can turn it off by doing M-x
-auto-fill-mode<Return>.  If the mode is off, this command turns it on,
+You can turn Auto Fill mode on by doing M-x auto fill mode<Return>.
+When the mode is on, you can turn it off again by doing M-x
+auto fill mode<Return>.  If the mode is off, this command turns it on,
 and if the mode is on, this command turns it off.  We say that the
 command "toggles the mode".
 
->> Type M-x auto-fill-mode<Return> now.  Then insert a line of "asdf "
+>> Type M-x auto fill mode<Return> now.  Then insert a line of "asdf "
    over again until you see it divide into two lines.  You must put in
    spaces between them because Auto Fill breaks lines only at spaces.
 
@@ -752,13 +777,14 @@ as a numeric argument.
    characters with it.  Then set the margin back to 70 using
    C-x f again.
 
-If you makes changes in the middle of a paragraph, Auto Fill mode
+If you make changes in the middle of a paragraph, Auto Fill mode
 does not re-fill it for you.
 To re-fill the paragraph, type M-q (Meta-q) with the cursor inside
 that paragraph.
 
 >> Move the cursor into the previous paragraph and type M-q.
 
+
 * SEARCHING
 -----------
 
@@ -777,7 +803,7 @@ for reverse search.  BUT WAIT!  Don't try them now.
 When you type C-s you'll 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.  <RET> terminates a search.
+you want to search for.  <Return> 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
@@ -785,13 +811,13 @@ you want to search for.  <RET> terminates a search.
    Now you have searched for "cursor", once.
 >> Type C-s again, to search for the next occurrence of "cursor".
 >> Now type <Delete> four times and see how the cursor moves.
->> Type <RET> to terminate the search.
+>> Type <Return> 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 to the next occurrence of 'cursor' just type C-s again.  If no such
-occurrence exists Emacs beeps and tells you the search is currently
-"failing", C-g would also terminate the search.
+occurrence exists, Emacs beeps and tells you the search is currently
+"failing" C-g would also terminate the search.
 
 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
@@ -826,7 +852,8 @@ the search is reversed.
 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.
+>> Move the cursor to this line and type C-u 0 C-l (that's control-L, not
+   control-1).
 
 >> Now type C-x 2 which splits the screen into two windows.
    Both windows display this tutorial.  The cursor stays in the top window.
@@ -852,14 +879,14 @@ the cursor always in the window where you are editing, and advance
 through the other window sequentially with C-M-v.
 
 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 does not matter whether CTRL or META "comes first,"
+META key, you can type C-M-v by holding down both CONTROL and META while
+typing v.  It does not matter whether CONTROL or META "comes first,"
 because both of these keys act by modifying the characters you type.
 
 If you do not 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.
+does matter: you must type ESC followed by Control-v, because
+Control-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.
 
@@ -922,13 +949,13 @@ type C-g to cancel it.
 should not do this as a blanket measure for all users, so you have
 grounds to complain to the system administrator.  Meanwhile, if C-h
 does not display a message about help at the bottom of the screen, try
-typing the F1 key or M-x help RET instead.)
+typing the F1 key or M-x help <Return> instead.)
 
 The most basic HELP feature is C-h c.  Type C-h, the character c, and
 a command character or sequence; then Emacs displays a very brief
 description of the command.
 
->> Type C-h c Control-p.
+>> Type C-h c C-p.
   The message should be something like
 
        C-p runs the command previous-line
@@ -944,7 +971,7 @@ EDIT or ALT key) <ESC>v are also allowed after C-h c.
 
 To get more information about a command, use C-h k instead of C-h c.
 
->> Type C-h k Control-p.
+>> Type C-h k C-p.
 
 This displays the documentation of the function, as well as its
 name, in an Emacs window.  When you are finished reading the
@@ -988,8 +1015,8 @@ This tutorial is meant to be understandable to all new users, so if
 you found something unclear, don't sit and blame yourself - complain!
 
 
-COPYING
--------
+COPYING
+---------
 
 This tutorial descends from a long line of Emacs tutorials
 starting with the one written by Stuart Cracraft for the original Emacs.