 ;; Sort lines (ie. package imports or headers).
 (global-set-key (kbd "M-s l") 'sort-lines)
 
-;; Spellcheck comments and documentation
-;; From http://mwolson.org/projects/emacs-config/init.el.html
-(add-hook 'lisp-mode-hook 'flyspell-prog-mode)
-(add-hook 'emacs-lisp-mode-hook 'flyspell-prog-mode)
-(eval-after-load "cc-mode"
-  '(progn
-     ;; 100-column limit for java.
-     (add-hook 'java-mode-hook
-               (lambda ()
-                 (set-fill-column 100)))
-     ;; 2-char indent for java.
-     (add-hook 'java-mode-hook (lambda ()
-                                 (setq c-basic-offset 2)))
-     (add-hook 'java-mode-hook 'flyspell-prog-mode)
-     (add-hook 'c-mode-hook 'flyspell-prog-mode)))
 (setq css-indent-offset 2)
 
 ;; Thank you Xah Lee.


;; Rename file and buffer.
;; From: https://sites.google.com/site/steveyegge2/my-dot-emacs-file
(defun rename-file-and-buffer (new-name)
  "Renames both current buffer and file it's visiting to NEW-NAME." (interactive "sNew name: ")
  (let ((name (buffer-name))
        (filename (buffer-file-name)))

(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)
