Download XEMACS New Users Guide

Transcript
Chapter 1: Entering and Exiting Emacs
5
1 Entering and Exiting Emacs
While using Emacs you should be familiar with the following three terms:
Buffer
A buffer is a region of memory holding characters. It is the basic editing unit;
one buffer corresponds to one piece of text being edited. You can have multiple
buffers but you can edit only one buffer at any one time. For more information,
See section “Buffers” in XEmacs User’s Manual.
File
A file is a region of disk space holding characters. Emacs edits a file by reading
it into a buffer, editing that buffer and writing out the buffer back to the file.
To save your work permanently you have to write it to a file. So after you load
and work with a file, you have to save it back.
Windows
A window is a rectangular region in which a buffer is displayed. You can
open multiple windows with multiple buffers and edit them by selecting the
corresponding buffer. Initially, when you start emacs, it will automatically
open up a window for you.
1.1 Entering Emacs
To enter Emacs type xemacs and press the Return key at the shell i.e. xemacs hRETi.
This will bring up an emacs window with ‘*scratch*’ as the default buffer because Emacs
must always have a buffer to work on. Then choose the Open... option from the File menu
on the menubar at the top of the frame. It will prompt you to enter a filename. After you
enter the filename, Emacs will read that file into the current buffer. You can also type :
xemacs <filename> hRETi
directly which will bring up an Emacs frame with the filename as the buffer.
1.2 Emacs Frame
When you run XEmacs under X, a menu bar on top of the Emacs frame provides access to pull-down menus of file, edit, and help-related commands. The menus only provide
convenient shortcuts, the options that they provide are available via key commands. You
can invoke those commands from the keyboard also. For many of the options, their corresponding key commands are displayed right besides them. The five default menus on the
menubar that you will see on the frame are File, Edit, Options, Buffers and Help. See
section “XEmacs Pull-down Menus” in XEmacs User’s Manual, for detailed information on
the functions provided by the pull-down menus.
The Emacs frame has a rectangle shaped box at the extreme right and you can drag it
up or down to scroll the window accordingly. Clicking on the arrows also serves the same
purpose.
The last line in your window is ‘the Mode line’ which will give you a description of
what’s going on in that particular window. See Section 1.4 [Mode Line], page 6, for more