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
:
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. The numeric argument is also called a "prefix argument",
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
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
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.
It should ask you whether to save the buffer named TUTORIAL.
Answer yes to the question by typing "y".
+
* EXTENDING THE COMMAND SET
---------------------------
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
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
* 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%----------------
--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.
should probably use Text Mode.
>> 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.
>> 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
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
+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".
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
-----------
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
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.
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
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
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.