move definitions of magit-diff-{del,none} faces
add magit-key-mode-show-usage
improve expansion of staged changes on commit

As requested allow aborting the expansion using C-g.  Document this.

`magit-expand-staged-on-commit' can now nil/non-nil/full.  In the last
case all subsections are expanded.  For any other non-nil value expand
only only the top section; whether the subsections are hidden or
expanded depends on what the user has previously done.
fix saving and restoring window configurations

Also document the behaviour in the relevant
doc-strings - including the limitations.
rename magit-{buffer-switch => display-mode-buffer}

Add "-mode-" to indicate this is only intended for buffers whose major
mode derives from Magit mode.  Replace "switch" with "display" because
this function displays the buffer like `display-buffer' and then either
"switches" *or* "pops" to it.
Merge branch 'winconf'
magit-stage-item: read argument inside interactive
magit-stage-all: cosmetics
use background color to hightlight current item

Visualizing added and removed lines in diffs using the background color
conflicts with also using the background color to highlight the current
item.  This can be overcome by using overlays in both cases - but this
comes with a performance penalty, which might or might not be noticable.
Never-the-less this is now default.  The alternatives are listed in the
doc-string of the new `magit-diff-use-overlays' option.

`magit-wash-diffstats-postwork' was previously one of the places where
section headers got propertized.  The same headers are also propertized
elsewhere, so that functionality is remove.  We should investigate
whether this function and the `magit-diffstat-cached-sections' variable
are needed at all (anymore?).
fix and refactor hunk refinement

* Fix a scope error in `magit-wash-hunk' that prevented all hunks to be
  refined when the user asks for it.

* Add `magit-diff-{,un}refine-hunk' to replace `magit-{,un}refine-section'.

  The former absorb the trivial functions `magit-maybe-diff-refine-hunk'
  and `magit-looking-at-combined-diff-p' which were only used by the
  latter but never-the-less were defined in far away region of the file.

  On the other hand the new functions expect a hunk section as argument.
  Unlike the functions they replace they do not fallback to some section
  pulled from thin air and do not perform any sanity checks that are
  only required by some of the their callers.  The callers now perform
  the appropriate checks themselves.

* Refactor caller `magit-diff-refine-hunk' to skip unnecessary actions.
* Perform some additional cleanup on the caller `magit-highlight-section'.
* Define `magit-highlight-overlay' and `magit-highlighted-sectione' as
  local variables.
* Change `magit-diff-refine-hunk's doc-string to be more like similar
  doc-strings.
when THEN ends with explicit t drop the exlicit nil ELSE

When the body of a function, whose return value is significant, ends
with a conditional whose THEN part ends with an explicit `t' adding
an explicit ELSE part that contains nothing but an explicit `nil' is
overkill as it does not convey any additional meaning.
reduce nesting of some functions in the "Diffs and Hunks" section
remove unnecessary uses of let in some functions

... in the "Diffs and Hunks" section.

Local bindings should only be used when they are necessary because e.g.
(a) the value is used more than once and is costly to calculate (because
of either the computation or visual noise) or (b) the value has to be
calculated before its use because doing retrieving the value and using
it in the same place would change the outcome to to due to scope
differences (e.g. a different buffer is current).

When let is used and neither one of these or other requirements call for
it one is left wondering whether that is indeed the case, or whether one
just overlooks some subtle detail.  This cost outweights the benefit of
implicitly documenting the purpose of the function being called with the
local variables as arguments.

This doesn't full apply here, but the implicit "argument documentation"
argument is very weak in cases like this:

  (let ((very-descriptive-variable (very-descriptive-function something)))
    (only-use-of-the very-descriptive-variable))
magit-diff-default-hunks: remove empty string inside interactive
magit-insert-hunk-item-region-patch: merge conditionals
merge magit-hunk-item-is-conflict-p into only caller
Merge branch 'diff-highlight'
Merge branch 'cleanup'
add magit-mode-setup, all but replacing magit-mode-init

Add new macro `magit-mode-setup' and use it where `magit-mode-init' was
previously used.  Keep the latter for compatibility and because we might
run into situations where the former does to much.

`magit-mode-setup' calls `magit-display-mode-buffer' to display and
select a buffer and then calls `magit-mode-init' to turn on the mode,
store refresh information and perform the first refresh.

It also makes sure that the arguments to `magit-mode-init' are evaluated
in the correct buffer - that is before switching to the mode buffer.
This helps prevent scope errors in the future.  (I am aware of at least
one instance when someone (me) has made exactly that mistake.)
Merge branch 'mode-setup'