 
 ;;; Post initialization
 
-(when (display-graphic-p)
+(unless noninteractive
   (let ((elapsed (float-time (time-subtract (current-time)
                                             emacs-start-time))))
     (message "Loading %s...done (%.3fs)" load-file-name elapsed))

         ("\\.markdown\\'"    . markdown-mode)))

(use-package markdown-preview-mode
  :ensure t)

(use-package paren
  :ensure t
  :defer 5
  :config
  (show-paren-mode))

(use-package shell
  :ensure t
  :config
  (defun my-shell-mode-hook ()
    (setq tab-width 8)
    (dirtrack-mode))
  (add-hook 'shell-mode-hook 'my-shell-mode-hook))

  (use-package paredit
    :ensure t
    :diminish (paredit-mode))
  (use-package rainbow-delimiters
    :ensure t
    :diminish (rainbow-delimiters-mode))
  (use-package elisp-slime-nav
    :ensure t
    :diminish (elisp-slime-nav-mode))

(use-package emacs-lisp-mode
  :defer t
  :preface
  (defun my-emacs-lisp-mode-hook ()
    (paredit-mode)
    (rainbow-delimiters-mode)
    (elisp-slime-nav-mode))
  (add-hook 'emacs-lisp-mode-hook 'my-emacs-lisp-mode-hook))

(use-package haml-mode
  :ensure t
  :mode "\\.haml\\'"
  :config
  (use-package flyspell)
  (add-hook 'haml-mode-hook 'flyspell-mode))

(use-package nix-mode
  :ensure t

(unless noninteractive
  (message "Loading %s..." load-file-name))

(setq locale-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(prefer-coding-system 'utf-8)

(when (not (window-system))
  (send-string-to-terminal "\033]12;black\007"))

(eval-when-compile
  (require 'package)
  (package-initialize)
  (defvar use-package-verbose t)
  (require 'use-package))

