(define-derived-mode text-mode nil "Text"
"Major mode for editing text written for humans to read.
In this mode, paragraphs are delimited only by blank or white lines.
You can thus get the full benefit of adaptive filling
(see the variable `adaptive-fill-mode').
\\{text-mode-map}
Turning on Text mode runs the normal hook `text-mode-hook'."
(set (make-local-variable 'text-mode-variant) t)
(set (make-local-variable 'require-final-newline)
mode-require-final-newline)
(set (make-local-variable 'indent-line-function) 'indent-relative))

(The last line is redundant nowadays, since indent-relative is
the default value, and we'll delete it in a future version.)

The three Lisp modes (Lisp mode, Emacs Lisp mode, and Lisp Interaction
mode) have more features than Text mode and the code is correspondingly
more complicated. Here are excerpts from lisp-mode.el that
illustrate how these modes are written.

Amongst other things, this function sets up the comment-start
variable to handle Lisp comments:

(make-local-variable 'comment-start)
(setq comment-start ";")
...

Each of the different Lisp modes has a slightly different keymap. For
example, Lisp mode binds C-c C-z to run-lisp, but the other
Lisp modes do not. However, all Lisp modes have some commands in
common. The following code sets up the common commands: