Next 19.F: Windows Up 19: emacs  Prev 19.D: Buffers  Contents

Specialized

§ 19.E: Understanding Mode Lines


If you look at the bottom of the page, you will notice that emacs prints the commands you enter at the bottom of the screen. This area is called the "command minibuffer". Just above the command minibuffer is the "mode line". The Mode Line looks something like this:

 --**-Emacs:
sample.doc       (Fundamental)--58%-------------------- 

The stars near the front mean that you have modified this file. If it is unmodified, there would be five dashes. If the file is read only (unmodifiable) the asterisks are replaced by percent symbols (---%%-).

After the word emacs is the filename, sample.doc, of the file currently in the active buffer. Following the filename is the mode type. At the end of the line is a percentage which represents how far you are from the top of the file.

A mode in emacs is a specialized version of the regular editor, but for a specific language. Setting different modes in emacs allows you to format the commands for that particular language. In addition, if the language can be compiled (like Fortran or C) and you set the Mode to that particular language, you can execute that language within emacs. Fundamental is the default mode setting for general editing. Examples of other common modes are text-mode, LaTeX-mode, c-mode, c++-mode, fortran-mode and emacs-lisp-mode. An important major mode for you right now is text-mode. Try changing emacs to text-mode, using the command M-x text-mode.

The examples above are called major modes because there are also minor modes. While major modes are exclusive groups of formatting and commands, minor modes modes contain less sweeping changes and can be used in combination with major modes or with each other. One of the most useful minor modes is auto-fill-mode. This mode automatically adds a carriage return when you near the right margin while editing. Try changing to auto-fill. Use the M-x auto-fill-mode. Type a few lines without the carriage return. To turn off a minor modes, repeat the command for the mode. (When a command can be used to turn an on state off or an off state on this is referred to as toggling. Toggling is used frequently throughout Unix.)

For more information on specific modes, look at " Coping With Unix" or the Emacs help. (How to get help in Emacs will be discussed in a later section.)


Next 19.F: Windows Up 19: emacs  Prev 19.D: Buffers  Contents

Comments and questions to Dr. Elias N. Houstis at enh@cs.purdue.edu.