define-compilation-mode

define-compilation-mode is a Lisp macro in `compile.el'.

(define-compilation-mode MODE NAME DOC &rest BODY)

This is like `define-derived-mode' without the PARENT argument.
The parent is always `compilation-mode' and the customizable `compilation-...'
variables are also set from the name of the mode you have chosen,
by replacing the first word, e.g., `compilation-scroll-output' from
`grep-scroll-output' if that variable exists.