 
   (add-to-list 'mu4e-view-actions
                '("View in browser" . mu4e-msgv-action-view-in-browser) t)
-
-  (global-set-key (kbd "C-c m") '(lambda ()
-                                   (interactive)
-                                   (mu4e)
-                                   (mu4e-update-mail-and-index nil))))
-
-(defun setup-cider ()
-  (require 'cider)
+  :init
+  (defun run ()
+    (interactive)
+    (mu4e)
+    (mu4e-update-mail-and-index nil))
+  (bind-key "C-c m" 'run))
+
+(use-package c-mode
+  :defer t
+  :init
+  (defun my-c-mode-font-lock-if0 (limit)
+    (save-restriction
+      (widen)
+      (save-excursion
+        (goto-char (point-min))
+        (let ((depth 0) str start start-depth)
+          (while (re-search-forward "^\\s-*#\\s-*\\(if\\|else\\|endif\\)" limit 'move)
+            (setq str (match-string 1))
+            (if (string= str "if")
+                (progn
+                  (setq depth (1+ depth))
+                  (when (and (null start) (looking-at "\\s-+0"))
+                    (setq start (match-end 0)
+                          start-depth depth)))
+              (when (and start (= depth start-depth))
+                (c-put-font-lock-face start (match-beginning 0) 'font-lock-comment-face)
+                (setq start nil))
+              (when (string= str "endif")
+                (setq depth (1- depth)))))
+          (when (and start (> depth 0))
+            (c-put-font-lock-face start (point) 'font-lock-comment-face)))))
+    nil)
+  (defun my-c-mode-common-hook ()
+    (progn
+      (font-lock-add-keywords
+       nil
+       '((my-c-mode-font-lock-if0 (0 font-lock-comment-face prepend))) 'add-to-end)
+      (setq fill-column 100)
+      ;; (setq c-hungry-delete-key t)
+      ))
+  (add-hook 'c-mode-common-hook 'my-c-mode-common-hook))
+
+(use-package nyan-mode
+  :if (not (kelly?))
+  :init
+  (nyan-mode 1)
+  (setq nyan-bar-length 16
+        naya-wavy-trail t))
+
+(use-package cider
+  :if (not (kelly?))
+  :pin melpa-stable
+  :defer t
+  :config
   (add-hook 'cider-mode-hook 'cider-turn-on-eldoc-mode)
   ;; (setq cider-auto-mode nil)
   ;; (setq nrepl-log-messages nil)

  (setq cider-repl-use-pretty-printing t)
  (setq cider-prompt-save-file-on-load nil))

(when (not (kelly?))
  (require 'nyan-mode)
  (nyan-mode 1)
  (setq nyan-bar-length 16
        naya-wavy-trail t)
  (setq compile-command "scons")
  (setup-mu4e)
  (setup-cider)
  (require 'racket-mode)
  (add-hook 'racket-mode-hook          ;; same as C-c C-k
            (lambda ()
              (define-key racket-mode-map (kbd "C-c r") 'racket-run))))

(defalias 'g 'grep)
(defalias 'pg 'projectile-grep)

(define-key function-key-map "\e[$" (kbd "C-$"))
(define-key function-key-map "\e[%" (kbd "C-%"))

(define-key function-key-map "\e[=" (kbd "C-="))
(define-key function-key-map "\e[." (kbd "C-."))

(define-key global-map (kbd "RET") 'newline-and-indent)
;; (define-key c-mode-map (kbd "TAB") 'company-indent-or-complete-common)
;; (define-key c++-mode-map (kbd "TAB") 'company-indent-or-complete-common)
(global-set-key (kbd "M-r") 'recompile)
(global-set-key (kbd "M-o") 'other-window)

(setq font-lock-maximum-decoration '((racket-mode . t) (t . 1)))

;; (add-hook 'c++-mode-hook 'irony-mode)
;; (add-hook 'c-mode-hook 'irony-mode)
;; (add-hook 'objc-mode-hook 'irony-mode)

;; (defun my-irony-mode-hook ()
;;   (define-key irony-mode-map [remap completion-at-point]
;;     'irony-completion-at-point-async)
;;   (define-key irony-mode-map [remap complete-symbol]
;;     'irony-completion-at-point-async))
;; (add-hook 'irony-mode-hook 'my-irony-mode-hook)
;; (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)

;; (require 'company)
;; (require 'company-irony)
;; (setq company-backends (delete 'company-semantic company-backends)
;;       company-global-modes '(not term-mode)
;;       company-transformers '(company-sort-by-occurrence)
;;       company-minimum-prefix-length 2
;;       company-selection-wrap-around t
;;       company-show-numbers t
;;       company-require-match nil
;;       company-dabbrev-downcase nil)
;; (add-to-list 'company-backends 'company-irony)
;; ;; (setq company-idle-delay 0.1)
;; (add-hook 'prog-mode-hook (lambda () (company-mode 1)))

