1.1. Emacs Basics

1.1.1. A Word About Modes

Emacs achieves some of its famed versatility by having various editing modes in which it behaves slightly differently. The word mode may sound technical or complicated, but what it really means is that Emacs becomes sensitive to the task at hand.

Text mode and C mode are major modes. A buffer can be in only one major mode at a time; to exit a major mode, you have to enter another one.

1.1.1.1. Major modes

Whenever you edit a file, Emacs attempts to put you into the correct major mode. If you edit a file that ends in .c, it puts you into C mode. If you edit a file that ends in .el, it puts you in LISP mode.

Major Mode    Function
Fundamental mode    The default mode; no special behavior
Text mode    For writing text
Mail mode    For writing mail messages
RMAIL mode    For reading and organizing mail
View mode    For viewing files but not editing
Shell mode    For running a UNIX shell within Emacs
Telnet mode    For logging in to remote systems
Outline mode    For writing outlines
Indented text mode    For indenting text automatically
Nroff mode    For formatting files for nroff
TeX mode    For formatting files for TeX
LaTeX mode    For formatting files for LaTeX
C mode    For writing C programs
C++ mode    For writing C++ programs
Java mode    For writing Java programs
FORTRAN mode    For writing FORTRAN programs
Emacs LISP mode    For writing Emacs LISP functions
LISP mode    For writing LISP programs
LISP interaction ...

Get GNU Emacs Pocket Reference 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.