Give magit skip-header a face

Match git-commit-skip-magit-header-regexp to give the expression a
preprocessor face.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Remove unused binding comment-start

comment-start is bound to (point) in
git-commit-find-pseudo-header-position, but used nowhere.  Remove it.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Simplify finding pseudo-header position

The logic git-commit-find-pseudo-header-position is unnecessary buggy
and unnecessarily convoluted.  It currently makes the assumption that
only pseudo-header lines can contain the ':' character.  This faulty
assumption manifests itself as bugs when attempting to "C-c C-s" in a
commit message like this one (where the summary contains a ':').

Further, this is unnecessarily convoluted as there is no need to look
for existing pseudo headers at all.  It's sufficient to look for the
first non-empty line preceding the comments (if any).

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Fix buggy insert-header logic

The current logic for inserting the header after determining header-at
is riddled with bugs.  Most significantly, it completely omits the case
when header-at is at end-of-line (which happens when your buffer is not
terminated with a newline).  Also, the logic for looking for an existing
pseudo-header is completely bogus: it just looks for a line with the
character ':'.

Redo the entire logic in a dedicated function.  This function uses
git-commit-known-pseudo-headers to find existing pseudo headers
correctly and can return either zero, one, or two newlines.  Its logic
is flawless, as it considers every corner case.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Merge pull request #15 from artagnon/commit-mode

Improvements to commit-mode