Sams Teach Yourself Emacs in 24 Hours

ContentsIndex

Hour 3: Getting Started with Emacs

Previous HourNext Hour

Sections in this Hour:

 

Hour 3
Getting Started with Emacs

Before you can learn everything worth knowing about Emacs, it is necessary to learn a few concepts about Emacs. This is necessary for two reasons:

Caution - Do not skip this hour (not even if you are a little familiar with Emacs), because it contains much information required by the other hours. If you skip it, you'll find the other hours difficult or even impossible. Keep up--after all, this is a very short hour.


First you will start by looking at what you see when you start Emacs and what you find in the menus. Later, I'll introduce you to the vocabulary used when talking about Emacs.

Layout of the Screen

When you start Emacs, you see a window, which looks like either Figure 3.1 or Figure 3.2, depending on whether you are using GNU Emacs or XEmacs.

Caution - If you are using Emacs version 19, this window might be a bit different from the one you would see in version 20.


Windows Notes - GNU Emacs on Windows looks very much like the UNIX screen illustration in Figure 3.1.


Figure 3.1
The GNU Emacs start-up window.

The menu bar, located at the top of the window, is where many of the functions in Emacs are located. This is a perfect location to start when you want to investigate Emacs on your own. Many functions available from the menu bar are also available on the keyboard. In these cases the keybinding is shown in the menu bar. This should make it easier for you to get used to using the keyboard whenever possible.

Figure 3.2
The XEmacs startup window.

Below the XEmacs menu bar is a toolbar.

Next is the actual location where you edit your files and, believe me, I'll talk about this a lot more. Beside it is a scrollbar, with which you can scroll through the text. In XEmacs and in GNU Emacs in Windows, this scrollbar looks like one you might know from any application. In GNU Emacs in UNIX, however, the scrollbar is a bit different. If you press on it with the first mouse button (most often the left one on your mouse), the text scrolls one window down. Pressing on it with the third mouse button (likely to be the right one on your mouse) scrolls the window one page up. Finally, pressing the second mouse button (likely to be the middle one) scrolls the file to this location. That is, if you press 25% from the top of the scrollbar, Emacs scrolls 25% down in the text. This is, in fact, how the scrollbar works in XTerm too.

Tip - If your mouse has only two buttons and you are using Linux, there is still hope! Your X setup can be configured so that pressing both mouse buttons at the same time makes Emacs think that the (missing) middle mouse button was pressed.


The second-to-last line (the one in inverse video) is called the mode-line. This line is a status line, which contain different kinds of information about the status of Emacs. Different kinds of information are located in this line, but it always contains at least the following:

The last line of the screen is the minibuffer. This is the area where Emacs asks questions such as Buffer modified; kill anyway? (Yes or no). likewise, Emacs might show information to you in this area. The minibuffer is discussed later in this hour.

Sams Teach Yourself Emacs in 24 Hours

ContentsIndex

Hour 3: Getting Started with Emacs

Previous HourNext Hour

Sections in this Hour: