Next: , Up: Major Modes   [Index]


10.1.1 Mode Variables and Commands

Variable: major-mode

Symbol for current buffer’s major mode. This variable is set automatically; you should not change it yourself.

The default or global value is ‘fundamental-mode’. The default value of major-mode determines the major mode to use for files that do not specify a major mode, and for new buffers created with ‘C-x b’. You can change this default value via the ‘Customization’ interface (see Easy Customization), or by adding a line like this to your init file (see Init File):

(setq-default major-mode 'text-mode)

If the default value of major-mode is ‘nil’, the major mode is taken from the previously current buffer.

To view the documentation for the current major mode, including a list of its key bindings, type ‘C-h m’ (describe-mode).

Function: describe-mode &optional buffer

Display documentation of current major mode and minor modes. A brief summary of the minor modes comes first, followed by the major mode description. This is followed by detailed descriptions of the minor modes, each on a separate page.