 ;;;; Macros
 (defmacro comment (&rest args) nil)
 (defmacro cmd (&rest args) `(lambda () (interactive) (progn ,@args)))
+(defmacro define-key-cmd (keymap key &rest body)
+  `(define-key ,keymap ,key (lambda () (interactive) (progn ,@body))))
+
+(defmacro ->> (&rest body)
+  (let ((result (pop body)))
+    (dolist (form body result)
+      (let ((lform (list-wrap form)))
+        (setq result (append lform (list result)))))))
+
+(defmacro -> (&rest body)
+  (let ((result (pop body)))
+    (dolist (form body result)
+      (let ((lform (list-wrap form)))
+        (setq result (append (list (car lform) result)
+                             (cdr lform)))))))
+
+;; Used in the above macros
+(defun list-wrap (x) (if (listp x) x (list x)))
 
 
 ;;;; Prepare package manager


;; Start term mode in line mode and evil emacs mode.
(defadvice term (after advice-term-line-mode activate)
  ;; (term-line-mode)
  (evil-normal-state)
  (evil-emacs-state))


(require 'feature-mode)
(require 'highlight-symbol)
(require 'linum-relative)  ; need melpa version
(require 'popup)
(require 'powerline)
(require 'powerline-evil)
(require 'projectile)
