EMACS is the editor for GNU. It is described as "Everything, but the kitchen sink" or "EMACS does everything but butter your toast in the morning". And that's not even true, because someone hooked up EMACS to a home-made toast-buttering machine.

EMACS is a powerful, extendable, text-editor. Although it can hardly be called a text-editor any more. It has modes for editing C-code, HTML, roff, LISP, and it can even be your personal psychotherapist. But we'll focus on the text-editing feature here.

You start EMACS by typing "emacs <file>". You will now see a screen like this:

Buffers Files Tools Edit Search Mule Help







--11:---F1  myfile         (Fundamental)--L1--All----

Don't ask me what the "--11:---F1" means, I don't know that. I'm more of a vi person myself. The "myfile" is the name of the file you are editing. The "(Fundamental)" means the mode you are in. This can be one of about a billion modes, like "(LISP)" or "(C)". This is just the basic, old fashioned, no bells, butter-the-toast-yourself, text editing mode.

EMACS uses its own system to indicate which keys to press.

M-x - Meta-x. Meta is usually the left ALT key on your keyboard. Hold this while pressing x. Where x is actually x, or another letter.
C-x - Control-x. Control is usually the CTRL key on your keyboard. Hold this while pressing x. Where x is actually x, or another letter.
M-x doctor - Hold ALT, press x, release ALT, type in doctor, hit RETURN.
C-x C-c - Hold CTRL, press x, press c, release CTRL.

Moving around in your file (EMACS calls it a "buffer") is done with the follow keys:

C-b - One character back.
C-f - One character forward.
C-p - One line up (previous line)
C-n - One line down (next line)
C-e - Proceed to end of line.
C-a - Return to start of line.

To write a file use: "C-x C-s". To exit EMACS, use: "C-x C-c".

As I said before, these are really just the basics. See EMACS' built-in manual for much better, and more complete, documentation by typing: "M-x help" and choosing 't'.


Back to Linux For Monkeys, or back to Editing text on UNIX.