Major and Minor Modes

When you are writing HTML documents, you will find that you want Emacs to be configured in one way. You will want it to be configured in quite a different way when you are writing C++ programs or ordinary letters (that is, such as ones that you send to your mother on her birthday).

Examples of differences between the two configurations include the following:

  • The way text is indented. (In C++ mode, the indentation level should increase on opening braces and decrease on closing ones.)

  • The set of functions bound to the Ctrl+c key prefix.

  • The content of the menus. (C++ mode adds a menu entry called C++.)

All such configurations are saved in packages called modes. Modes exist for most programming languages, including C, C++, Java, ...

Get Practical UNIX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.