Выбрать главу

You don't need to remember the rules, but looking them over may help you out if you can't understand how Emacs is capitalizing. In our experience, defining abbreviations in lowercase circumvents most capitalization problems.

Table 3-8 summarizes word abbreviation commands.

Table 3-8. Word abbreviation commands

Keystrokes Command name Action
M-/ dabbrev-expand Complete this word based on the nearest word that starts with this string (press M-/ again if that's not the word you want).
(none) abbrev-mode Enter (or exit) word abbreviation mode.
C-x a - or C-x a i g inverse-add-global-abbrev After typing the global abbreviation, type the definition.
C-x a i l inverse-add-mode-abbrev After typing the local abbreviation, type the definition.
(none) unexpand-abbrev Undo the last word abbreviation.
(none) write-abbrev-file Write the word abbreviation file.
(none) edit-abbrevs Edit the word abbreviations.
(none) list-abbrevs View the word abbreviations.
(none) kill-all-abbrevs Kill abbreviations for this session.

3.4.3 Problems You May Encounter

• You search for a string you can see on the screen, and Emacs can't find it. The most probable explanation is that Emacs is taking into account line breaks and punctuation, and you're not including these in the search string. Use word search, which ignores any line breaks or punctuation, to find the string.

• You get a message that says, Searching for program: No such file or directory ispell. You don't have Ispell installed. Ispell is external to Emacs; see Chapter 13 for details on installing Ispell on Mac OS X and Windows.

• You can't see the pop-up menu in Flyspell. You activate this pop-up menu by pointing the mouse at a given word and pressing the middle mouse button. Essentially, you need a three-button mouse to run Flyspell.

Chapter 4. Using Buffers, Windows, and Frames

One of the most universally useful features of Emacs is the ability to edit multiple buffers at once and to display more than one buffer using windows and frames. The commands for doing this are simple; you learn only a few commands and yet experience a tremendous boost in productivity. The more you use multiple buffers, frames, and windows, the more uses you'll think of for them.

In this chapter, we discuss how to use buffers, windows, and frames. First we cover the most commonly used commands, then, in the case of buffers and windows, move on to some more esoteric commands. At the end of the chapter, we discuss bookmarks, a method for marking your place in a file.

4.1 Understanding Buffers, Windows, and Frames

Conceptually, Emacs is different from most applications in two important ways. First, its window terminology is different. Second, Emacs buffers are not tied to windows or frames, unlike most applications.

4.1.1 Windows Versus Frames

Let's get our terms straight first. GUI windows are not Emacs windows. Emacs calls GUI windows frames. In part, this terminology is necessary because Emacs predates GUIs and is still often used on terminals without GUI windows. Emacs windows are split screens. We've seen them already; for example, when you ask for keyboard help, you see it displayed in a *Help* buffer at the bottom of your screen. Figures Figure 4-1 and Figure 4-2 show Emacs frames and Emacs windows. In Figure 4-1, we see our dickens and odyssey buffers in two separate frames. Figure 4-2 shows a single frame displaying two Emacs windows, one on top of the other, showing these two files.

Figure 4-1. Editing dickens and odyssey in Emacs frames