Next: , Previous: , Up: Major Modes   [Contents][Index]


33.1.1 Major Mode Conventions

The code for existing major modes follows various coding conventions, including conventions for local keymap and syntax table initialization, global names, and hooks. Please follow these conventions when you define a new major mode:

Variable: change-major-mode-hook

This normal hook is run by kill-all-local-variables before it does anything else. This gives major modes a way to arrange for something special to be done if the user switches to a different major mode. For best results, make this variable buffer-local, so that it will disappear after doing its job and will not interfere with the subsequent major mode. See Hooks.


Next: , Previous: , Up: Major Modes   [Contents][Index]