Mercurial > hg > xemacs-beta
diff etc/TUTORIAL @ 161:28f395d8dc7a r20-3b7
Import from CVS: tag r20-3b7
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:42:26 +0200 |
parents | 3bb7ccffb0c0 |
children | e45d5e7c476e |
line wrap: on
line diff
--- a/etc/TUTORIAL Mon Aug 13 09:41:47 2007 +0200 +++ b/etc/TUTORIAL Mon Aug 13 09:42:26 2007 +0200 @@ -1,15 +1,20 @@ -Copyright (c) 1985 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. -Emacs commands generally involve the CONTROL key (sometimes labeled -CTRL or CTL) or the META key (sometimes labeled EDIT or ALT). Rather than -write that in full each time, we'll use the following abbreviations: +Emacs commands generally involve the CONTROL key (sometimes labelled +CTRL or CTL) or the META key. On some keyboards, the META key is +labelled ALT or EDIT or something else (for example, on Sun keyboards, +the diamond key to the left of the spacebar is META). If you have no +META key, you can use ESC instead. Rather than write out META or +CONTROL each time we want you to prefix a character, we'll use the +following abbreviations: C-<chr> means hold the CONTROL key while typing the character <chr> Thus, C-f would be: hold the CONTROL key and type f. - M-<chr> means hold the META or EDIT or ALT key down while typing <chr>. - If there is no META, EDIT or ALT key, instead press and release the - ESC key and then type <chr>. We write <ESC> for the ESC key. + M-<chr> means hold the META key down while typing <chr>. If there + is no META key, type <ESC>, release it, then type the + character <chr>. Important note: to end the Emacs session, type C-x C-c. (Two characters.) The characters ">>" at the left margin indicate directions for you to @@ -39,9 +44,8 @@ C-v Move forward one screenful M-v Move backward one screenful - C-l Clear screen and redisplay all the text, - moving the text around the cursor - to the center of the screen. + C-l Clear screen and redisplay everything + putting the text near the cursor at the center. (That's control-L, not control-1.) >> Find the cursor, and note what text is near it. @@ -209,17 +213,39 @@ 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 the X Window system, 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. >> Try pressing the middle button at the top of the highlighted area within the scroll bar. This should scroll the text to a position determined by how high or low you click. ->> Try moving the mouse up and down, while holding the middle button - pressed down. You'll see that the text scrolls up and down as - you move the mouse. +>> 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, +and down arrow keys move in the expected direction; they function +exactly like C-b, C-f, C-p, and C-n, but are easier to type and to +remember. You can also use C-left and C-right to move by words, and +C-up and C-down to move by blocks (e.g. paragraphs, if you're +editing text). If you have keys labelled HOME (or BEGIN) and END, +they will take you to the beginning and end of a line, respectively, +and C-home and C-end will move to the beginning and end of the file. +If your keyboard has PgUp and PgDn keys, you can use them to move up +and down a screenful at a time, like M-v and C-v. + +All of these commands can take numeric arguments, as described above. +You can use a shortcut to enter these arguments: just hold down the +CONTROL or META key and type the number. For example, to move 12 +words to the right, type C-1 C-2 C-right. Note that it is very easy +to type this because you do not have to release the CONTROL key +between keystrokes. * WHEN EMACS IS HUNG @@ -254,17 +280,24 @@ 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 n p' (which is a disabled command), then type n to answer the question. * WINDOWS --------- -Emacs can have several windows, each displaying its own text. We will -explain later on how to use multiple windows. Right now we want to -explain how to get rid of extra windows and go back to basic -one-window editing. It is simple: +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 "frames" in Emacs terminology. This is described +later.) + +At this stage it is better not to go into the techniques of +using multiple windows. But you do need to know how to get +rid of extra windows that may appear to display help or +output from certain commands. It is simple: C-x 1 One window (i.e., kill all other windows). @@ -273,6 +306,13 @@ other windows. >> Move the cursor to this line and type C-u 0 C-l. + +(Remember that C-l redraws the screen. If you give a +numeric argument to this command, it means "redraw the +screen and put the current line that many lines from the +top of the screen." So C-u 0 C-l means "redraw the +screen, putting the current line at the top.") + >> Type Control-h k Control-f. See how this window shrinks, while a new one appears to display documentation on the Control-f command. @@ -570,6 +610,67 @@ It should ask you whether to save the buffer named TUTORIAL. Answer yes to the question by typing "y". +* 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 +the most common Emacs commands, such as "find file". You will +find this easier at first, because you don't need to remember +the keystrokes necessary to access any particular command. Once +you are comfortable with Emacs, it will be easy to begin using +the keyboard commands because each menu item with a +corresponding keyboard command has the command listed next to +it. + +Note that there are many items in the menubar that have no exact +keyboard equivalents. For example, the Buffers menu lists all +of the available buffers in most-recently used order. You can +switch to any buffer by simply findings its name in the Buffers +menu and selecting it. + + +* 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 +the desired location, and you can select text by dragging the +left mouse button across the text you want to select. (Or +alternatively, click the left mouse button at one end of the +text, then move to the other end and use Shift-click to select +the text.) + +To kill some selected text, you can use C-w or choose the Cut +item from the Edit menu. Note that these are *not* equivalent: +C-w only saves the text internally within Emacs (similar to C-k +as described above), whereas Cut does this and also puts the +text into the X clipboard, where it can be accessed by other +applications. + +To retrieve text from the X clipboard, use the Paste item from +the Edit menu. + +The middle mouse button is commonly used to choose items that +are visible on the screen. For example, if you enter Info (the +on-line Emacs documentation) using C-h i or the Help menu, you +can follow a highlighted link by clicking the middle mouse +button on it. Similarly, if you are typing a file name in +(e.g. when prompted by "Find File") and you hit TAB to show the +possible completions, you can click the middle mouse button on +one of the completions to select it. + +The right mouse button brings up a popup menu. The contents of +this menu vary depending on what mode you're in, and usually +contain a few commonly used commands, so they're easier to +access. + +>> Press the right mouse button now. + +You will have to hold the button down in order to keep the +menu up. + + * EXTENDING THE COMMAND SET --------------------------- @@ -667,7 +768,7 @@ The line immediately above the echo area it is called the "mode line". The mode line says something like this: ---**-Emacs: TUTORIAL (Fundamental)--L670--58%---------------- +--**-XEmacs: TUTORIAL (Fundamental)--L670--58%---------------- This line gives useful information about the status of Emacs and the text you are editing. @@ -759,6 +860,7 @@ >> Move the cursor into the previous paragraph and type M-q. + * SEARCHING ----------- @@ -981,7 +1083,8 @@ ------------ Remember, to exit Emacs permanently use C-x C-c. To exit to a shell -temporarily, so that you can come back to Emacs afterward, use C-z. +temporarily, so that you can come back in, use C-z. (under X, this +iconifies the current Emacs frame.) This tutorial is meant to be understandable to all new users, so if you found something unclear, don't sit and blame yourself - complain! @@ -992,6 +1095,7 @@ This tutorial descends from a long line of Emacs tutorials starting with the one written by Stuart Cracraft for the original Emacs. +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: