Variable: major-mode

major-mode is a customizable and buffer-local variable defined in buffer.c.

Documentation

Symbol for current buffer's major mode.

The default value (normally fundamental-mode) affects new buffers. A value of nil means to use the current buffer's major mode, provided it is not marked as "special".

View in manual

Probably introduced at or before Emacs version 29.1.

Source Code

// Defined in /usr/src/emacs/src/buffer.c
  DEFVAR_PER_BUFFER ("major-mode", &BVAR (current_buffer, major_mode),
		     Qsymbolp,
		     doc: /* Symbol for current buffer's major mode.
The default value (normally `fundamental-mode') affects new buffers.
A value of nil means to use the current buffer's major mode, provided
it is not marked as "special".  */);