   (interactive)
   (switch-to-buffer (make-temp-name "scratch"))
   (org-mode))
-
-
-(defun clean-whitespace-and-save ()
-  (interactive)
-  (delete-trailing-whitespace)
-  (save-buffer))
 
 
 (global-set-key [home] 'smart-beginning-of-line)

(add-to-list 'compilation-error-regexp-alist-alist '(jshint "^\\(.*\\): line \\([0-9]+\\), col \\([0-9]+\\), " 1 2 3))
(add-to-list 'compilation-error-regexp-alist 'jshint)

;; always clean whitespace in javascript mode
(defun remap-save-clean-whitespace ()
  (interactive)
  (local-set-key [remap save-buffer] 'clean-whitespace-and-save))
(add-hook 'js-mode-hook 'remap-save-clean-whitespace)

;; set up tab key
(add-hook 'js-mode-hook 'set-tab)


;; Clean up whitespace
;; ============================================================

;; Automatically clean whitespace in lines that we have touched
(use-package ws-butler
  :ensure t
  :config
  (ws-butler-global-mode))

(add-to-list 'load-path "~/.emacs.d/aggressive-fill-paragraph-mode")
(load-library "aggressive-fill-paragraph")
