`magit-git-string': only move point if buffer contains anything

Using a stock configuration, running `magit-status' results in 27 calls
to `magit-git-string', so the less it does, the better.

Even though it doesn't make a measurable difference, there's no point in
moving `point' unless we're sure the buffer contains anything.

Signed-off-by: Pieter Praet <pieter@praet.org>
`magit-diffstat-keymap': fix docstring

Commit 8618430b changed `magit-diffstat-keymap's docstring to refer to
`magit-diffstat-mode', but that doesn't exist.  `magit-diffstat-keymap'
is used in `magit-commit-mode' and `magit-diff-mode' though.

Signed-off-by: Pieter Praet <pieter@praet.org>
`magit-cherry-mode-map': add

Commit 8618430b added a reference to MAPVAR `magit-cherry-mode-map'
in `magit-cherry-mode's docstring, but the former didn't exist.

Signed-off-by: Pieter Praet <pieter@praet.org>
`magit-stash-mode{,-map}': remove

Commit 8618430b added `magit-stash-mode-map', but neither it nor
`magit-stash-mode' (which the former is supposed to be used by)
serve any purpose:  `magit-show-stash' uses `magit-diff-mode'.

Signed-off-by: Pieter Praet <pieter@praet.org>
`string-{prefix,match}-p' (compat): remove

As stated in commit dc72fc03, the `string-prefix-p' and `string-match-p'
compatibility functions no longer serve any purpose since we decided to
drop support for Emacs < v23.2 (see commit 83dac351 and issue #708).

Signed-off-by: Pieter Praet <pieter@praet.org>
`magit-section-jump-map': quickly jump to sections

Add a `magit-status-mode-map' submap which allows to quickly
jump to some common sections in `magit-status-mode'.

Fixes #919.

Suggested-by: Kristian Lein-Mathisen <kristianlein@gmail.com>
Signed-off-by: Pieter Praet <pieter@praet.org>
Merge pull request #938 from praet/stash-mode

`magit-stash-mode{,-map}': remove
Merge pull request #939 from praet/cherry-mode-map

`magit-cherry-mode-map': add
Merge pull request #940 from praet/diffstat-keymap

`magit-diffstat-keymap': fix docstring
Merge pull request #942 from praet/compat-cleanup

`string-{prefix,match}-p' (compat): remove
Merge pull request #943 from praet/git-string-point

`magit-git-string': only move point if buffer contains anything
Merge pull request #944 from praet/section-jump

`magit-section-jump-map': quickly jump to sections
don't require feature when it cannot possible not be loaded yet

 (eval-after-load 'dired-x ; <--.
   '(...                   ;    |
-    (require 'dired-x)    ; <--'
     ...))

What more can I say? ;-)
magit-version: fix comment
fix remote branch names with slashes
Merge pull request #952 from finalpatch/master

fix remote branch names with slashes
magit-get-tracked-branch: prettify
deal with strange location of emacsclient on OS X

On OS X applications are often installed in strange "executable
directories".  The Finder presents these directories as actual
applications to the user who might be blissfully unaware that
clicking on it actually executes a binary inside the directory.

So they have been happily clicking on a flashy image to start
Emacs and we come along requiring emacsclient being on $PATH.

But it gets worse.  The emacsclient executable might not even be
located in the same subdirectory of the application directory:

  /Applications/Emacs.app/Contents/MacOS/emacs
  /Applications/Emacs.app/Contents/MacOS/bin/emacsclient

So we have to look for the emacsclient here too:

  (expand-file-name "bin" invocation-directory)

Also see:

  https://github.com/magit/magit/issues/862#issuecomment-24784266
magit-with-emacsclient: wait longer before resetting server-window

We have to reset the default value of `server-window' using a timer
(see comment close to this change).  Previously we waited 0.2 seconds
before doing so, but it seems that sometimes isn't enough.  Wait a full
second instead.