Section 8.1. Conceptual Overview


8.1. Conceptual Overview

This section describes some Emacs terminology that may be unfamiliar if you haven't used Emacs before.

8.1.1. Modes

One of the features that makes Emacs popular is its editing modes. The modes set up an environment designed for the type of editing you are doing, with features such as having appropriate key bindings available and automatically indenting according to standard conventions for that type of document. There are two types of modes: major and minor. The major modes include modes for various programming languages such as C or Perl, for text processing (e.g., SGML or even straight text), and many more. One particularly useful major mode is Dired (Directory Editor), which has commands that let you manage directories. Minor modes set or unset features that are independent of the major mode, such as auto-fill (which controls word wrapping), insert versus overwrite, and auto-save. For a full discussion of modes, see Learning GNU Emacs (O'Reilly) or the Emacs Info documentation system (C-h i).

8.1.2. Buffer and Window

When you open a file in Emacs, the file is put into a buffer so you can edit it. If you open another file, that file goes into another buffer. The view of the buffer contents that you have at any point in time is called a window. For a small file, the window might show the entire file; for a large file, it shows only a portion of a file. Emacs allows multiple windows to be open at the same time, to display the contents of different buffers or different portions of a single buffer.

8.1.3. Point and Mark

When you are editing in Emacs, the position of the cursor is known as point. You can set a mark at another place in the text to operate on the region between point and mark. This is a very useful feature for such operations as deleting or moving an area of text.

8.1.4. Kill and Yank

Emacs uses the terms kill and yank for the concepts more commonly known today as cut and paste. You cut text in Emacs by killing it, and paste it by yanking it back. If you do multiple kills in a row, you can yank them back all at once.

8.1.5. Notes on the Tables

Emacs commands use the Ctrl key and the Meta key (Meta is usually the Alt key or the Escape key). In this chapter, the notation C- indicates that the Ctrl key is pressed at the same time as the character that follows. Similarly, M- indicates the use of the Meta key. When using Escape for Meta, press and release the Escape key, then type the next key. If you use Alt (or Option on the Mac) for Meta, it is just like Ctrl or Shift, and you should press it simultaneously with the other key(s).

In the command tables that follow, the first column lists the keystroke and the last column describes it. When there is a middle column, it lists the command name. If there are no keystrokes for a given command, you'll see (none) in the first column. Access these commands by typing M-x followed by the command name. If you're unsure of the name, you can type a tab or a carriage return, and Emacs lists possible completions of what you've typed so far.

Because Emacs is such a comprehensive editor, containing literally thousands of commands, some commands must be omitted for the sake of preserving a "quick" reference. You can browse the command set by typing C-h (for help) or M-x Tab (for command names).

8.1.6. Absolutely Essential Commands

If you're just getting started with Emacs, here's a short list of the most important commands:

Keystrokes

Description

C-h

Enter the online help system.

  

C-x C-s

Save the file.

  

C-x C-c

Exit Emacs.

  

C-_

Undo last edit (can be repeated).

  

C-g

Get out of current command operation.

  

C-p

Up/down/forward/back by line or character.

C-n

 

C-f

 

C-b

 
  

C-v

Forward/backward by one screen.

M-v

 

C-s

Search forward/backward for characters.

C-r

 
  

C-d

Delete next/previous character.

Del

 




Linux in a Nutshell
Linux in a Nutshell
ISBN: 0596154488
EAN: 2147483647
Year: 2004
Pages: 147

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net