 (defun diffscuss-insert-file-comment ()
   "Insert a file-level comment."
   (interactive)
-  (beginning-of-buffer)
+  (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)))

(defun diffscuss-get-git-config (config-name)
  (with-temp-buffer
    (call-process diffscuss-git-exe nil t nil "config" "--get" config-name)
    (trim-string (buffer-string))))

(defun trim-string (string)
  "Remove white spaces in beginning and ending of STRING.
White space here is any of: space, tab, emacs newline (line feed, ASCII 10)."
(replace-regexp-in-string "\\`[ \t\n]*" ""

;;; 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

(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:

