Variable: change-major-mode-hook

change-major-mode-hook is a variable defined in buffer.c.

Value

(c-leave-cc-mode-mode
 mode-local-on-major-mode-change)

Documentation

Normal hook run before changing the major mode of a buffer.

The function kill-all-local-variables runs this before doing anything else.

View in manual

Probably introduced at or before Emacs version 19.23.

Source Code

// Defined in /usr/src/emacs/src/buffer.c
  DEFVAR_LISP ("change-major-mode-hook", Vchange_major_mode_hook,
	       doc: /* Normal hook run before changing the major mode of a buffer.
The function `kill-all-local-variables' runs this before doing anything else.  */);