+;; Interval and timeout
+(setq auto-save-interval 5
+      auto-save-timeout 5)
+
+
 ;; Create a backup files
 (setq backup-by-copying t
       kept-new-versions 6
       kept-old-versions 2
       delete-old-versions t
       version-control t)
+
 
 ;; Save all tempfiles in $TMPDIR/emacs$UID/
 (defconst emacs-tmp-dir "~/.emacs.d/local/tmp/")

      `((".*" ,emacs-tmp-dir t)))
(setq auto-save-list-file-prefix
      emacs-tmp-dir)

;; Delete files not accessed in a week
(message "Deleting old backup files...")

(add-hook
  'focus-out-hook
  (lambda ()
    (interactive)
    (save-some-buffers t)))


;; Save on interval
(add-hook
  'auto-save-hook
  (lambda ()
    (interactive)
    (save-some-buffers t)))

