Fix 'hardcopy -h'.

Make -h save scrollback with or without a file name given. Also,
preserve the unlikely case in which someone actually does want to
save display to '-h'; with

  :hardcopy -- -h

or, to save both history and display to '-h'

  :hardcopy -h -h

Also,

  :hardcopy --
  :hardcopy -h --

will, as they always have, save display or history and display to
'--'.
Use NEED_FORE flag for 'hardcopy'.

Screen wouldn't do anything with 'hardcopy' if there was no
foreground window, except overwriting the specified file (when
hardcopy_append is off, of course). But the NEED_FORE flag wasn't
set. I am not sure why this was the case. So I have added the
NEED_FORE flag so that 'hardcopy' command fails if there is no
foreground window.
Re-organize some code.

This change causes no functional change at all. This simply groups
some common variables into structs.
Improve cursor store/restore on smcup/rmcup.

When going to alternate screen buffer on smcup, the terminal is
supposed to store the cursor position, rendition etc. Screen used to
store only the position (and that was just a little buggy anyway).
So change this behaviour to store all information about the cursor,
and restore everything on rmcup.

Apparently, the terminal is supposed to store the cursor for smcup
(CSI ? 1049 h) and DECSC (ESC 7, CSI s, CSI ? 1048 h) separately. So
be it.
Remove cap for scrollback history.

Remove the unintentionally added cap for scrollback history.
Select window by pressing # in window number.

Thanks to Martin Przyjazny for reporting.
Fix compile error for setenv in HP-UX.

Closes savannah bug #29451.
Update doc about selecting window in windowlist.

Update doc about selecting window in windowlists by pressing its
number. Closes savannah bug #29603.
Misc updates to the man and info pages.

Closes savannag bug #29602.
Credit.
Fix a bug with displaying blank spaces with bce on.

With bce on, in some terminals, copying when applications use a
theme with a custom background color other than the default ends up
copying blank-spaces at the end of the lines as white-spces. This
fixes that.
Fix updating paused regions (in split mode).

Adding a multi-cell character in a split region doesn't always
refresh properly. Fix that problem.
Fix compiling with SIMPLESCREEN.
Bring back --with-sys-screenrc configure flag.
Fix layout ordering.

Layouts were being stored in a reversed list. This makes it
confusing for both users and developers with regards to what the
next layout is ('next', lay_next). So store the layouts in a
properly ordered list in order to avoid the confusion.

This closes savannah #29800.
Spelling fix: usefull --> useful.

Thank you Curtis Brown for the patch.

This resolves bug #27052.
Remember the bell event if there's no current display.

This way, when a user logs back in, he is notified of the bell event that
happened while detached.
Merge branch 'master' of git://git.savannah.gnu.org/screen
Make 'layout' subcommands work when detached.

Ideally, splits and layouts should be allowed when there's no display. At this
moment, you can just create a few layouts and name them when detached.

BUG=28386
Fix a crash when attaching to a layout that was created while detached.