How you start Emacs may vary by platform. Linux has no icon on the desktop by default; Windows and Mac OS X do (if you've installed Emacs on these platforms). Note that Mac OS X comes with a version of GNU Emacs installed in /usr/bin , and that is what runs by default when you start up Emacs using the Terminal application. You won't be able to use the mouse at all if you run Emacs in the Terminal application, and there are a number of other limitations as well. Better versions of GNU Emacs are available to you; see Chapter 13for details.
Emacs works best with a three-button mouse (more buttons are okay, too).
The scrollbar's location depends on the platform and windowing system you're using. Linux puts scrollbars on the left while Mac OS X and Windows put them on the right by default. Note also that the order of the information in the mode line is different if you run Emacs in a terminal window.
In certain special editing modes, such as dired-modefor viewing and manipulating directories on your computer, the normal typing keys don't insert themselves. They are instead bound to special commands that do things like opening and renaming files. This flexibility in defining and changing keymaps , while it might seem somewhat arbitrary and overwhelming at first, is one of the great sources of power in Emacs.
One exception to this rule is the *scratch*
buffer. It's a scratchpad and Emacs assumes you were doodling, not doing serious artwork, so to speak. If you do any serious work in the *scratch*
buffer, you must save it explicitly.
Remember that (none) in the first column means that you type M-xfollowed by the command name in the second column, then press Enterto run the command. There are no default keystrokes. To use the refill-modecommand, type M-x refill-mode Enter.
Most often, you'll use C-uas we've described here. However, it doesn't always work as a multiplier; sometimes C-umodifies the command's function. Later in this chapter, you'll see one such case. However, if you're doing something where a multiplier makes sense, C-uis almost certain to work.
You may be used to pressing C-vto paste in all applications if you are a Linux or Windows user. Emacs has options to change its default paste, cut, and copy commands to the familiar C-v, C-x, and C-c. See "Making Emacs Work the Way You Want" for details. Also, a quick warning to viusers who are learning Emacs: vialso uses the term yank , but its meaning is almost the exact opposite. Don't let this confuse you.
You can make this happen if you highlight the text and then press xxxMacSymxxx -C. Simply highlighting the text doesn't copy it to the clipboard.
xxxMacSymxxx-v pastes from the clipboard.
On a Mac keyboard, we found that the Helpkey, to the left of Home, toggles overwrite mode.
If you find that you repeat the undo command frequently, it's worth getting fluent with C-_. It's true that this requires holding down Ctrland Shiftat the same time, but once you've got that down, pressing _repeatedly is much easier than typing C-x uagain and again.
There is no real difference between undoand advertised-undo. They work the same way.
We should say that Emacs tries to do this. In some cases, Emacs can't, and there is really no guarantee. Power surges and OS crashes are examples of times where things happen so fast that Emacs may not be able to create an auto-save file. But we are surprised at how often it manages to do so.
You could use C-_for undo instead and then you wouldn't need to read this section. We recommend that you read it anyway because you might find another annoying key mapping that you want to change and this section tells a bit about how to do so.
Your default dictionary might be called something else entirely, like .aspell.language.pws . If you run the command ispell-check-version, you'll see that although Ispell is supposedly running, it's really Aspell behind the scenes.
Once upon a time this use of word abbreviation mode was nontraditional; these days Flyspell, described earlier, automatically defines misspellings as abbreviations.
The exception to the rule that **
means changed and %%
means read-only is the *scratch*
buffer. Because Emacs doesn't warn you if you kill the *scratch*
buffer, even if it is changed, it wants to give you some indication that there are unsaved changes. Instead of %%
, the *scratch*
buffer puts %*
on the mode line.
It's true that you can't resize Emacs windows using the mouse. But if you resize an Emacs frame, it does impact the size of the windows, even eliminating windows at times if the frame cannot display all the windows. Of course, as always, eliminating a window doesn't impact the underlying buffer.
You can have more than two windows on the screen, but only two are compared: the one the cursor is in and the next window (remember that the next window is either to the right or down if there is no window to the right).
You do have choices under Windows as well, thanks to Cygwin (http://cygwin.com/). For example, if you wanted to run Cygwin's bash, you'll find helpful information on how to set that up on Ngai Kim Hoong's page on that topic at http://www.khngai.com/emacs/cygwin.php.
The one exception to this is running Emacs in the Mac OS X Terminal application, which has its own drag-and-drop behavior. In the terminal—and thus in Emacs running in the terminal window—dragging and dropping a folder inserts the complete pathname of that folder rather than opening the folder in Dired.
What if it's a file that shouldn't be viewed in Emacs, like a JPG or a PDF? In this case, the variable dired-view-command-alistassociates viewers with file extensions. The defaults for this command work on Linux, but require some tweaking on other platforms. See Chapter 10for an example of using Custom to change this variable for Mac OS X and Windows.
Emacs understands only compressand gzipformats, not ZIP or other proprietary file compression algorithms. When you uncompress files, Emacs recognizes and correctly uncompresses files with the following suffixes: .z , .Z , or .gz . When you compress files, Emacs uses gzip, resulting in files that end in .gz .
And if all the Dired features aren't enough, there's Dired-x, an add-in module that includes other features such as omitting unimportant files from the listing, finding files mentioned in any buffer, and additional variables and means of marking files. For more details, see the Info text on this subject (type C-h ito get to the Info menu).
Читать дальше