emacs Emacs nomenclature Modes


Example

Major mode

Emacs can adapt its behaviour to the specific type of text edited in a buffer. The set of specific Emacs customizations for a particular type of text is called a "major mode". Each buffer has exactly one major mode depending on its content type.

Major modes can change the meaning of some keys, define syntax highlighing or indentation rules, and install new key bindings (usually beginning with C-c) for mode-specific commands. Emacs ships with a wide range of major modes, falling into three main categories:

  • support for text (e.g. markup languages),
  • support for programming languages,
  • applications within emacs (e.g. dired, gnus, ...). Buffers using this last group of major modes are usually not associated to files, but rather serve as a user interface.

Minor mode

Minor modes are optional features that can be turned on and off. Minor modes can be enabled for specific buffers (buffer-local modes) or all buffers (global modes). In contrast to major modes any number of minor mode can be activated for a given buffer.

Emacs provides lots of minor modes. A few examples include:

  • Auto-fill mode to automatically wrap text lines as you type.
  • Flyspell mode to highlight spelling errors as you type.
  • Visual Line mode to wrap long lines to fit the screen.
  • Transient Mark mode to highlight the current region.