change-major-mode-hook

change-major-mode-hook is a variable defined in `C source code'.
Its value is
(mode-local-on-major-mode-change)

  • This variable may be risky if used as a file-local variable.

Documentation:
Normal hook run before changing the major mode of a buffer.
The function `kill-all-local-variables' runs this before doing anything else.