   (let ((m prog-mode-map))
     (define-key m [f6] 'recompile))
   ;; Show trailing whitespace.
-  (set (make-local-variable 'show-trailing-whitespace)
-       t))
-
+  (set (make-local-variable 'show-trailing-whitespace) t)
+  ;; Spellcheck comments and documentation
+  ;; From http://mwolson.org/projects/emacs-config/init.el.html
+  (flyspell-prog-mode)
+  (whitespace-mode)
+  (rainbow-delimiters-mode))
 (add-hook 'prog-mode-hook 'ar/prog-mode-hook)
 
 (use-package centered-cursor-mode


;; No need to confirm killing buffers.
(global-set-key [(control x) (k)] 'kill-this-buffer)

;; Keep same window for pop-ups (ie. help-mode).
;; From http://www.emacswiki.org/emacs/OneWindow
(setq pop-up-windows nil)

(setq ediff-split-window-function 'split-window-horizontally)
;; ediff-revision cleanup.
;; From http://www.emacswiki.org/emacs/DavidBoon#toc8
(defvar ar/ediff-bwin-config nil "Window configuration before ediff.")
(defcustom ar/ediff-bwin-reg ?b
  "*Register to be set up to hold `ar/ediff-bwin-config'
    configuration.")

(defun ar/ediff-bsh ()
  "Function to be called before any buffers or window setup for
    ediff."
  (remove-hook 'ediff-quit-hook 'ediff-cleanup-mess)
  (window-configuration-to-register ar/ediff-bwin-reg))

(defun ar/ediff-aswh ()
  "setup hook used to remove the `ediff-cleanup-mess' function.  It causes errors."
  (remove-hook 'ediff-quit-hook 'ediff-cleanup-mess))

(defun ar/ediff-qh ()
  "Function to be called when ediff quits."
  (remove-hook 'ediff-quit-hook 'ediff-cleanup-mess)
  (ediff-cleanup-mess)
  (jump-to-register ar/ediff-bwin-reg))

(add-hook 'ediff-before-setup-hook 'ar/ediff-bsh)
(add-hook 'ediff-after-setup-windows-hook 'ar/ediff-aswh);
(add-hook 'ediff-quit-hook 'ar/ediff-qh)

;; Highlight lines longer than 100 columns.
(require 'whitespace)
