 ;;; diffscuss-mode.el --- Major mode for diffscuss files.
 
+;; Copyright (c) 2014 Hut 8 Labs, LLC
+
+;; Author: Edmund Jorgensen <tomheon@gmail.com>
+;; Keywords: tools
+
+;; The MIT License (MIT)
+
+;; Permission is hereby granted, free of charge, to any person obtaining
+;; a copy of this software and associated documentation files (the
+;; "Software"), to deal in the Software without restriction, including
+;; without limitation the rights to use, copy, modify, merge, publish,
+;; distribute, sublicense, and/or sell copies of the Software, and to
+;; permit persons to whom the Software is furnished to do so, subject to
+;; the following conditions:
+
+;; The above copyright notice and this permission notice shall be
+;; included in all copies or substantial portions of the Software.
+
+;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+;; LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+;; OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+;; WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
 ;;; Commentary:
 
+;;; Code:
+
 ;;; Config variables
 
-;; By default, diffscuss will use your git config user.name for new
-;; comments.  You can override that here.
-(defvar diffscuss-author nil)
-
-;; By default, diffscuss will use your git config user.email for new
-;; comments.  You can override that here.
-(defvar diffscuss-email nil)
-
-;; Where to find git, by default assume it's whatever version is in
-;; the path.
-(defvar diffscuss-git-exe "git")
-
-;; The top-level diffscuss command to run.  If you haven't installed
-;; diffscuss somewhere in your path, you can override this to provide
-;; the full path to it.
-(defvar diffscuss-exe "diffscuss")
+(defvar diffscuss-author nil
+  "Author name for new comments.
+By default, diffscuss will use your git config user.name for new
+comments.  You can override that here.")
+
+(defvar diffscuss-email nil
+  "Email address for new comments.
+By default, diffscuss will use your git config user.email for new
+comments.  You can override that here.")
+
+(defvar diffscuss-git-exe (executable-find "git")
+  "Path to git executable.")
+
+(defvar diffscuss-exe "diffscuss"
+  "The top-level diffscuss command to run.
+If you haven't installed diffscuss somewhere in your path, you
+can override this to provide the full path to it.")
 
 ;;; Code:
 

        nil)))

(defun diffscuss-comment-part-regexp (parse-leader from-string to-string)
  "Utility function to help make header / body regexps"
  (concat "^"
          (regexp-quote (replace-regexp-in-string from-string to-string parse-leader))
          "\\([ ]\\|\n\\|$\\)"))

(defun diffscuss-comment-body-regexp (parse-leader)
  "Return a regexp matching the begging of a body line leading with parse-leader"
  (diffscuss-comment-part-regexp parse-leader "*" "-"))

(defun diffscuss-comment-header-regexp (parse-leader)
  "Return a regexp matching the begging of a body line leading with parse-leader"
  (diffscuss-comment-part-regexp parse-leader "-" "*"))

(defun diffscuss-find-body-start ()

(defun diffscuss-insert-file-comment ()
  "Insert a file-level comment."
  (interactive)
  (goto-char (point-min))
  ;; either there's already a file level comment, in which case we
  ;; want to jump in at the bottom of the thread, or not.
  (let ((existing-comment (diffscuss-parse-leader)))
