   (single-key-description (string-to-number (substring keychord-string 2) 16)))
 
 (defun vimgolf-parse-dribble-file (file)
-  (save-current-buffer
-    (let ((temp-buffer (find-file-noselect file)))
-      (set-buffer temp-buffer)
-      (goto-char (point-min))
-      (while (re-search-forward "0x[1-9]0000[a-z0-9]\\{2\\}" nil t)
-        (replace-match (vimgolf-parse-keychord (match-string 0))))
-      (save-buffer)
-      (kill-buffer temp-buffer))))
+  (with-current-buffer (find-file-noselect file)
+    (beginning-of-buffer)
+    (while (re-search-forward "0x[1-9]0000[a-z0-9]\\{2\\}" nil t)
+      (replace-match (vimgolf-parse-keychord (match-string 0))))
+    (save-buffer)
+    (kill-buffer)))
 
 (defun vimgolf-right-solution ()
   (message "Hurray!")

           (get-buffer vimgolf-end-buffer-name) (point-min-in-buffer vimgolf-end-buffer-name) (point-max-in-buffer vimgolf-end-buffer-name)))))

(defun vimgolf-close-and-capture-dribble ()
  (save-current-buffer
    (let ((temp-buffer (find-file-noselect vimgolf-dribble-file-path)))
      (set-buffer temp-buffer)
      (append-to-file (point-min) (point-max) vimgolf-keystrokes-file-path)
      (kill-buffer temp-buffer)))
  (open-dribble-file nil))

(defun vimgolf-open-dribble-file (file)

(defun vimgolf-revert ()
  "Revert the work buffer to it's original state and reset keystrokes."
  (interactive)
  (with-current-buffer (get-buffer-create vimgolf-work-buffer-name)
    (delete-region (point-min) (point-max))
    (insert-buffer (get-buffer-create vimgolf-start-buffer-name))
    (clear-dribble-file)
