Here are some samples from my site-start.el which may help you:
(defun activate-flyspell ()
"Turn on flyspell-mode and call flyspell-buffer."
(interactive)
;; This next line REALLY slows buffer switching.
(flyspell-mode)
(flyspell-buffer))
(defvar customised-hooks-alist
'(emacs-lisp-mode-hook
nxml-mode-hook
python-mode-hook
sh-mode-hook
text-mode-hook)
"An alist of hooks that require customisations.")
(unless noninteractive
;; Activate flyspell for various major modes.
(add-hook-list customised-hooks-alist 'activate-flyspell))