   (dolist (item list)
     (princ item)
     (princ "\n")))
+
+(defun lstrip (s)
+  (let ((l (length s))
+        (i 0))
+    (while (and (< i l)
+                (whitespace-char? (aref s i)))
+      (setq i (1+ i)))
+    (substring s i l)))
+
+(defun rstrip (s)
+  (let ((i (length s)))
+    (while (and (> i 0)
+                (whitespace-char? (aref s (1- i))))
+      (setq i (1- i)))
+    (substring s 0 i)))
+
+(defun strip (s) (rstrip (lstrip s)))
+
+(defun whitespace-char? (c) (or (= c ? ) (= c ?\t) (= c ?\n)))
+
+(defun move-down-to-nonempty-line ()
+  (while (and (not (at-last-line?)) (current-line-whitespace?))
+    (forward-line 1)))
+
+(defun move-up-to-nonempty-line ()
+  (while (and (not (at-first-line?)) (current-line-whitespace?))
+    (forward-line -1)))
+
+(defun current-line-whitespace? ()
+  (= (length (strip (current-line))) 0))
+
+(defun at-first-line? () (= (line-beginning-position) 1))
+(defun at-last-line? () (= (line-end-position) (buffer-end 1)))
+
+(defun current-line ()
+    (buffer-substring-no-properties (line-beginning-position)
+                                    (line-end-position)))
+
+(defun current-indent ()
+  (let ((old-pos (point)))
+    (move-down-to-nonempty-line)
+    (let ((s (current-line)))
+      (goto-char old-pos)
+      (- (length s) (length (lstrip s))))))
+
+(defun str* (str n)
+  (let ((retval ""))
+    (dotimes (i n)
+      (setq retval (concat retval str)))
+    retval))


;;;; Predicates for telling which system I am on
(defun windowsp () (eq system-type 'windows-nt))
(defun work-windowsp () (file-exists-p "C:/Users/IBM_ADMIN"))
(defun work-linuxp () (file-exists-p "/media/sf_VirtualBox_Share"))
(defun home-linuxp () (file-exists-p "/home/chris/stuff"))


;;;; Options

;; F9
;; F12

(define-key global-map (leader+ "q") 'linum-relative-toggle)

;; Scroll by 5
(dolist (k '("C-S-e" "<C-down>"))
