 
   ;; Automatically hide successful builds window.
   ;; Trying out without for a little while.
-  (setq compilation-finish-functions #'ar/compile-autoclose))
+  (setq compilation-finish-functions (list #'ar/compile-autoclose #'ar/compile-cache-env)))

      (prin1 hashtable (current-buffer))
      (write-file (ar/compile--history-path) nil)))

  (defun ar/compile--history-add (project-root command directory)
    (let* ((history (ar/compile--history-read))
           (project-history (or (map-elt history project-root)
                                (make-hash-table :test 'equal))))
      (map-put project-history command directory)
      (map-put history project-root project-history)
      (ar/compile--history-write history)))

  (defun ar/compile--history-get-directory (project-root command)
    (let* ((history (ar/compile--history-read))
           (project-history (map-elt history project-root)))
      (map-elt project-history command)))

  ;; Consider:
  ;;  1. Only writing path to cache if successful.
  ;;  2. Flatten cache command -> (project-root . default-directory)
  ;; (defun ar/compile ()
  ;;   (interactive)
  ;;   (let* ((command (compilation-read-command compile-command))
  ;;          (project-root (projectile-project-root))
  ;;          (default-directory (or (ar/compile--history-get-directory project-root
  ;;                                                                    command)
  ;;                                 default-directory)))
  ;;     (compile command)
  ;;     (ar/compile--history-add project-root command default-directory)))

  ;; http://ivanmalison.github.io/dotfiles/#colorizecompliationbuffers
  (defun ar/colorize-compilation-buffer ()

         prog-mode-map
         ("C-c C-c" . ar/compile))
  :config

  (defun ar/compile (pfx)
    """Run the same compile as the last time.

