Prepare for major-mode.