                              (set 'sh-indentation 2)))
 
 
-;; Ace jump mode 
+;; Ace jump mode
 ;; ============================================================
 
 (require 'ace-jump-mode)

;; ;; auto-save in-place
;; (setq auto-save-visited-file-name t)

;; Had to remove this because oomph-lib doesn't stick to no trailing whitespace...,
;; Remove trailing whitespace before save
;;(add-hook 'before-save-hook 'delete-trailing-whitespace)
(remove-hook 'before-save-hook 'delete-trailing-whitespace)
;; oomph-lib safe version is in oomph-lib.el

;; Add a new line at end of file on save if none exists (note: doesn't play
;; nice with scheme).
(setq-default require-final-newline 0)

(define-key 'help-command (kbd "F") 'find-function)
(define-key 'help-command (kbd "K") 'find-function-on-key)
(define-key 'help-command (kbd "V") 'find-variable)


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

;; has to go near the end because we need some project/language specific
;; functions.

(defun preserve-trailing-whitespace-p ()
  (interactive)
  (or
   ;; makefile mode doesn't play well with this
   (string= major-mode "makefile-mode")

   ;; oomph-lib doesn't stick to no trailing whitespace :(
   (is-oomph-code)

   ;; Don't do it in non-programming modes (just to be safe)
   (not (derived-mode-p 'prog-mode))))


(defun maybe-delete-trailing-whitespace ()
  (when (not (preserve-trailing-whitespace-p))
    (delete-trailing-whitespace)))

(add-hook 'before-save-hook 'maybe-delete-trailing-whitespace)


;; Automagically added by customise
