make edlin understand a few important control keys

Dear all,

the patch attached to this e-mail teaches edlin.erl a few more important
control keys that many users might have become *VERY* accustomed to. The
control keys are:

 - <CTRL>+W	: backward kill word
 - <CTRL>+U	: backward kill line
 - <HOME>	: goto start of line
 - <END>	: goto end of line
 - <CTRL>+<LEFT>  : backward word
 - <CTRL>+<RIGHT> : forward word

With this patch in place, command line editing in erlang's own shell as
well as in any input using io:get_line() comes a little closer to that
in many contemporary shells.

Kind regards,

--
Dr. Stefan Zegenhagen

arcutronix GmbH
Garbsener Landstr. 10
30419 Hannover
Germany

Tel:   +49 511 277-2734
Fax:   +49 511 277-2709
Email: stefan.zegenhagen@arcutronix.com
Web:   www.arcutronix.com

*Synchronize the Ethernet*

General Managers: Dipl. Ing. Juergen Schroeder, Dr. Josef Gfrerer -
Legal Form: GmbH, Registered office: Hannover, HRB 202442, Amtsgericht
Hannover; Ust-Id: DE257551767.

Please consider the environment before printing this message.

>From 39f497adec90fc397f366da275fd5a7ca748cc5f Mon Sep 17 00:00:00 2001
From: Stefan Zegenhagen <stefan.zegenhagen@arcutronix.com>
Date: Mon, 6 May 2013 14:39:07 +0200
Subject: [PATCH] [EDLIN] support a few more control keys

Add support for the following control keys that many users have become
accustomed to:
 - <CTRL>+W         : backward kill word
 - <CTRL>+U         : backward kill line
 - <HOME>           : goto start of line
 - <END>            : goto end of line
 - <CTRL>+<LEFT>    : backward word
 - <CTRL>+<RIGHT>   : forward word

It seems that the <CTRL>+<LEFT|RIGHT> control key sequences are
different between terminal emulators, therefore a few possible
combinations were added (similar to how libreadline is configured).
Added primary bootstrap
Add Fd usage in rb logging

rb was only accepting physical filenames as log file.
This patch allow rb to accept now any io_device, valid registered name,
except standard_error which is replaced by standard_io.
rb:list use standard_io when log file is a terminal otherwise
result of rb:list is written in the log file. That could not be
possible before.
Add Fd usage in rb logging

fix rb_SUITE errors due to rb:list was printing in logfile.
changed back to former behaviour (rb:list print on standard_io),
and creation of two new exported functions : rb:log_list/1-2
that print in log file if existing, otherwise on standard_io.
rb_SUITE do not fail anymore.
Change usage

The usage of new functions log_list was unclear.
Fix documentation

Modification of documentation was lost in rebase.
Add new functions documentation
Fix variable usage tracking in erl_lint

When analyzing complex expressions (i.e. comprehensions, cases, tries,
ifs and receives), erl_lint does not forget about old unused variables
when returning the updated variable table. This causes a bug where old
unused variables are not recorded as such:

t(X, Y) ->
  #r{a=[ K || K <- Y ],b=[ K || K <- Y ]}.

As erl_lint uses vtmerge_pat/2 to merge the results of the analysis of
the two list comprehensions, X is marked as used and the warning is not
emitted.

The function vtmerge_pat/2 is used instead of the similar vtmerge/2
which does not mark multiple occurrences of a variable as usage to
handle cases like the following one:

t(X, Y) ->
  #r{a=A=X,b=A=Y}.

Other simpler expressions like conses, tuples and external fun
references do not correctly follow this behaviour, e.g. A is not marked
as used in the following code:

t(X, Y) ->
  {A=X,A=Y}.

This commit fixes both issues and makes erl_lint not return old unused
variables in updated tables and makes all compound expressions use
vtmerge_pat/2.

Reported-by: Anders Ramsell
Fix unsafe variable tracking in try expressions

Variables used in the body of a try expression were marked as unsafe
*and* used, which makes no sense as an unsafe variable can't be used.

Function vtsubtract/2 is used to forget usage of such unsafe variables.

Reported-by: Paul Davis
Fix UTF8String encode

To accept any nested list of codepoints and binaries. A list containing
a binary was previously misinterpreted and the documentation was
incomplete.

Also, rework codec suite slightly to be able to specify values for which
decode o encode is the identity map, for which encode should succeed,
and for which encode should fail.
Use module unicode for UTF8String encode/decode

The original code predates that module but there's no reason not to use
it now.
Simplify Address encode/decode

By using binary comprehensions. Add string-valued addresses to codec
suite.
Fix variable usage tracking in some record errors

When reporting a field redefinition in a record, erl_lint can forget
about some old unused variables.
Merge branch 'anders/diameter/UTF8String_encode/OTP-11172' into maint

* anders/diameter/UTF8String_encode/OTP-11172:
  Simplify Address encode/decode
  Use module unicode for UTF8String encode/decode
  Fix UTF8String encode
Forbid returning a match context in beam_validator

If a match context is returned from a function without being converted
back to a plain old binary, the whole VM will crash.
Added primary bootstrap
Merge branch 'dg/win_icon' into pu
Merge branch 'ao/fix_mnesia_block_table_exception' into pu
Merge branch 'sze/edlin_understand_keys' into pu
Merge branch 'sze/limit_max_length_int_shell' into pu