When you enter Emacs, you see a large workspace near the top of the window where you do your editing. (See Figure 1-1.) Figure 1-1. Understanding the Emacs displayA cursor marks your position. The cursor is also called point, particularly among people who are more familiar with Emacs and in the online help system; therefore, it's useful to remember this term. You don't have to do anything special before you start typing. As long as you type alphanumeric characters and punctuation, Emacs inserts them into your buffer. The cursor indicates where Emacs inserts the new characters; it moves as you type. Unlike many editors (particularly vi), Emacs does not have separate modes for inserting text and giving commands. Try typing something right now, and you'll begin to see how easy Emacs is to use. (If you get stuck for any reason, just press C-g.) 1.5.1 The ToolbarThe toolbar is a new feature in Emacs 21. Its basic icons and their functions are listed in Table 1-3. Note that the toolbar is context sensitive; in some modes, such as the Info mode for reading the Emacs manual, the toolbar changes to provide browsing help. We'll discuss those icons when we cover the relevant modes.
If you don't like the toolbar, you can hide it using a menu option (Options Show/Hide Toolbar), and choosing Options Save Options. For more information, see Section 2.7 at the end of Chapter 2. 1.5.2 The MenusThe menu bar menu lists the options File, Edit, Options, Buffers, Tools, and Help; you can explore them to see what options are available. In addition to navigating the menus using the mouse, Emacs now offers pop-up menus. In the Emacs window, hold down Ctrl and click the right mouse button to pop up the Edit menu.[2]
You can access menus without a mouse using the keyboard. In this case, using keyboard commands is much more efficient than menus, but for completeness, we'll show you how to use the text-based menus. (If you prefer to use the mouse with Emacs but have access only to a text interface, see Chapter 13 to learn how to download and install a version of Emacs that runs graphically on Unix, Linux, Mac OS X, or Windows.) If your mouse does not work with the menus, press F10 or M-` (a back quote, the single open quotation mark, located above the Tab key in the upper-left corner of many keyboards) to access them.
You can select text-based menu options in three ways:
After you select a menu option, choices for that menu appear. Repeat the process until you find the option you're looking for. 1.5.3 The Mode LineJust above the bottom of the window (on the second-to-last line), Emacs prints a lot of information about what it's doing. This line is called the mode line. At the beginning of the mode line, you may see some information about the coding system that Emacs is using for the file; usually you'll see just --:, indicating that there is no unusual encoding scheme in place. Near the left edge of the mode line, you may see two asterisks (**). These asterisks indicate that you've modified whatever you're editing. If you haven't made any changes, the asterisks won't be there. Next, Emacs prints the name of the buffer you are editing (*scratch*). Following this, Emacs shows where you are in the buffer your position relative to the rest of the file and what line you are on (L5 for line 5 in Figure 1-1). If you're at the beginning of the file, Emacs prints the word Top; if you're at the end, it prints Bot; if you're in the middle, it shows you a percentage (for example, 50% means you're looking at the midpoint); and if the entire file is visible, Emacs prints the word All. In parentheses following this is the editing mode or modes you are in, in this case Lisp Interaction is the major mode (no minor modes are active). The scrollbar on the side of the window also indicates your position in the file.[3]
You will often work with several buffers simultaneously. In this case, each buffer has its own mode line, and when you switch buffers, the mode line reflects the state of the current buffer. Don't worry about this for now; just remember that every buffer has a mode line to describe it. 1.5.4 The MinibufferBelow the mode line is the minibuffer. This is the area where Emacs echoes the commands you enter and where you specify filenames for Emacs to find, values for search and replace, and so on. It is also where Emacs displays error messages. If you find yourself stuck in the minibuffer, press C-g to get out again. |