Online Book Reader

Home Category

Running Linux, 5th Edition - Matthias Kalle Dalheimer [365]

By Root 1491 0
second click on the right mouse button removes it. To paste it back, press the middle mouse button.[*] The text goes just before the character the mouse is currently on. Make a mistake? That's all right — the Undo command reverses it just as for any other Emacs function. (Choose Undo from the Edit menu or just press C-_.)

If you really love mouse work, you can define the buttons to execute any functions you want, just as with keys. Try putting the following command in your .emacs file:

(define-key global-map [S-mouse-1] 'mail)

When you hold down the Shift key and press the left mouse button, a buffer for composing a mail message appears.

We don't recommend you redefine the existing mouse functions, but the Shift, Control, and Alt keys offer plenty of unused possibilities. Combine S-, C-, and M- any way you want in your definitions:

(define-key global-map [S-C-mouse-1] 'mail)

Now let's play around a bit with windows. Emacs has had windows of its own for decades, of course, long before the X Window System existed. So an Emacs window is not the same as an X window. What X considers a window, Emacs calls a frame.

How would you like to edit in two frames at once? Press C-x 5 2, and another frame appears. The new frame is simply another view onto the same editing session. You can edit different buffers in the two frames, but anything you do in one frame is reflected to the corresponding buffer in the other. When you exit Emacs by pressing C-x C-c, both frames disappear; if you want to close just one frame, press C-x 5 0.

To end our exploration of Emacs on the X Window System, we'll look at a couple of the exciting things you can do with colors. You can change these during an Emacs session, which makes it easy to play around with different possibilities. Press M-x, then type set-background-color and press the Enter key. At the prompt, type ivory or whatever color you've chosen. (Remember, Emacs uses the convention M-x where we use Alt-x in the rest of the book.)

Be careful to make the foreground and background different enough so that you can see the text! In addition to set-background-color, Emacs offers set-foreground-color, set-cursor-color, and set-mouse-color.

Before finishing up this section, we would also like to mention that if Emacs or XEmacs is a bit too much for you, but vi is too raw, you will be delighted to know that KDE comes with a variety of text editors that range from quite simple to quite sophisticated. None of these is as big or powerful as (X)Emacs, but they may do the trick.

The two main KDE text editors are called KEdit and Kate; the latter stands for KDE Advanced Text Editor. Kate can be used as a full-blown programmer's editor with syntax coloring, multiple files opened at the same time, and so on. KEdit is similar in feature richness (or poverty) to the Notepad editor on Windows systems. There are also other editors, even (gasp!) a vi version with a KDE interface. You will find all of them in the K menu under the submenu Editors. And finally, if you are using GNOME, you may want to try gedit.

* * *

[*] If you do not have a middle mouse button, chances are that your mouse is configured to emulate a middle mouse button by pressing both the left and the right button simultaneously. Pressing the thumbwheel down could be another option.

Chapter 20. Text Processing

Now that most of the world uses WYSIWYG word processors, and several good ones are available even for Linux, why use the anachronistic-looking text processors described in this chapter? Actually, text processing (especially in the form of XML) is the wave of the future. People will desire WYSIWYG interfaces, but they will demand a simple, standard, text format underneath to make their documents portable while allowing an unlimited range of automated tools to manipulate the documents.

Because the tools described here are open source and widely available, you can use one of their formats without guilt and reasonably expect your readers to have access to formatters. You can also use an impressive range of tools developed

Return Main Page Previous Page Next Page

®Online Book Reader