Getting Started with the Emacs Text Editor
The command emacs myfile will invoke emacs to edit the file myfile. If you type this in an xterm under X-Windows, it will cause emacs to appear in a new window; you might wish to put an ampersand ("&") at the end of the command line in order to run the job in the background and so still be able to use your xterm. You can also start emacs without providing the name of a file, for instance if you only wished to use its built-in documentation.
If myfile doesn't exist in the current directory, then emacs will create it for you - but note that the file will not appear in the directory listing until you explicitly save it. This is because of the way emacs handles files with buffers. Every time you ask emacs to edit a file, the text in that file is read into a storage object within emacs, called a buffer. The file is not altered on disk until you ask emacs to save the alterations you have made to the corresponding buffer.
Since you can edit multiple files within one emacs window, it is not recommended that you run more than one copy of emacs, as this can use up a lot of your computer's memory.
How to use emacs
The best way to learn more about using emacs is from the built-in documentation; to access this, start emacs and then use the commands given below.
-
Interactive beginners' tutorial - to start this from within emacs, type CTRL-h t (i.e, hold down the Control key and press h; then release both of those keys and press t).
-
List of Frequently Asked Questions - get this by typing CTRL-h F (note the capital F).
-
Browsable manual - under X-Windows, simply click the left mouse button on the word "Help" in the menu bar at the top of the screen. Choose "Browse Manuals" from the menu that appears, and you will see a screen offering you manuals for several different packages. Move the mouse pointer over the entry for "Emacs", and click the middle mouse button.
Now that you are inside the emacs manual, you can navigate around the screen with the arrow keys and the other normal emacs navigation commands (read the beginners' tutorial if you're unsure what these are). In addition, clicking with the middle mouse button on any highlighted word will let you follow the link and learn more about that topic.
You can use the browsable manual system even if you are not using X-Windows - see the Frequently Asked Questions to see how.
There is also a emacs manual available in HTML format at the GNU Manuals Online page (emacs is part of the GNU project's suite of free software).
Info on customising emacs in various ways using a .emacs file
