Next: , Previous: , Up: Top   [Contents][Index]


18 Major Modes

Emacs has many different major modes, each of which customizes Emacs for editing text of a particular sort. The major modes are mutually exclusive; at any time, each buffer has one major mode. The mode line normally contains the name of the current major mode in parentheses. See Mode Line.

The least specialized major mode is called Fundamental mode. This mode has no mode-specific redefinitions or variable settings. Each Emacs command behaves in its most general manner, and each option is in its default state. For editing any specific type of text, such as Lisp code or English text, you should switch to the appropriate major mode, such as Lisp mode or Text mode.

Selecting a major mode changes the meanings of a few keys to become more specifically adapted to the language being edited. TAB, DEL, and LFD are changed frequently. In addition, commands which handle comments use the mode to determine how to delimit comments. Many major modes redefine the syntactical properties of characters appearing in the buffer. See Syntax.

The major modes fall into three major groups. Programming modes (see Programs) are for specific programming languages. Text modes (like Nroff mode, TeX mode, Outline mode, XML mode, etc.) are for editing human readable text. The remaining major modes are not intended for direct use in editing user files; they are used in buffers created by Emacs for specific purposes. Examples of such modes include Dired mode which is used for buffers made by Dired (see Dired), Mail mode for buffers made by C-x m (see Sending Mail), and Shell mode for buffers used for communicating with an inferior shell process (see Interactive Shell).

Most programming language major modes specify that only blank lines separate paragraphs. This is so that the paragraph commands remain useful. See Paragraphs. They also cause Auto Fill mode to use the definition of TAB to indent the new lines it creates. This is because most lines in a program are usually indented. See Indentation.


Next: , Previous: , Up: Top   [Contents][Index]