magit-insert-header: replace magit-insert-line-section

The new function has a name that more explicitly says what this is
intended for, and it is more convenient.
magit-insert-status-remote-line: absorb magit-format-tracked-line
magit-insert-status-remote-line: don't put parens around url

Since we also don't do that for the path on the header inserted
by `magit-insert-status-local-line'.
give each header section a suitable type and value

And for headers that don't have a value use `header' instead of `line'
as type.
clarify distinction between a section's type and value

Originally there were these three related but distinct slots: `type',
`info', and `header'.  The last one was unnecessary and only existed
because someone got confused about the distinction between the other
two and was removed when I last refactored the section code.

Now the time has come to make the distinction between the "type" and the
"info" more clear.  We start by using the term "value" instead of
"info", because that's what it is.

There are two categories of sections: those that represent a thing, and
those that serve as containers for other sections.  A section can fall
into both categories.

Every section has a type, a symbol.  Sections that represent a "thing",
such as a file or hunk also have a value, usually a string (but that is
not enforced).  Sections that only serve as containers do not have a
value (i.e. the value is nil).

Together the type and value of a section and the types of recursively
all parent sections can be used to uniquely identify a section within
a buffer.  For container-only sections the types are sufficient because
there always is only one section of a particular container-only
type.  (That is a convention and isn't enforced.)  Meanwhile there can
be many e.g. `commit' sections and to tell them apart the values (here
the commit hashes) also have to be compared.

Sadly someone got confused along the way and started to use the just
the values (then more ambitiously called "info") to identify sections.
Since many sections don't actually have a value the result was that
for sections that would otherwise not have a value, the type was stored
in the `value' slot as well.

This commit adds function `magit-section-ident' which returns a list of
conses that can be used to uniquely identify a section as described.
Function `magit-find-section' is changed to use that value, instead of
using the value-except-when-it-actually-is-the-type.  For sections that
have no value the value of the `value' slot now is nil.
rename section struct slot BEGINNING to START

This causes the accessor `magit-section-beginning' to be renamed to
`magit-section-start'.  I'll admit it, I am doing this just because
"start" is shorter than "beginning".  Because the section code is
currently being refactored heavily anyway, doing so now causes only
little additional harm (in form of third-party code that might have
to be adapted), if any.
rename section struct slot CONTENT-BEGINNING to CONTENT

Currently this slot always holds a marker (though sometimes it points
somewhere strange and cannot be relied on).  Starting in subsequent
commits this slot will be used to hold either such a marker, nil (to
indicate that the section has no body), or a function (which is then
used to actually create the body on expansion).
magit-with-section: make NAME argument optional, move before ARGLIST

There actually are very few cases where the BODY of `magit-with-section'
has to refer to the section object, so it doesn't make sense to always
have to specify the name of the "symbol which isn't being used".
magit-{insert,put-face-property}: move definitions

These functions are intended for use in `magit-with-section's BODY only.
magit-with-section: insert the heading before the body

Remove the HEADING argument from `magit-with-section' and instead expect
the callers to insert the HEADING themselves, using the new
`magit-insert-heading'.  Besides inserting the heading text in a fashion
similar to how the more general `magit-insert' works, this function also
sets the sections CONTENT slot to the position after the text previously
inserted.  The default value of that slot now is nil, indicating that
the section isn't divided into a heading and a body, i.e. it cannot be
collapsed.

Previously `magit-with-section' did evaluate its BODY to insert the
sections body text, and only then went back to the beginning of the
section and inserted the heading it had received as a separate argument.
This was done because when HEADING ending with ":" indicates that the
number of child sections shall be shown in the heading.  We no longer
delay inserting the heading until we know how many children there are.
Instead we insert the heading without the count and then later go back
and insert the count.  Inserting the heading later than the body
complicated things a lot and lead to difficult to fix bugs.
magit-cancel-section: new function

Previously we depended on the return value of `magit-with-section'
being nil to trigger the cancellation of the section currently being
inserted.  Now we use the new function `magit-cancel-section' which
does a non-local exit from a catch setup in `magit-with-section'.

Doing it this way is not necessary at this point yet, but it does give
us additional flexibility.  I.e. code that inserts a section no longer
has to be lexically within `magit-with-section's BODY.  We will use that
in a subsequent commit.
rename magit-with-section to magit-insert-section

Because this is a macro that does "something with something" the term
"with" actually does make sense.  However the "something it does" is
different from that that macros that are part of Emacs do.  We do not
make something current that already exists and we also don't create
something which is disposed of again after the macros BODY.  I.e. our
macro is neither like `with-current-buffer' nor like `with-temp-buffer'.

The side-effect of inserting a section is the raison d'être of this
macro.  Reflect that in the name.
magit-git-wash: new function

Separate the task of inserting and washing output from a command from
the task of creating a section.  This in a sense was already the case
previously in that `magit-cmd-insert-section' made use of the macro
`magit-insert-section' to do the creation part.

Replace `magit-cmd-insert-section' and `magit-cmd-insert-section' with
`magit-git-wash'.  It is just a thin wrapper around `magit-git-insert'
which additionally calls some function to wash the inserted text.  It
also knows how to cancel the section currently being created if either
Git produces no output or washing the output completely.  That is
different from what `magit-cmd-insert-section' which never canceled
before calling the washer.

Code that previously used `magit-git-insert-section' now has to
explicitly use `magit-insert-section', `magit-insert-heading', and
`magit-git-wash'.  That usually means that it takes four lines of code
instead of tree to do so, but it also makes this more flexible and
prettier to look at.

There is no substitute for `magit-cmd-insert-section', i.e. we now only
provide a "insert-and-wash" function for Git but not arbitrary commands,
because, well that's what Magit is about.  There were only two direct
uses of `magit-cmd-insert-section', one in `magit-stgit.el' and one in
`magit-topgit.el'.  These uses are now replaced with a bit of code
duplication.
magit-insert-header: change signature

This follows similar changes to `magit-insert-section'.
improve process sections

Create all process sections "expanded".  Previously we did initially
collapse sections unless the *magit-process* buffer was already visible
in the current frame.  That was inconvenient because one might switch
to that buffer to see why something is taking long, only to first have
to expand the respective section.

Never-the-less it is useful to hide sections whose output the user
"probably doesn't want to see" in most cases.  So when a process returns
with exit code then the section is automatically collapsed.

Likewise inserting the exit code into the process sections buffer is now
done in a more reasonable way, without ending up putting point somewhere
inside the heading, instead of at its beginning.

Also do not put an extra empty line between sections and remove some
other kludges.  Now that headings are inserted before their bodies we no
longer need to do that.
Merge branch 'n/insert-section' into next
unbox all faces

Stop putting a box around all faces.  I assume these boxes where there
because until very recently changing the background color of the current
section to highlight it meant that all background colors of elements of
that section (such as refnames in logs) would lose their background
color.  That has been fixed now, such things are now propertized using
overlays which stay above the current-section-overlay.
use the same tag and branch faces in headers as elsewhere

Stop using the `magit-tag' and `magit-branch' faces in headers.  Now
that the `magit-log-head-label-*'s no longer need a box around them
(because the background color no longer gets overwritten by section
highlighting) we also no longer need alternative box-less faces.
(I suppose we had those because the boxed variants were "making the
headers to noisy", or something).

Remove these faces and instead use `magit-log-head-label-tags',
`magit-log-head-label-local', `magit-log-head-label-remote'.  The
prefixes of these faces are very silly, even if they were only used
in logs, which hasn't been the case for a long time now.  That will
be addresses in a later commit.  In fact `magit-log-head-label-tags'
will then be renamed to `magit-tag', completing the cycle.

Also note that we now use two distinct faces for local and remote in
headers too, just like we have done everywhere else for quite some time
That also means we no longer have to say something silly like "branch @
remote" and can instead just use "remote/branch" (again, you guessed it,
like everywhere else).
rename magit-ref{s => }-namespaces
magit-ref-namespace: add entry for stgit patches in magit-stgit.el