Home Online Manual
Back: Emacs user interface
Forward: Running SINGULAR under Emacs
FastBack: Interactive use
FastForward: Rings and orderings
Up: Emacs user interface
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

3.2.1 A quick guide to Emacs

This section gives a tutorial-like introduction to Emacs. Especially to users who are not familiar with Emacs, we recommend that they go through this section and try out the described features.

Emacs commands generally involve the CONTROL key (sometimes labeled CTRL or CTL) or the META key. On some keyboards, the META key is labeled ALT or EDIT or something else (for example, on Sun keyboards, the diamond key to the left of the space-bar is META). If there is no META key, the ESC key can be used, instead. Rather than writing out META or CONTROL each time we want to prefix a character, we will 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 key down while typing <chr>. If there is no META key, type ESC, release it, then type the character <chr>.

For users new to Emacs, we highly recommend that they go through the interactive Emacs tutorial: type C-h t to start it.

For others, it is important to understand the following Emacs concepts:

In Emacs terminology, a window refers to separate panes within the same window of the window system, and not to overlapping, separate windows. When using SINGULAR within Emacs, extra windows may appear which display help or output from certain commands. The most important window commands are:
C-x 1 File->Un-Split Un-Split window (i.e., kill other windows)
C-x o Goto other window, i.e. move cursor into other window.

cursor and point
The location of the cursor in the text is also called "point". To paraphrase, the cursor shows on the screen where point is located in the text. Here is a summary of simple cursor-moving operations:
C-f Move forward a character
C-b Move backward a character
M-f Move forward a word
M-b Move backward a word
C-a Move to the beginning of line
C-e Move to the end of line

Any text you see in an Emacs window is always part of some buffer. For example, each file you are editing with Emacs is stored inside a buffer, but also SINGULAR is running inside an Emacs buffer. Each buffer has a name: for example, the buffer of a file you edit usually has the same name as the file, SINGULAR is running in a buffer which has the name *singular* (or, *singular<2>*, *singular<3>*, etc., if you have multiple SINGULAR sessions within the same Emacs).

When you are asked for input to an Emacs command, the cursor moves to the bottom line of Emacs, i.e., to a special buffer, called the "minibuffer". Typing RETURN within the minibuffer, ends the input, typing SPACE within the minibuffer, lists all possible input values to the interactive Emacs command.

The most important buffer commands are

C-x b Switch buffer
C-x k Kill current buffer
Alternatively, you can switch to or kill buffers using the Buffer menu.

Executing commands
Emacs commands are executed by typing M-x <command-name> (remember that SPACE completes partial command names). Important and frequently used commands have short-cuts for their execution: Key bindings or even menu entries. For example, a file can be loaded with M-x load-file, or C-x C-f, or with the File->Open menu.

How to exit
To end the Emacs (and, SINGULAR) session, type C-x C-c (two characters), or use the File -> Exit menu.

When Emacs hangs
If Emacs stops responding to your commands, you can stop it safely by typing C-g, or, if this fails, by typing C-].

More help
Nearly all aspects of Emacs are very well documented: type C-h and then a character saying what kind of help you want. For example, typing C-h i enters the Info documentation browser.

Using the mouse
Emacs is fully integrated with the mouse. In particular, clicking the right mouse button brings up a pop-up menu which usually contains a few commonly used commands.